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

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

Issue 2141703003: [Extensions] Clean up renderer channel-related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_feature_no_filter
Patch Set: Test fix Created 4 years, 5 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
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
deleted file mode 100644
index 5c65425821c5f726f2631211702ae0982f9b483a..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/chrome_notification_observer.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/chrome_notification_observer.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/common/extension_messages.h"
-#include "extensions/common/features/feature_channel.h"
-
-namespace extensions {
-
-ChromeNotificationObserver::ChromeNotificationObserver() {
- registrar_.Add(this,
- content::NOTIFICATION_RENDERER_PROCESS_CREATED,
- content::NotificationService::AllBrowserContextsAndSources());
-}
-
-ChromeNotificationObserver::~ChromeNotificationObserver() {}
-
-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(static_cast<int>(GetCurrentChannel())));
-}
-
-void ChromeNotificationObserver::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(content::NOTIFICATION_RENDERER_PROCESS_CREATED, type);
-
- OnRendererProcessCreated(
- content::Source<content::RenderProcessHost>(source).ptr());
-}
-
-} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698