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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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/extension_browser_event_router.cc
===================================================================
--- chrome/browser/extensions/extension_browser_event_router.cc (revision 91968)
+++ chrome/browser/extensions/extension_browser_event_router.cc (working copy)
@@ -14,6 +14,7 @@
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/browser/tab_contents/navigation_entry.h"
@@ -72,7 +73,7 @@
#elif defined(OS_MACOSX)
// Needed for when no suitable window can be passed to an extension as the
// currently focused window.
- registrar_.Add(this, NotificationType::NO_KEY_WINDOW,
+ registrar_.Add(this, content::NOTIFICATION_NO_KEY_WINDOW,
NotificationService::AllSources());
#endif
@@ -127,7 +128,7 @@
// If this is a new window, it isn't ready at this point, so we register to be
// notified when it is. If this is an existing window, this is a no-op that we
// just do to reduce code complexity.
- registrar_.Add(this, NotificationType::BROWSER_WINDOW_READY,
+ registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY,
Source<const Browser>(browser));
for (int i = 0; i < browser->tabstrip_model()->count(); ++i)
@@ -136,22 +137,22 @@
void ExtensionBrowserEventRouter::RegisterForTabNotifications(
TabContents* contents) {
- registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
+ registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
Source<NavigationController>(&contents->controller()));
// Observing TAB_CONTENTS_DESTROYED is necessary because it's
// possible for tabs to be created, detached and then destroyed without
// ever having been re-attached and closed. This happens in the case of
// a devtools TabContents that is opened in window, docked, then closed.
- registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED,
+ registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(contents));
}
void ExtensionBrowserEventRouter::UnregisterForTabNotifications(
TabContents* contents) {
- registrar_.Remove(this, NotificationType::NAV_ENTRY_COMMITTED,
+ registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
Source<NavigationController>(&contents->controller()));
- registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED,
+ registrar_.Remove(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(contents));
}
@@ -175,7 +176,7 @@
// Stop listening to TabStripModel events for this browser.
browser->tabstrip_model()->RemoveObserver(this);
- registrar_.Remove(this, NotificationType::BROWSER_WINDOW_READY,
+ registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY,
Source<const Browser>(browser));
DispatchSimpleBrowserEvent(browser->profile(),
@@ -487,25 +488,25 @@
return &i->second;
}
-void ExtensionBrowserEventRouter::Observe(NotificationType type,
+void ExtensionBrowserEventRouter::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- if (type == NotificationType::NAV_ENTRY_COMMITTED) {
+ if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) {
NavigationController* source_controller =
Source<NavigationController>(source).ptr();
TabUpdated(source_controller->tab_contents(), true);
- } else if (type == NotificationType::TAB_CONTENTS_DESTROYED) {
+ } else if (type == content::NOTIFICATION_TAB_CONTENTS_DESTROYED) {
// Tab was destroyed after being detached (without being re-attached).
TabContents* contents = Source<TabContents>(source).ptr();
- registrar_.Remove(this, NotificationType::NAV_ENTRY_COMMITTED,
+ registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
Source<NavigationController>(&contents->controller()));
- registrar_.Remove(this, NotificationType::TAB_CONTENTS_DESTROYED,
+ registrar_.Remove(this, content::NOTIFICATION_TAB_CONTENTS_DESTROYED,
Source<TabContents>(contents));
- } else if (type == NotificationType::BROWSER_WINDOW_READY) {
+ } else if (type == chrome::NOTIFICATION_BROWSER_WINDOW_READY) {
const Browser* browser = Source<const Browser>(source).ptr();
OnBrowserWindowReady(browser);
#if defined(OS_MACOSX)
- } else if (type == NotificationType::NO_KEY_WINDOW) {
+ } else if (type == content::NOTIFICATION_NO_KEY_WINDOW) {
OnBrowserSetLastActive(NULL);
#endif
} else {
« no previous file with comments | « chrome/browser/extensions/extension_browser_event_router.h ('k') | chrome/browser/extensions/extension_browsertest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698