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

Unified 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: Rebased 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/shell/browser/shell_extensions_browser_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/browser/shell_extensions_browser_client.cc
diff --git a/extensions/shell/browser/shell_extensions_browser_client.cc b/extensions/shell/browser/shell_extensions_browser_client.cc
index 659f88f9b2eb6a7c46516877aa700dc3b29815c1..85703c81f8b7392943a0951d3c72cdeb840fd4ed 100644
--- a/extensions/shell/browser/shell_extensions_browser_client.cc
+++ b/extensions/shell/browser/shell_extensions_browser_client.cc
@@ -9,9 +9,11 @@
#include "base/prefs/testing_pref_store.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/user_prefs/user_prefs.h"
+#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/api/generated_api_registration.h"
#include "extensions/browser/app_sorting.h"
+#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_function_registry.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/shell/browser/api/generated_api_registration.h"
@@ -21,6 +23,7 @@
#include "extensions/shell/browser/shell_runtime_api_delegate.h"
using content::BrowserContext;
+using content::BrowserThread;
namespace extensions {
namespace {
@@ -196,6 +199,24 @@ ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() {
return NULL;
}
+void ShellExtensionsBrowserClient::BroadcastEventToRenderers(
+ const std::string& event_name,
+ scoped_ptr<base::ListValue> args) {
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&ShellExtensionsBrowserClient::BroadcastEventToRenderers,
+ base::Unretained(this),
+ event_name,
+ base::Passed(&args)));
+ return;
+ }
+
+ scoped_ptr<Event> event(new Event(event_name, args.Pass()));
+ EventRouter::Get(browser_context_)->BroadcastEvent(event.Pass());
+}
+
net::NetLog* ShellExtensionsBrowserClient::GetNetLog() {
return NULL;
}
« no previous file with comments | « extensions/shell/browser/shell_extensions_browser_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698