| 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 "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/chromeos/settings/cros_settings.h" | |
| 13 #include "chrome/browser/extensions/api/settings_private/prefs_util.h" | 12 #include "chrome/browser/extensions/api/settings_private/prefs_util.h" |
| 14 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
| 15 #include "components/prefs/pref_change_registrar.h" | 14 #include "components/prefs/pref_change_registrar.h" |
| 16 #include "extensions/browser/event_router.h" | 15 #include "extensions/browser/event_router.h" |
| 17 | 16 |
| 17 // TODO(wychen): ChromeOS headers should only be included when building |
| 18 // ChromeOS, and the following headers should be guarded by |
| 19 // #if defined(OS_CHROMEOS). However, the types are actually |
| 20 // used, and it takes another CL to clean them up. |
| 21 // Reference: crbug.com/720159 |
| 22 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 23 |
| 18 namespace content { | 24 namespace content { |
| 19 class BrowserContext; | 25 class BrowserContext; |
| 20 } | 26 } |
| 21 | 27 |
| 22 namespace extensions { | 28 namespace extensions { |
| 23 | 29 |
| 24 // This is an event router that will observe listeners to pref changes on the | 30 // This is an event router that will observe listeners to pref changes on the |
| 25 // appropriate pref service(s) and notify listeners on the JavaScript | 31 // appropriate pref service(s) and notify listeners on the JavaScript |
| 26 // settingsPrivate API. | 32 // settingsPrivate API. |
| 27 class SettingsPrivateEventRouter : public KeyedService, | 33 class SettingsPrivateEventRouter : public KeyedService, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 std::unique_ptr<PrefsUtil> prefs_util_; | 78 std::unique_ptr<PrefsUtil> prefs_util_; |
| 73 | 79 |
| 74 base::WeakPtrFactory<SettingsPrivateEventRouter> weak_ptr_factory_; | 80 base::WeakPtrFactory<SettingsPrivateEventRouter> weak_ptr_factory_; |
| 75 | 81 |
| 76 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateEventRouter); | 82 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateEventRouter); |
| 77 }; | 83 }; |
| 78 | 84 |
| 79 } // namespace extensions | 85 } // namespace extensions |
| 80 | 86 |
| 81 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT
_ROUTER_H_ | 87 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_EVENT
_ROUTER_H_ |
| OLD | NEW |