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

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

Issue 29332455: Issue #1596, #1720 - Make status bar menu consistent with plugin abilities (Closed)
Patch Set: address comments Created Dec. 9, 2015, 12: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 | « no previous file | src/plugin/PluginTabBase.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 /* 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 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 1121
1122 MENUITEMINFOW miiSep = {}; 1122 MENUITEMINFOW miiSep = {};
1123 miiSep.cbSize = sizeof(miiSep); 1123 miiSep.cbSize = sizeof(miiSep);
1124 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE; 1124 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE;
1125 miiSep.fType = MFT_SEPARATOR; 1125 miiSep.fType = MFT_SEPARATOR;
1126 1126
1127 CPluginClient* client = CPluginClient::GetInstance(); 1127 CPluginClient* client = CPluginClient::GetInstance();
1128 CPluginSettings* settings = CPluginSettings::GetInstance(); 1128 CPluginSettings* settings = CPluginSettings::GetInstance();
1129 { 1129 {
1130 ctext = dictionary->Lookup("menu", "menu-disable-on-site"); 1130 ctext = dictionary->Lookup("menu", "menu-disable-on-site");
1131 // Is domain in white list?
1132 ReplaceString(ctext, L"?1?", client->GetHostFromUrl(url)); 1131 ReplaceString(ctext, L"?1?", client->GetHostFromUrl(url));
1133 if (client->IsWhitelistedUrl(GetTab()->GetDocumentUrl())) 1132 /*
1133 * The display state of the "disable on this site" menu item depends upon ta b content
1134 */
1135 if (!GetTab()->IsPossibleToDisableOnSite())
1134 { 1136 {
1137 // Since we can't disable the present content,
1138 // it makes no sense to offer the user an option to block it.
1139 fmii.fState = MFS_UNCHECKED | MFS_DISABLED;
Oleksandr 2015/12/17 12:59:38 If it is not possible to disable on site, it also
Eric 2015/12/17 13:40:39 The meaning of the check mark to me is "there is a
sergei 2015/12/21 10:26:23 I agree, it should be rather checked.
Eric 2015/12/21 13:11:41 Please feel free to bring up these points as comme
1140 }
1141 else if (client->IsWhitelistedUrl(GetTab()->GetDocumentUrl()))
1142 {
1143 // Domain is in white list, indicated by a check mark
1135 fmii.fState = MFS_CHECKED | MFS_ENABLED; 1144 fmii.fState = MFS_CHECKED | MFS_ENABLED;
1136 } 1145 }
1137 else 1146 else
1138 { 1147 {
1139 fmii.fState = MFS_UNCHECKED | MFS_ENABLED; 1148 fmii.fState = MFS_UNCHECKED | MFS_ENABLED;
1140 } 1149 }
1141 fmii.fMask = MIIM_STRING | MIIM_STATE; 1150 fmii.fMask = MIIM_STRING | MIIM_STATE;
1142 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str()); 1151 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str());
1143 fmii.cch = static_cast<UINT>(ctext.size()); 1152 fmii.cch = static_cast<UINT>(ctext.size());
1144 1153
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 s_criticalSectionLocal.Unlock(); 1642 s_criticalSectionLocal.Unlock();
1634 1643
1635 return icon; 1644 return icon;
1636 } 1645 }
1637 1646
1638 ATOM CPluginClass::GetAtomPaneClass() 1647 ATOM CPluginClass::GetAtomPaneClass()
1639 { 1648 {
1640 return s_atomPaneClass; 1649 return s_atomPaneClass;
1641 } 1650 }
1642 1651
OLDNEW
« no previous file with comments | « no previous file | src/plugin/PluginTabBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld