Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: extensions/shell/browser/shell_extensions_browser_client.cc

Issue 389633002: Move system.* family of APIs to extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inlined simple getters and removed redundant namespace decl Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/shell/browser/shell_extensions_browser_client.h" 5 #include "extensions/shell/browser/shell_extensions_browser_client.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/prefs/pref_service_factory.h" 8 #include "base/prefs/pref_service_factory.h"
9 #include "base/prefs/testing_pref_store.h" 9 #include "base/prefs/testing_pref_store.h"
10 #include "components/pref_registry/pref_registry_syncable.h" 10 #include "components/pref_registry/pref_registry_syncable.h"
11 #include "components/user_prefs/user_prefs.h" 11 #include "components/user_prefs/user_prefs.h"
12 #include "content/public/browser/browser_thread.h"
12 #include "extensions/browser/api/generated_api_registration.h" 13 #include "extensions/browser/api/generated_api_registration.h"
13 #include "extensions/browser/app_sorting.h" 14 #include "extensions/browser/app_sorting.h"
15 #include "extensions/browser/event_router.h"
14 #include "extensions/browser/extension_function_registry.h" 16 #include "extensions/browser/extension_function_registry.h"
15 #include "extensions/browser/extension_prefs.h" 17 #include "extensions/browser/extension_prefs.h"
16 #include "extensions/shell/browser/api/generated_api_registration.h" 18 #include "extensions/shell/browser/api/generated_api_registration.h"
17 #include "extensions/shell/browser/api/shell_extensions_api_client.h" 19 #include "extensions/shell/browser/api/shell_extensions_api_client.h"
18 #include "extensions/shell/browser/shell_app_sorting.h" 20 #include "extensions/shell/browser/shell_app_sorting.h"
19 #include "extensions/shell/browser/shell_extension_host_delegate.h" 21 #include "extensions/shell/browser/shell_extension_host_delegate.h"
20 #include "extensions/shell/browser/shell_extension_system_factory.h" 22 #include "extensions/shell/browser/shell_extension_system_factory.h"
21 #include "extensions/shell/browser/shell_runtime_api_delegate.h" 23 #include "extensions/shell/browser/shell_runtime_api_delegate.h"
22 24
23 using content::BrowserContext; 25 using content::BrowserContext;
26 using content::BrowserThread;
24 27
25 namespace extensions { 28 namespace extensions {
26 namespace { 29 namespace {
27 30
28 // See chrome::RegisterProfilePrefs() in chrome/browser/prefs/browser_prefs.cc 31 // See chrome::RegisterProfilePrefs() in chrome/browser/prefs/browser_prefs.cc
29 void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) { 32 void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry) {
30 ExtensionPrefs::RegisterProfilePrefs(registry); 33 ExtensionPrefs::RegisterProfilePrefs(registry);
31 } 34 }
32 35
33 } // namespace 36 } // namespace
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate( 192 ShellExtensionsBrowserClient::CreateRuntimeAPIDelegate(
190 content::BrowserContext* context) const { 193 content::BrowserContext* context) const {
191 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate()); 194 return scoped_ptr<RuntimeAPIDelegate>(new ShellRuntimeAPIDelegate());
192 } 195 }
193 196
194 ComponentExtensionResourceManager* 197 ComponentExtensionResourceManager*
195 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { 198 ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() {
196 return NULL; 199 return NULL;
197 } 200 }
198 201
202 void ShellExtensionsBrowserClient::BroadcastEventToRenderers(
203 const std::string& event_name,
204 scoped_ptr<base::ListValue> args) {
205 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
206 BrowserThread::PostTask(
207 BrowserThread::UI,
208 FROM_HERE,
209 base::Bind(&ShellExtensionsBrowserClient::BroadcastEventToRenderers,
210 base::Unretained(this),
211 event_name,
212 base::Passed(&args)));
213 return;
214 }
215
216 scoped_ptr<Event> event(new Event(event_name, args.Pass()));
217 EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
218 }
219
199 net::NetLog* ShellExtensionsBrowserClient::GetNetLog() { 220 net::NetLog* ShellExtensionsBrowserClient::GetNetLog() {
200 return NULL; 221 return NULL;
201 } 222 }
202 223
203 } // namespace extensions 224 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698