From 43211582b1fa8c69136385250e7b0446cf364b5c Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Sun, 10 Jul 2011 15:52:27 +0000 Subject: Moving notification types which are chrome specific to a new header file chrome_notification_types.h. This file lives in chrome\common. The chrome specific notifications start from NOTIFICATION_CONTENT_END which defines the end of the enum used by content to define notification types. The notificaton_type.h file in content\common has been renamed to content_notification_types.h BUG=76698 Review URL: http://codereview.chromium.org/7327007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91972 0039d316-1c4b-4281-b951-d872f2087c98 --- .../ui/gtk/extensions/extension_installed_bubble_gtk.cc | 12 ++++++------ .../ui/gtk/extensions/extension_installed_bubble_gtk.h | 2 +- chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc | 17 +++++++++-------- chrome/browser/ui/gtk/extensions/extension_popup_gtk.h | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) (limited to 'chrome/browser/ui/gtk/extensions') diff --git a/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc index 767e4a8..7f6800e 100644 --- a/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc @@ -19,9 +19,9 @@ #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_action.h" +#include "content/common/content_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" -#include "content/common/notification_type.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -89,25 +89,25 @@ ExtensionInstalledBubbleGtk::ExtensionInstalledBubbleGtk( // fired, but all of the EXTENSION_LOADED Observers have run. Only then can we // be sure that a browser action or page action has had views created which we // can inspect for the purpose of pointing to them. - registrar_.Add(this, NotificationType::EXTENSION_LOADED, + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, Source(browser->profile())); - registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, Source(browser->profile())); } ExtensionInstalledBubbleGtk::~ExtensionInstalledBubbleGtk() {} -void ExtensionInstalledBubbleGtk::Observe(NotificationType type, +void ExtensionInstalledBubbleGtk::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NotificationType::EXTENSION_LOADED) { + if (type == chrome::NOTIFICATION_EXTENSION_LOADED) { const Extension* extension = Details(details).ptr(); if (extension == extension_) { // PostTask to ourself to allow all EXTENSION_LOADED Observers to run. MessageLoopForUI::current()->PostTask(FROM_HERE, NewRunnableMethod(this, &ExtensionInstalledBubbleGtk::ShowInternal)); } - } else if (type == NotificationType::EXTENSION_UNLOADED) { + } else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { const Extension* extension = Details(details)->extension; if (extension == extension_) diff --git a/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h b/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h index fa943be..1a06242 100644 --- a/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h +++ b/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h @@ -64,7 +64,7 @@ class ExtensionInstalledBubbleGtk void ShowInternal(); // NotificationObserver: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) OVERRIDE; diff --git a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc index 276df4a..556f3eb 100644 --- a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc +++ b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc @@ -18,6 +18,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/gtk/gtk_theme_service.h" #include "content/browser/debugger/devtools_window.h" +#include "chrome/common/chrome_notification_types.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" @@ -50,30 +51,30 @@ ExtensionPopupGtk::ExtensionPopupGtk(Browser* browser, if (host->did_stop_loading()) { ShowPopup(); } else { - registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING, + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING, Source(host->profile())); } - registrar_.Add(this, NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE, + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, Source(host->profile())); } ExtensionPopupGtk::~ExtensionPopupGtk() { } -void ExtensionPopupGtk::Observe(NotificationType type, +void ExtensionPopupGtk::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - switch (type.value) { - case NotificationType::EXTENSION_HOST_DID_STOP_LOADING: + switch (type) { + case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: if (Details(host_.get()) == details) ShowPopup(); break; - case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE: + case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: if (Details(host_.get()) == details) DestroyPopup(); break; - case NotificationType::DEVTOOLS_WINDOW_CLOSING: + case content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING: // Make sure its the devtools window that inspecting our popup. if (Details(host_->render_view_host()) != details) break; @@ -98,7 +99,7 @@ void ExtensionPopupGtk::ShowPopup() { if (being_inspected_) { DevToolsWindow::OpenDevToolsWindow(host_->render_view_host()); // Listen for the the devtools window closing. - registrar_.Add(this, NotificationType::DEVTOOLS_WINDOW_CLOSING, + registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING, Source(host_->profile())); } diff --git a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.h b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.h index 926bb2e..1b41510 100644 --- a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.h +++ b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.h @@ -35,7 +35,7 @@ class ExtensionPopupGtk : public NotificationObserver, bool inspect); // NotificationObserver implementation. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) OVERRIDE; -- cgit v1.1