| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(PreferenceEventRouter); | 39 DISALLOW_COPY_AND_ASSIGN(PreferenceEventRouter); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class PreferenceAPI : public ProfileKeyedAPI, | 42 class PreferenceAPI : public ProfileKeyedAPI, |
| 43 public EventRouter::Observer { | 43 public EventRouter::Observer { |
| 44 public: | 44 public: |
| 45 explicit PreferenceAPI(Profile* profile); | 45 explicit PreferenceAPI(Profile* profile); |
| 46 virtual ~PreferenceAPI(); | 46 virtual ~PreferenceAPI(); |
| 47 | 47 |
| 48 // ProfileKeyedService implementation. | 48 // BrowserContextKeyedService implementation. |
| 49 virtual void Shutdown() OVERRIDE; | 49 virtual void Shutdown() OVERRIDE; |
| 50 | 50 |
| 51 // ProfileKeyedAPI implementation. | 51 // ProfileKeyedAPI implementation. |
| 52 static ProfileKeyedAPIFactory<PreferenceAPI>* GetFactoryInstance(); | 52 static ProfileKeyedAPIFactory<PreferenceAPI>* GetFactoryInstance(); |
| 53 | 53 |
| 54 // EventRouter::Observer implementation. | 54 // EventRouter::Observer implementation. |
| 55 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 55 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 friend class ProfileKeyedAPIFactory<PreferenceAPI>; | 58 friend class ProfileKeyedAPIFactory<PreferenceAPI>; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 protected: | 139 protected: |
| 140 virtual ~ClearPreferenceFunction(); | 140 virtual ~ClearPreferenceFunction(); |
| 141 | 141 |
| 142 // ExtensionFunction: | 142 // ExtensionFunction: |
| 143 virtual bool RunImpl() OVERRIDE; | 143 virtual bool RunImpl() OVERRIDE; |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 } // namespace extensions | 146 } // namespace extensions |
| 147 | 147 |
| 148 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ | 148 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_PREFERENCE_API_H__ |
| OLD | NEW |