OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT_RO
UTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT_RO
UTER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT_RO
UTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT_RO
UTER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "chrome/browser/chromeos/settings/cros_settings.h" | 11 #include "chrome/browser/chromeos/settings/cros_settings.h" |
12 #include "chrome/browser/extensions/api/settings_private/prefs_util.h" | 12 #include "chrome/browser/extensions/api/settings_private/prefs_util.h" |
13 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
14 #include "components/prefs/pref_change_registrar.h" | 14 #include "components/prefs/pref_change_registrar.h" |
15 #include "extensions/browser/event_router.h" | 15 #include "extensions/browser/event_router.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class BrowserContext; | 18 class BrowserContext; |
19 } | 19 } |
20 | 20 |
21 namespace extensions { | 21 namespace extensions { |
22 | 22 |
23 class SettingsPrivateDelegate; | |
24 | |
25 // This is an event router that will observe listeners to pref changes on the | 23 // This is an event router that will observe listeners to pref changes on the |
26 // appropriate pref service(s) and notify listeners on the JavaScript | 24 // appropriate pref service(s) and notify listeners on the JavaScript |
27 // settingsPrivate API. | 25 // settingsPrivate API. |
28 class SettingsPrivateEventRouter : public KeyedService, | 26 class SettingsPrivateEventRouter : public KeyedService, |
29 public EventRouter::Observer { | 27 public EventRouter::Observer { |
30 public: | 28 public: |
31 static SettingsPrivateEventRouter* Create( | 29 static SettingsPrivateEventRouter* Create( |
32 content::BrowserContext* browser_context); | 30 content::BrowserContext* browser_context); |
33 ~SettingsPrivateEventRouter() override; | 31 ~SettingsPrivateEventRouter() override; |
34 | 32 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool listening_; | 66 bool listening_; |
69 | 67 |
70 std::unique_ptr<PrefsUtil> prefs_util_; | 68 std::unique_ptr<PrefsUtil> prefs_util_; |
71 | 69 |
72 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateEventRouter); | 70 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateEventRouter); |
73 }; | 71 }; |
74 | 72 |
75 } // namespace extensions | 73 } // namespace extensions |
76 | 74 |
77 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT
_ROUTER_H_ | 75 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT
_ROUTER_H_ |
OLD | NEW |