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

Side by Side Diff: chrome/browser/extensions/api/managed_mode/managed_mode_api.h

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Defines the Chrome Extensions Managed Mode API relevant classes to realize 5 // Defines the Chrome Extensions Managed Mode API relevant classes to realize
6 // the API as specified in the extension API JSON. 6 // the API as specified in the extension API JSON.
7 7
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_
9 #define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ 9 #define CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_
10 10
11 #include "base/prefs/public/pref_change_registrar.h" 11 #include "base/prefs/public/pref_change_registrar.h"
12 #include "base/prefs/public/pref_observer.h"
12 #include "chrome/browser/extensions/extension_function.h" 13 #include "chrome/browser/extensions/extension_function.h"
13 #include "content/public/browser/notification_observer.h" 14 #include "content/public/browser/notification_observer.h"
14 15
15 class Profile; 16 class Profile;
16 17
17 namespace extensions { 18 namespace extensions {
18 19
19 class ExtensionManagedModeEventRouter : public content::NotificationObserver { 20 class ExtensionManagedModeEventRouter : public PrefObserver {
20 public: 21 public:
21 explicit ExtensionManagedModeEventRouter(Profile* profile); 22 explicit ExtensionManagedModeEventRouter(Profile* profile);
22 virtual ~ExtensionManagedModeEventRouter(); 23 virtual ~ExtensionManagedModeEventRouter();
23 24
24 void Init(); 25 void Init();
25 26
26 // content::NotificationObserver implementation: 27 // PrefObserver implementation:
27 virtual void Observe(int type, 28 virtual void OnPreferenceChanged(PrefServiceBase* service,
28 const content::NotificationSource& source, 29 const std::string& pref_name) OVERRIDE;
29 const content::NotificationDetails& details) OVERRIDE;
30 30
31 private: 31 private:
32 PrefChangeRegistrar registrar_; 32 PrefChangeRegistrar registrar_;
33 Profile* profile_; 33 Profile* profile_;
34 34
35 DISALLOW_COPY_AND_ASSIGN(ExtensionManagedModeEventRouter); 35 DISALLOW_COPY_AND_ASSIGN(ExtensionManagedModeEventRouter);
36 }; 36 };
37 37
38 class GetManagedModeFunction : public SyncExtensionFunction { 38 class GetManagedModeFunction : public SyncExtensionFunction {
39 public: 39 public:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 protected: 80 protected:
81 virtual ~SetPolicyFunction(); 81 virtual ~SetPolicyFunction();
82 82
83 // ExtensionFunction: 83 // ExtensionFunction:
84 virtual bool RunImpl() OVERRIDE; 84 virtual bool RunImpl() OVERRIDE;
85 }; 85 };
86 86
87 } // namespace extensions 87 } // namespace extensions
88 88
89 #endif // CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_ 89 #endif // CHROME_BROWSER_EXTENSIONS_API_MANAGED_MODE_MANAGED_MODE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698