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

Unified Diff: src/plugin/PluginClass.cpp

Issue 5338025085108224: Support Acceptable Ads (Closed)
Patch Set: Created April 14, 2014, 7:01 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/PluginClass.cpp
===================================================================
--- a/src/plugin/PluginClass.cpp
+++ b/src/plugin/PluginClass.cpp
@@ -20,6 +20,7 @@
DWORD profileTime = 0;
#endif
Felix Dahlke 2014/06/30 17:24:04 I liked it better with just one line of whitespace
+
typedef HANDLE (WINAPI *OPENTHEMEDATA)(HWND, LPCWSTR);
typedef HRESULT (WINAPI *DRAWTHEMEBACKGROUND)(HANDLE, HDC, INT, INT, LPRECT, LPRECT);
typedef HRESULT (WINAPI *CLOSETHEMEDATA)(HANDLE);
@@ -1340,6 +1341,17 @@
}
GetBrowser()->Refresh();
}
+ case ID_MENU_ACCEPTABLE_ADS:
+ {
+ if (client->AcceptableAdsStatus())
+ {
+ client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl", L""));
+ }
+ else
+ {
+ client->AddSubscription(client->GetPref(L"subscriptions_exceptionsurl", L""));
+ }
+ }
default:
break;
}
@@ -1437,6 +1449,23 @@
fmii.cch = static_cast<UINT>(ctext.size());
::SetMenuItemInfoW(hMenu, ID_MENU_SETTINGS, FALSE, &fmii);
+ ctext = dictionary->Lookup("menu", "menu-acceptable-ads");
+ // Are Acceptable Ads enabled?
Felix Dahlke 2014/06/30 17:24:04 This comment can also go if the function is called
+ if (client->AcceptableAdsStatus())
+ {
+ fmii.fState = MFS_CHECKED | MFS_ENABLED;
+ }
+ else
+ {
+ fmii.fState = MFS_UNCHECKED | MFS_ENABLED;
+ }
+ fmii.fMask = MIIM_STRING | MIIM_STATE;
+ fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str());
+ fmii.cch = static_cast<UINT>(ctext.size());
+
+ ::SetMenuItemInfoW(hMenu, ID_MENU_ACCEPTABLE_ADS, FALSE, &fmii);
+
+
return true;
}

Powered by Google App Engine
This is Rietveld