| 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 #include "chrome/browser/extensions/api/settings_private/settings_private_event_
router.h" | 5 #include "chrome/browser/extensions/api/settings_private/settings_private_event_
router.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/prefs/pref_service.h" | |
| 13 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 14 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/common/extensions/api/settings_private.h" | 15 #include "chrome/common/extensions/api/settings_private.h" |
| 16 #include "components/prefs/pref_service.h" |
| 17 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
| 18 | 18 |
| 19 namespace extensions { | 19 namespace extensions { |
| 20 | 20 |
| 21 SettingsPrivateEventRouter::SettingsPrivateEventRouter( | 21 SettingsPrivateEventRouter::SettingsPrivateEventRouter( |
| 22 content::BrowserContext* context) | 22 content::BrowserContext* context) |
| 23 : context_(context), listening_(false) { | 23 : context_(context), listening_(false) { |
| 24 // Register with the event router so we know when renderers are listening to | 24 // Register with the event router so we know when renderers are listening to |
| 25 // our events. We first check and see if there *is* an event router, because | 25 // our events. We first check and see if there *is* an event router, because |
| 26 // some unit tests try to create all context services, but don't initialize | 26 // some unit tests try to create all context services, but don't initialize |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 api::settings_private::OnPrefsChanged::kEventName, std::move(args))); | 145 api::settings_private::OnPrefsChanged::kEventName, std::move(args))); |
| 146 event_router->BroadcastEvent(std::move(extension_event)); | 146 event_router->BroadcastEvent(std::move(extension_event)); |
| 147 } | 147 } |
| 148 | 148 |
| 149 SettingsPrivateEventRouter* SettingsPrivateEventRouter::Create( | 149 SettingsPrivateEventRouter* SettingsPrivateEventRouter::Create( |
| 150 content::BrowserContext* context) { | 150 content::BrowserContext* context) { |
| 151 return new SettingsPrivateEventRouter(context); | 151 return new SettingsPrivateEventRouter(context); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace extensions | 154 } // namespace extensions |
| OLD | NEW |