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

Side by Side Diff: chrome/browser/pref_set_observer.h

Issue 3067017: Merge 53457 - Disable proxy config button and show banner if proxy prefs are managed. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/pref_service.h ('k') | chrome/browser/pref_set_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PREF_SET_OBSERVER_H_
6 #define CHROME_BROWSER_PREF_SET_OBSERVER_H_
7
8 #include <set>
9
10 #include "base/basictypes.h"
11 #include "chrome/browser/pref_service.h"
12 #include "chrome/common/notification_observer.h"
13
14 // Observes the state of a set of preferences and allows to query their combined
15 // managed bits.
16 class PrefSetObserver : public NotificationObserver {
17 public:
18 // Initialize with an empty set of preferences.
19 PrefSetObserver(PrefService* pref_service,
20 NotificationObserver* observer);
21 virtual ~PrefSetObserver();
22
23 // Add a |pref| to the set of preferences to observe.
24 void AddPref(const std::wstring& pref);
25 // Remove |pref| from the set of observed peferences.
26 void RemovePref(const std::wstring& pref);
27
28 // Check whether |pref| is in the set of observed preferences.
29 bool IsObserved(const std::wstring& pref);
30 // Check whether any of the observed preferences has the managed bit set.
31 bool IsManaged();
32
33 // Create a pref set observer for all preferences relavant to proxies.
34 static PrefSetObserver* CreateProxyPrefSetObserver(
35 PrefService* pref_service,
36 NotificationObserver* observer);
37
38 private:
39 // Overridden from NotificationObserver.
40 virtual void Observe(NotificationType type,
41 const NotificationSource& source,
42 const NotificationDetails& details);
43
44 typedef std::set<std::wstring> PrefSet;
45 PrefSet prefs_;
46
47 PrefService* pref_service_;
48 NotificationObserver* observer_;
49
50 DISALLOW_COPY_AND_ASSIGN(PrefSetObserver);
51 };
52
53 #endif // CHROME_BROWSER_PREF_SET_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/pref_service.h ('k') | chrome/browser/pref_set_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698