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: Rebased Created July 28, 2015, 9:55 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
« no previous file with comments | « 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 22 matching lines...) Expand all
33 dispatchID_SetLanguage, 33 dispatchID_SetLanguage,
34 dispatchID_GetLanguage, 34 dispatchID_GetLanguage,
35 dispatchID_GetWhitelistDomains, 35 dispatchID_GetWhitelistDomains,
36 dispatchID_AddWhitelistDomain, 36 dispatchID_AddWhitelistDomain,
37 dispatchID_RemoveWhitelistDomain, 37 dispatchID_RemoveWhitelistDomain,
38 dispatchID_GetAppLocale, 38 dispatchID_GetAppLocale,
39 dispatchID_GetDocumentationLink, 39 dispatchID_GetDocumentationLink,
40 dispatchID_IsAcceptableAdsEnabled, 40 dispatchID_IsAcceptableAdsEnabled,
41 dispatchID_SetAcceptableAdsEnabled, 41 dispatchID_SetAcceptableAdsEnabled,
42 dispatchID_IsUpdate, 42 dispatchID_IsUpdate,
43 dispatchID_GetConversion
43 }; 44 };
44 45
45 /** 46 /**
46 * Auxiliary for static initialization 47 * Auxiliary for static initialization
47 */ 48 */
48 std::unordered_map<std::wstring, DISPID> InitMethodIndex() 49 std::unordered_map<std::wstring, DISPID> InitMethodIndex()
49 { 50 {
50 std::unordered_map<std::wstring, DISPID> m; 51 std::unordered_map<std::wstring, DISPID> m;
51 // try-block for safety during static initialization 52 // try-block for safety during static initialization
52 try 53 try
53 { 54 {
54 m.emplace(L"GetMessage", dispatchID_GetMessage); 55 m.emplace(L"GetMessage", dispatchID_GetMessage);
55 m.emplace(L"GetLanguageCount", dispatchID_GetLanguageCount); 56 m.emplace(L"GetLanguageCount", dispatchID_GetLanguageCount);
56 m.emplace(L"GetLanguageByIndex", dispatchID_GetLanguageByIndex); 57 m.emplace(L"GetLanguageByIndex", dispatchID_GetLanguageByIndex);
57 m.emplace(L"GetLanguageTitleByIndex", dispatchID_GetLanguageTitleByIndex); 58 m.emplace(L"GetLanguageTitleByIndex", dispatchID_GetLanguageTitleByIndex);
58 m.emplace(L"SetLanguage", dispatchID_SetLanguage); 59 m.emplace(L"SetLanguage", dispatchID_SetLanguage);
59 m.emplace(L"GetLanguage", dispatchID_GetLanguage); 60 m.emplace(L"GetLanguage", dispatchID_GetLanguage);
60 m.emplace(L"GetWhitelistDomains", dispatchID_GetWhitelistDomains); 61 m.emplace(L"GetWhitelistDomains", dispatchID_GetWhitelistDomains);
61 m.emplace(L"AddWhitelistDomain", dispatchID_AddWhitelistDomain); 62 m.emplace(L"AddWhitelistDomain", dispatchID_AddWhitelistDomain);
62 m.emplace(L"RemoveWhitelistDomain", dispatchID_RemoveWhitelistDomain); 63 m.emplace(L"RemoveWhitelistDomain", dispatchID_RemoveWhitelistDomain);
63 m.emplace(L"GetAppLocale", dispatchID_GetAppLocale); 64 m.emplace(L"GetAppLocale", dispatchID_GetAppLocale);
64 m.emplace(L"GetDocumentationLink", dispatchID_GetDocumentationLink); 65 m.emplace(L"GetDocumentationLink", dispatchID_GetDocumentationLink);
65 m.emplace(L"IsAcceptableAdsEnabled", dispatchID_IsAcceptableAdsEnabled); 66 m.emplace(L"IsAcceptableAdsEnabled", dispatchID_IsAcceptableAdsEnabled);
66 m.emplace(L"SetAcceptableAdsEnabled", dispatchID_SetAcceptableAdsEnabled); 67 m.emplace(L"SetAcceptableAdsEnabled", dispatchID_SetAcceptableAdsEnabled);
67 m.emplace(L"IsUpdate", dispatchID_IsUpdate); 68 m.emplace(L"IsUpdate", dispatchID_IsUpdate);
69 m.emplace(L"GetConversion", dispatchID_GetConversion);
68 } 70 }
69 catch(...) 71 catch(...)
70 { 72 {
71 } 73 }
72 return m; 74 return m;
73 } 75 }
74 76
75 /** 77 /**
76 * Static map from method names to dispatch identifiers. 78 * Static map from method names to dispatch identifiers.
77 */ 79 */
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 { 436 {
435 return DISP_E_BADPARAMCOUNT; 437 return DISP_E_BADPARAMCOUNT;
436 } 438 }
437 if (pVarResult) 439 if (pVarResult)
438 { 440 {
439 pVarResult->vt = VT_BOOL; 441 pVarResult->vt = VT_BOOL;
440 pVarResult->boolVal = CPluginClient::GetInstance()->GetPref(L"displayU pdatePage", false) ? VARIANT_TRUE : VARIANT_FALSE; 442 pVarResult->boolVal = CPluginClient::GetInstance()->GetPref(L"displayU pdatePage", false) ? VARIANT_TRUE : VARIANT_FALSE;
441 } 443 }
442 } 444 }
443 break; 445 break;
446 case dispatchID_GetConversion:
447 {
448 if (pDispparams->cArgs != 0)
449 {
450 return DISP_E_BADPARAMCOUNT;
451 }
452 if (pVarResult)
453 {
454 pVarResult->vt = VT_BSTR;
455 pVarResult->bstrVal = CComBSTR(CPluginClient::GetInstance()->GetPref(L "convertedFrom", L"").c_str());
456 }
457 }
458 break;
444 default: 459 default:
445 return DISP_E_MEMBERNOTFOUND; 460 return DISP_E_MEMBERNOTFOUND;
446 break; 461 break;
447 } 462 }
448 } 463 }
449 catch (...) 464 catch (...)
450 { 465 {
451 return E_FAIL; 466 return E_FAIL;
452 } 467 }
453 return S_OK; 468 return S_OK;
454 } 469 }
OLDNEW
« no previous file with comments | « src/plugin/PluginClass.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld