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

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

Issue 5024350814076928: Issue 1103 - Migrate Simple Adblock users
Patch Set: Make it less Simple Adblock specific, and add the FRP changes Created April 16, 2015, 9:52 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« src/plugin/PluginClass.cpp ('K') | « src/plugin/PluginClass.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 23 matching lines...) Expand all
34 dispatchID_SetLanguage, 34 dispatchID_SetLanguage,
35 dispatchID_GetLanguage, 35 dispatchID_GetLanguage,
36 dispatchID_GetWhitelistDomains, 36 dispatchID_GetWhitelistDomains,
37 dispatchID_AddWhitelistDomain, 37 dispatchID_AddWhitelistDomain,
38 dispatchID_RemoveWhitelistDomain, 38 dispatchID_RemoveWhitelistDomain,
39 dispatchID_GetAppLocale, 39 dispatchID_GetAppLocale,
40 dispatchID_GetDocumentationLink, 40 dispatchID_GetDocumentationLink,
41 dispatchID_IsAcceptableAdsEnabled, 41 dispatchID_IsAcceptableAdsEnabled,
42 dispatchID_SetAcceptableAdsEnabled, 42 dispatchID_SetAcceptableAdsEnabled,
43 dispatchID_IsUpdate, 43 dispatchID_IsUpdate,
44 dispatchID_GetConversion
44 }; 45 };
45 46
46 /** 47 /**
47 * Auxiliary for static initialization 48 * Auxiliary for static initialization
48 */ 49 */
49 std::unordered_map<std::wstring, DISPID> InitMethodIndex() 50 std::unordered_map<std::wstring, DISPID> InitMethodIndex()
50 { 51 {
51 std::unordered_map<std::wstring, DISPID> m; 52 std::unordered_map<std::wstring, DISPID> m;
52 // try-block for safety during static initialization 53 // try-block for safety during static initialization
53 try 54 try
54 { 55 {
55 m.emplace(L"GetMessage", dispatchID_GetMessage); 56 m.emplace(L"GetMessage", dispatchID_GetMessage);
56 m.emplace(L"GetLanguageCount", dispatchID_GetLanguageCount); 57 m.emplace(L"GetLanguageCount", dispatchID_GetLanguageCount);
57 m.emplace(L"GetLanguageByIndex", dispatchID_GetLanguageByIndex); 58 m.emplace(L"GetLanguageByIndex", dispatchID_GetLanguageByIndex);
58 m.emplace(L"GetLanguageTitleByIndex", dispatchID_GetLanguageTitleByIndex); 59 m.emplace(L"GetLanguageTitleByIndex", dispatchID_GetLanguageTitleByIndex);
59 m.emplace(L"SetLanguage", dispatchID_SetLanguage); 60 m.emplace(L"SetLanguage", dispatchID_SetLanguage);
60 m.emplace(L"GetLanguage", dispatchID_GetLanguage); 61 m.emplace(L"GetLanguage", dispatchID_GetLanguage);
61 m.emplace(L"GetWhitelistDomains", dispatchID_GetWhitelistDomains); 62 m.emplace(L"GetWhitelistDomains", dispatchID_GetWhitelistDomains);
62 m.emplace(L"AddWhitelistDomain", dispatchID_AddWhitelistDomain); 63 m.emplace(L"AddWhitelistDomain", dispatchID_AddWhitelistDomain);
63 m.emplace(L"RemoveWhitelistDomain", dispatchID_RemoveWhitelistDomain); 64 m.emplace(L"RemoveWhitelistDomain", dispatchID_RemoveWhitelistDomain);
64 m.emplace(L"GetAppLocale", dispatchID_GetAppLocale); 65 m.emplace(L"GetAppLocale", dispatchID_GetAppLocale);
65 m.emplace(L"GetDocumentationLink", dispatchID_GetDocumentationLink); 66 m.emplace(L"GetDocumentationLink", dispatchID_GetDocumentationLink);
66 m.emplace(L"IsAcceptableAdsEnabled", dispatchID_IsAcceptableAdsEnabled); 67 m.emplace(L"IsAcceptableAdsEnabled", dispatchID_IsAcceptableAdsEnabled);
67 m.emplace(L"SetAcceptableAdsEnabled", dispatchID_SetAcceptableAdsEnabled); 68 m.emplace(L"SetAcceptableAdsEnabled", dispatchID_SetAcceptableAdsEnabled);
68 m.emplace(L"IsUpdate", dispatchID_IsUpdate); 69 m.emplace(L"IsUpdate", dispatchID_IsUpdate);
70 m.emplace(L"GetConversion", dispatchID_GetConversion);
69 } 71 }
70 catch(...) 72 catch(...)
71 { 73 {
72 } 74 }
73 return m; 75 return m;
74 } 76 }
75 77
76 /** 78 /**
77 * Static map from method names to dispatch identifiers. 79 * Static map from method names to dispatch identifiers.
78 */ 80 */
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 { 437 {
436 return DISP_E_BADPARAMCOUNT; 438 return DISP_E_BADPARAMCOUNT;
437 } 439 }
438 if (pVarResult) 440 if (pVarResult)
439 { 441 {
440 pVarResult->vt = VT_BOOL; 442 pVarResult->vt = VT_BOOL;
441 pVarResult->boolVal = CPluginClient::GetInstance()->GetPref(L"displayU pdatePage", false) ? VARIANT_TRUE : VARIANT_FALSE; 443 pVarResult->boolVal = CPluginClient::GetInstance()->GetPref(L"displayU pdatePage", false) ? VARIANT_TRUE : VARIANT_FALSE;
442 } 444 }
443 } 445 }
444 break; 446 break;
447 case dispatchID_GetConversion:
448 {
449 if (pDispparams->cArgs != 0)
450 {
451 return DISP_E_BADPARAMCOUNT;
452 }
453 if (pVarResult)
454 {
455 pVarResult->vt = VT_BSTR;
456 pVarResult->bstrVal = CComBSTR(CPluginClient::GetInstance()->GetPref(s td::wstring(L"convertedFrom"), std::wstring(L"")).c_str());
457 }
458 }
459 break;
445 default: 460 default:
446 return DISP_E_MEMBERNOTFOUND; 461 return DISP_E_MEMBERNOTFOUND;
447 break; 462 break;
448 } 463 }
449 } 464 }
450 catch (...) 465 catch (...)
451 { 466 {
452 return E_FAIL; 467 return E_FAIL;
453 } 468 }
454 return S_OK; 469 return S_OK;
455 } 470 }
OLDNEW
« src/plugin/PluginClass.cpp ('K') | « src/plugin/PluginClass.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld