Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1079)

Unified Diff: chrome/browser/views/options/advanced_contents_view.cc

Issue 3038013: Disable proxy config button and show banner if proxy prefs are managed. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: fix nits Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/pref_set_observer_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/options/advanced_contents_view.cc
diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc
index bbe232fce68505bf5fde5482ed7d0e344019928d..dc95e922be6690e63399480c02a113abe456cf48 100644
--- a/chrome/browser/views/options/advanced_contents_view.cc
+++ b/chrome/browser/views/options/advanced_contents_view.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/options_util.h"
#include "chrome/browser/pref_member.h"
#include "chrome/browser/pref_service.h"
+#include "chrome/browser/pref_set_observer.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
@@ -953,6 +954,9 @@ class NetworkSection : public AdvancedSection,
views::Label* change_proxies_label_;
views::NativeButton* change_proxies_button_;
+ // Tracks the proxy preferences.
+ scoped_ptr<PrefSetObserver> proxy_prefs_;
+
DISALLOW_COPY_AND_ASSIGN(NetworkSection);
};
@@ -998,9 +1002,16 @@ void NetworkSection::InitControlLayout() {
true);
AddLeadingControl(layout, change_proxies_button_, indented_view_set_id,
false);
+
+ proxy_prefs_.reset(PrefSetObserver::CreateProxyPrefSetObserver(
+ profile()->GetPrefs(), this));
+ NotifyPrefChanged(NULL);
}
void NetworkSection::NotifyPrefChanged(const std::wstring* pref_name) {
+ if (!pref_name || proxy_prefs_->IsObserved(*pref_name)) {
+ change_proxies_button_->SetEnabled(!proxy_prefs_->IsManaged());
+ }
}
} // namespace
« no previous file with comments | « chrome/browser/pref_set_observer_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698