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

Unified Diff: chrome/browser/extensions/chrome_notification_observer.cc

Issue 234183002: Toro: Remove chrome feature channel dep from //extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (feature-channel) Created 6 years, 8 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 | « chrome/browser/extensions/chrome_notification_observer.h ('k') | extensions/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/chrome_notification_observer.cc
diff --git a/chrome/browser/extensions/chrome_notification_observer.cc b/chrome/browser/extensions/chrome_notification_observer.cc
index 02897154beb58ed4fc613a67ad168dbaef2d7b0f..5d966c8f5e973b915a5b7706cb097449a372a7e5 100644
--- a/chrome/browser/extensions/chrome_notification_observer.cc
+++ b/chrome/browser/extensions/chrome_notification_observer.cc
@@ -8,16 +8,23 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/common/extensions/features/feature_channel.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_types.h"
+#include "content/public/browser/render_process_host.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/process_manager.h"
+#include "extensions/common/extension_messages.h"
namespace extensions {
ChromeNotificationObserver::ChromeNotificationObserver() {
- // Notifications for extensions::ProcessManager
- registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY,
+ registrar_.Add(this,
+ chrome::NOTIFICATION_BROWSER_WINDOW_READY,
content::NotificationService::AllSources());
+ registrar_.Add(this,
+ content::NOTIFICATION_RENDERER_PROCESS_CREATED,
+ content::NotificationService::AllBrowserContextsAndSources());
}
ChromeNotificationObserver::~ChromeNotificationObserver() {}
@@ -50,6 +57,13 @@ void ChromeNotificationObserver::OnBrowserWindowReady(Browser* browser) {
}
}
+void ChromeNotificationObserver::OnRendererProcessCreated(
+ content::RenderProcessHost* process) {
+ // Extensions need to know the channel for API restrictions. Send the channel
+ // to all renderers, as the non-extension renderers may have content scripts.
+ process->Send(new ExtensionMsg_SetChannel(GetCurrentChannel()));
+}
+
void ChromeNotificationObserver::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
@@ -60,6 +74,13 @@ void ChromeNotificationObserver::Observe(int type,
break;
}
+ case content::NOTIFICATION_RENDERER_PROCESS_CREATED: {
+ content::RenderProcessHost* process =
+ content::Source<content::RenderProcessHost>(source).ptr();
+ OnRendererProcessCreated(process);
+ break;
+ }
+
default:
NOTREACHED();
}
« no previous file with comments | « chrome/browser/extensions/chrome_notification_observer.h ('k') | extensions/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698