diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-10 15:52:27 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-10 15:52:27 +0000 |
commit | 43211582b1fa8c69136385250e7b0446cf364b5c (patch) | |
tree | 655ab01543012b6fd5699dee8fab92876959b7d9 /chrome/browser/chromeos/notifications | |
parent | d43970a7ceee5fc5433787b0f28b64234a4039f2 (diff) | |
download | chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.zip chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.gz chromium_src-43211582b1fa8c69136385250e7b0446cf364b5c.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/chromeos/notifications')
7 files changed, 22 insertions, 19 deletions
diff --git a/chrome/browser/chromeos/notifications/balloon_collection_impl.cc b/chrome/browser/chromeos/notifications/balloon_collection_impl.cc index c8415c1..dba581c 100644 --- a/chrome/browser/chromeos/notifications/balloon_collection_impl.cc +++ b/chrome/browser/chromeos/notifications/balloon_collection_impl.cc @@ -13,6 +13,7 @@ #include "chrome/browser/notifications/notification.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/window_sizer.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_service.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -29,7 +30,7 @@ namespace chromeos { BalloonCollectionImpl::BalloonCollectionImpl() : notification_ui_(new NotificationPanel()) { - registrar_.Add(this, NotificationType::BROWSER_CLOSED, + registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, NotificationService::AllSources()); } @@ -146,10 +147,10 @@ const BalloonCollectionImpl::Balloons& return base_.balloons(); } -void BalloonCollectionImpl::Observe(NotificationType type, +void BalloonCollectionImpl::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::BROWSER_CLOSED); + DCHECK(type == chrome::NOTIFICATION_BROWSER_CLOSED); bool app_closing = *Details<bool>(details).ptr(); // When exiting, we need to shutdown all renderers in // BalloonViewImpl before IO thread gets deleted in the diff --git a/chrome/browser/chromeos/notifications/balloon_collection_impl.h b/chrome/browser/chromeos/notifications/balloon_collection_impl.h index 1f0fbbe..e4a6d81 100644 --- a/chrome/browser/chromeos/notifications/balloon_collection_impl.h +++ b/chrome/browser/chromeos/notifications/balloon_collection_impl.h @@ -72,7 +72,7 @@ class BalloonCollectionImpl : public BalloonCollection, virtual const Balloons& GetActiveBalloons(); // NotificationObserver overrides: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc index 82ecd30..078b55d 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.cc +++ b/chrome/browser/chromeos/notifications/balloon_view.cc @@ -18,9 +18,9 @@ #include "chrome/browser/ui/views/notifications/balloon_view_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_widget_host_view.h" +#include "chrome/common/chrome_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" @@ -227,7 +227,7 @@ void BalloonViewImpl::Show(Balloon* balloon) { html_contents_->EnableWebUI(); AddChildView(html_contents_->view()); notification_registrar_.Add(this, - NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); + chrome::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon)); } void BalloonViewImpl::Update() { @@ -298,10 +298,10 @@ gfx::Size BalloonViewImpl::GetPreferredSize() { //////////////////////////////////////////////////////////////////////////////// // NotificationObserver overrides. -void BalloonViewImpl::Observe(NotificationType type, +void BalloonViewImpl::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - if (type != NotificationType::NOTIFY_BALLOON_DISCONNECTED) { + if (type != chrome::NOTIFY_BALLOON_DISCONNECTED) { NOTREACHED(); return; } @@ -309,7 +309,7 @@ void BalloonViewImpl::Observe(NotificationType type, // If the renderer process attached to this balloon is disconnected // (e.g., because of a crash), we want to close the balloon. notification_registrar_.Remove(this, - NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); + chrome::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); Close(false); } diff --git a/chrome/browser/chromeos/notifications/balloon_view.h b/chrome/browser/chromeos/notifications/balloon_view.h index 5aa01a8..2f38f22 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.h +++ b/chrome/browser/chromeos/notifications/balloon_view.h @@ -84,7 +84,7 @@ class BalloonViewImpl : public BalloonView, virtual gfx::Size GetPreferredSize(); // NotificationObserver interface. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); diff --git a/chrome/browser/chromeos/notifications/notification_browsertest.cc b/chrome/browser/chromeos/notifications/notification_browsertest.cc index 6eb7ba3..6044df8 100644 --- a/chrome/browser/chromeos/notifications/notification_browsertest.cc +++ b/chrome/browser/chromeos/notifications/notification_browsertest.cc @@ -17,6 +17,7 @@ #include "chrome/browser/notifications/notification_test_util.h" #include "chrome/browser/notifications/notification_ui_manager.h" #include "chrome/browser/ui/browser.h" +#include "chrome/common/chrome_notification_types.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/common/notification_service.h" @@ -110,10 +111,10 @@ class NotificationTest : public InProcessBrowserTest, } // NotificationObserver overrides. - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - ASSERT_TRUE(NotificationType::PANEL_STATE_CHANGED == type); + ASSERT_TRUE(chrome::NOTIFICATION_PANEL_STATE_CHANGED == type); PanelController::State* state = reinterpret_cast<PanelController::State*>(details.map_key()); state_ = *state; @@ -301,7 +302,7 @@ IN_PROC_BROWSER_TEST_F(NotificationTest, TestStateTransition2) { // Register observer here as the registration does not work in SetUp(). NotificationRegistrar registrar; registrar.Add(this, - NotificationType::PANEL_STATE_CHANGED, + chrome::NOTIFICATION_PANEL_STATE_CHANGED, NotificationService::AllSources()); BalloonCollectionImpl* collection = GetBalloonCollectionImpl(); @@ -368,7 +369,7 @@ IN_PROC_BROWSER_TEST_F(NotificationTest, TestStateTransition2) { IN_PROC_BROWSER_TEST_F(NotificationTest, TestCleanupOnExit) { NotificationRegistrar registrar; registrar.Add(this, - NotificationType::PANEL_STATE_CHANGED, + chrome::NOTIFICATION_PANEL_STATE_CHANGED, NotificationService::AllSources()); BalloonCollectionImpl* collection = GetBalloonCollectionImpl(); diff --git a/chrome/browser/chromeos/notifications/notification_panel.cc b/chrome/browser/chromeos/notifications/notification_panel.cc index 169ac03..7bb6114 100644 --- a/chrome/browser/chromeos/notifications/notification_panel.cc +++ b/chrome/browser/chromeos/notifications/notification_panel.cc @@ -10,6 +10,7 @@ #include "chrome/browser/chromeos/notifications/balloon_collection_impl.h" #include "chrome/browser/chromeos/notifications/balloon_view.h" +#include "chrome/common/chrome_notification_types.h" #include "content/common/notification_details.h" #include "content/common/notification_source.h" #include "grit/generated_resources.h" @@ -466,7 +467,7 @@ void NotificationPanel::Show() { panel_controller_->Init(false /* don't focus when opened */, gfx::Rect(0, 0, kBalloonMinWidth, 1), 0, WM_IPC_PANEL_USER_RESIZE_VERTICALLY); - registrar_.Add(this, NotificationType::PANEL_STATE_CHANGED, + registrar_.Add(this, chrome::NOTIFICATION_PANEL_STATE_CHANGED, Source<PanelController>(panel_controller_.get())); } panel_widget_->Show(); @@ -616,10 +617,10 @@ void NotificationPanel::ActivatePanel() { //////////////////////////////////////////////////////////////////////////////// // NotificationObserver overrides. -void NotificationPanel::Observe(NotificationType type, +void NotificationPanel::Observe(int type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NotificationType::PANEL_STATE_CHANGED); + DCHECK(type == chrome::NOTIFICATION_PANEL_STATE_CHANGED); PanelController::State* state = reinterpret_cast<PanelController::State*>(details.map_key()); switch (*state) { @@ -687,7 +688,7 @@ void NotificationPanel::Init() { void NotificationPanel::UnregisterNotification() { if (panel_controller_.get()) - registrar_.Remove(this, NotificationType::PANEL_STATE_CHANGED, + registrar_.Remove(this, chrome::NOTIFICATION_PANEL_STATE_CHANGED, Source<PanelController>(panel_controller_.get())); } diff --git a/chrome/browser/chromeos/notifications/notification_panel.h b/chrome/browser/chromeos/notifications/notification_panel.h index 29aa93a..92385bc 100644 --- a/chrome/browser/chromeos/notifications/notification_panel.h +++ b/chrome/browser/chromeos/notifications/notification_panel.h @@ -105,7 +105,7 @@ class NotificationPanel : public PanelController::Delegate, virtual void ActivatePanel(); // NotificationObserver overrides: - virtual void Observe(NotificationType type, + virtual void Observe(int type, const NotificationSource& source, const NotificationDetails& details); |