| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CHROME_DIRECT_SETTING_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_CHROME_DIRECT_SETTING_API_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_CHROME_DIRECT_SETTING_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_CHROME_DIRECT_SETTING_API_H__ |
| 7 | 7 |
| 8 #include "base/prefs/pref_change_registrar.h" | 8 #include "base/prefs/pref_change_registrar.h" |
| 9 #include "extensions/browser/browser_context_keyed_api_factory.h" | 9 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 10 #include "extensions/browser/event_router.h" | 10 #include "extensions/browser/event_router.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class BrowserContext; | 15 class BrowserContext; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace extensions { | 18 namespace extensions { |
| 19 namespace chromedirectsetting { | 19 namespace chromedirectsetting { |
| 20 | 20 |
| 21 class ChromeDirectSettingAPI : public BrowserContextKeyedAPI, | 21 class ChromeDirectSettingAPI : public BrowserContextKeyedAPI, |
| 22 public EventRouter::Observer { | 22 public EventRouter::Observer { |
| 23 public: | 23 public: |
| 24 explicit ChromeDirectSettingAPI(content::BrowserContext* context); | 24 explicit ChromeDirectSettingAPI(content::BrowserContext* context); |
| 25 | 25 |
| 26 virtual ~ChromeDirectSettingAPI(); | 26 virtual ~ChromeDirectSettingAPI(); |
| 27 | 27 |
| 28 // BrowserContextKeyedService implementation. | 28 // KeyedService implementation. |
| 29 virtual void Shutdown() OVERRIDE; | 29 virtual void Shutdown() OVERRIDE; |
| 30 | 30 |
| 31 // BrowserContextKeyedAPI implementation. | 31 // BrowserContextKeyedAPI implementation. |
| 32 static BrowserContextKeyedAPIFactory<ChromeDirectSettingAPI>* | 32 static BrowserContextKeyedAPIFactory<ChromeDirectSettingAPI>* |
| 33 GetFactoryInstance(); | 33 GetFactoryInstance(); |
| 34 | 34 |
| 35 // EventRouter::Observer implementation. | 35 // EventRouter::Observer implementation. |
| 36 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 36 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
| 37 | 37 |
| 38 // Returns true if the preference is on the whitelist. | 38 // Returns true if the preference is on the whitelist. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 55 PrefChangeRegistrar registrar_; | 55 PrefChangeRegistrar registrar_; |
| 56 Profile* profile_; | 56 Profile* profile_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(ChromeDirectSettingAPI); | 58 DISALLOW_COPY_AND_ASSIGN(ChromeDirectSettingAPI); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace chromedirectsetting | 61 } // namespace chromedirectsetting |
| 62 } // namespace extensions | 62 } // namespace extensions |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_CHROME_DIRECT_SETTING_API_H_
_ | 64 #endif // CHROME_BROWSER_EXTENSIONS_API_PREFERENCE_CHROME_DIRECT_SETTING_API_H_
_ |
| OLD | NEW |