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 <vector> | 8 #include <vector> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
11 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/extensions/api/settings_private.h" | 16 #include "chrome/common/extensions/api/settings_private.h" |
16 #include "content/public/browser/browser_context.h" | 17 #include "content/public/browser/browser_context.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 prefs_util_->GetPref(pref_name).release(); | 135 prefs_util_->GetPref(pref_name).release(); |
135 | 136 |
136 std::vector<linked_ptr<api::settings_private::PrefObject>> prefs; | 137 std::vector<linked_ptr<api::settings_private::PrefObject>> prefs; |
137 prefs.push_back(linked_ptr<api::settings_private::PrefObject>(pref_object)); | 138 prefs.push_back(linked_ptr<api::settings_private::PrefObject>(pref_object)); |
138 | 139 |
139 scoped_ptr<base::ListValue> args( | 140 scoped_ptr<base::ListValue> args( |
140 api::settings_private::OnPrefsChanged::Create(prefs)); | 141 api::settings_private::OnPrefsChanged::Create(prefs)); |
141 | 142 |
142 scoped_ptr<Event> extension_event(new Event( | 143 scoped_ptr<Event> extension_event(new Event( |
143 events::SETTINGS_PRIVATE_ON_PREFS_CHANGED, | 144 events::SETTINGS_PRIVATE_ON_PREFS_CHANGED, |
144 api::settings_private::OnPrefsChanged::kEventName, args.Pass())); | 145 api::settings_private::OnPrefsChanged::kEventName, std::move(args))); |
145 event_router->BroadcastEvent(extension_event.Pass()); | 146 event_router->BroadcastEvent(std::move(extension_event)); |
146 } | 147 } |
147 | 148 |
148 SettingsPrivateEventRouter* SettingsPrivateEventRouter::Create( | 149 SettingsPrivateEventRouter* SettingsPrivateEventRouter::Create( |
149 content::BrowserContext* context) { | 150 content::BrowserContext* context) { |
150 return new SettingsPrivateEventRouter(context); | 151 return new SettingsPrivateEventRouter(context); |
151 } | 152 } |
152 | 153 |
153 } // namespace extensions | 154 } // namespace extensions |
OLD | NEW |