Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginUserSettings.cpp

Issue 10948032: Fix domain-based whitelisting (Closed)
Patch Set: Created June 17, 2013, 1:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/PluginTabBase.cpp ('k') | src/shared/Communication.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 #include "PluginUserSettings.h" 2 #include "PluginUserSettings.h"
3 #include <algorithm> 3 #include <algorithm>
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #include "PluginClient.h" 5 #include "PluginClient.h"
6 #include "PluginIniFileW.h" 6 #include "PluginIniFileW.h"
7 7
8 static const CString s_GetMessage = L"GetMessage"; 8 static const CString s_GetMessage = L"GetMessage";
9 static const CString s_GetLanguageCount = L"GetLanguageCount"; 9 static const CString s_GetLanguageCount = L"GetLanguageCount";
10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex";
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 306 }
307 else if (s_RemoveWhitelistDomain == method) 307 else if (s_RemoveWhitelistDomain == method)
308 { 308 {
309 if (1 != pDispparams->cArgs) 309 if (1 != pDispparams->cArgs)
310 return DISP_E_BADPARAMCOUNT; 310 return DISP_E_BADPARAMCOUNT;
311 311
312 if (VT_BSTR != pDispparams->rgvarg[0].vt) 312 if (VT_BSTR != pDispparams->rgvarg[0].vt)
313 return DISP_E_TYPEMISMATCH; 313 return DISP_E_TYPEMISMATCH;
314 314
315 CComBSTR domain = pDispparams->rgvarg[0].bstrVal; 315 CComBSTR domain = pDispparams->rgvarg[0].bstrVal;
316 if (settings->IsWhiteListedDomain((BSTR)domain)) 316 if (domain.Length())
317 { 317 {
318 settings->AddWhiteListedDomain((BSTR)domain); 318 settings->RemoveWhiteListedDomain((BSTR)domain);
319 CPluginClient::GetInstance()->ClearWhiteListCache();
320 } 319 }
321 } 320 }
322 else 321 else
323 return DISP_E_MEMBERNOTFOUND; 322 return DISP_E_MEMBERNOTFOUND;
324 323
325 return S_OK; 324 return S_OK;
326 } 325 }
327 326
OLDNEW
« no previous file with comments | « src/plugin/PluginTabBase.cpp ('k') | src/shared/Communication.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld