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

Unified Diff: src/plugin/PluginUserSettings.cpp

Issue 11300014: Injecting libadblockplus into IE (Closed)
Patch Set: Created July 29, 2013, 5:30 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/PluginUserSettings.cpp
===================================================================
--- a/src/plugin/PluginUserSettings.cpp
+++ b/src/plugin/PluginUserSettings.cpp
@@ -14,8 +14,9 @@
static const CString s_GetWhitelistDomains = L"GetWhitelistDomains";
static const CString s_AddWhitelistDomain = L"AddWhitelistDomain";
static const CString s_RemoveWhitelistDomain = L"RemoveWhitelistDomain";
+static const CString s_Require = L"require";
-static const CString s_Methods[] = {s_GetMessage, s_GetLanguageCount, s_GetLanguageByIndex, s_GetLanguageTitleByIndex, s_SetLanguage, s_GetLanguage, s_GetWhitelistDomains, s_AddWhitelistDomain, s_RemoveWhitelistDomain};
+static const CString s_Methods[] = {s_GetMessage, s_GetLanguageCount, s_GetLanguageByIndex, s_GetLanguageTitleByIndex, s_SetLanguage, s_GetLanguage, s_GetWhitelistDomains, s_AddWhitelistDomain, s_RemoveWhitelistDomain, s_Require};
CPluginUserSettings::CPluginUserSettings()
{
@@ -305,6 +306,25 @@
settings->RemoveWhiteListedDomain((BSTR)domain);
}
}
+ else if (s_Require == method)
+ {
+ if (1 != pDispparams->cArgs)
+ return DISP_E_BADPARAMCOUNT;
+
+ if (VT_BSTR != pDispparams->rgvarg[0].vt)
+ return DISP_E_TYPEMISMATCH;
+
+ pVarResult->vt = VT_BSTR;
+ CComBSTR name = pDispparams->rgvarg[0].bstrVal;
+ if (name.Length())
+ {
+ pVarResult->bstrVal = SysAllocString(settings->GetRequire(std::wstring(name)));
+ }
+ else
+ {
+ pVarResult->bstrVal = SysAllocString(L"");
+ }
+ }
else
return DISP_E_MEMBERNOTFOUND;

Powered by Google App Engine
This is Rietveld