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

Unified Diff: src/plugin/PluginSettings.cpp

Issue 11369200: Disable everywhere fix (Closed)
Patch Set: Created Aug. 13, 2013, 2:18 p.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
« no previous file with comments | « src/plugin/PluginSettings.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginSettings.cpp
===================================================================
--- a/src/plugin/PluginSettings.cpp
+++ b/src/plugin/PluginSettings.cpp
@@ -66,7 +66,7 @@
CComAutoCriticalSection CPluginSettings::s_criticalSectionLocal;
-CPluginSettings::CPluginSettings() : m_dwWorkingThreadId(0), m_isPluginEnabledTab(true)
+CPluginSettings::CPluginSettings() : m_dwWorkingThreadId(0)
{
s_instance = NULL;
@@ -149,7 +149,7 @@
bool CPluginSettings::IsPluginEnabled() const
{
- return m_isPluginEnabledTab;
+ return GetPluginEnabled();
}
@@ -187,30 +187,11 @@
void CPluginSettings::TogglePluginEnabled()
{
- CPluginSettingsTabLock lock;
- if (lock.IsLocked())
- {
- s_criticalSectionLocal.Lock();
- {
- //TODO: Query if plugin is enabled from the AdblockPlusEngine
- m_isPluginEnabledTab = m_isPluginEnabledTab ? false : true;
- //TODO: Set plugin enabled/disabled in AdblockPlusEngine
- }
- s_criticalSectionLocal.Unlock();
- }
+ GetPluginEnabled() ? SetPluginDisabled() : SetPluginEnabled();
Wladimir Palant 2013/08/13 14:25:29 The SetPluginEnabled/SetPluginDisabled functions a
}
void CPluginSettings::SetPluginDisabled()
{
- CPluginSettingsTabLock lock;
- if (lock.IsLocked())
- {
- s_criticalSectionLocal.Lock();
- {
- m_isPluginEnabledTab = false;
- //TODO: Set plugin disabled in AdblockPlusEngine
- }
- s_criticalSectionLocal.Unlock();
- }
+ CPluginClient::GetInstance()->SetPref(L"enabled", false);
}
void CPluginSettings::SetPluginEnabled()
{
« no previous file with comments | « src/plugin/PluginSettings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld