diff options
Diffstat (limited to 'ash')
-rw-r--r-- | ash/shell.cc | 6 | ||||
-rw-r--r-- | ash/shell.h | 9 | ||||
-rw-r--r-- | ash/system/web_notification/web_notification_tray.cc | 2 | ||||
-rw-r--r-- | ash/test/ash_test_base.cc | 16 |
4 files changed, 17 insertions, 16 deletions
diff --git a/ash/shell.cc b/ash/shell.cc index c6965b2..77b60f9 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -858,12 +858,6 @@ void Shell::DoInitialWorkspaceAnimation() { DoInitialAnimation(); } -message_center::MessageCenter* Shell::message_center() { - if (!message_center_.get()) - message_center_.reset(new message_center::MessageCenter()); - return message_center_.get(); -} - void Shell::InitRootWindowController( internal::RootWindowController* controller) { aura::RootWindow* root_window = controller->root_window(); diff --git a/ash/shell.h b/ash/shell.h index 5ed4cd7..c2cdda6 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -64,10 +64,6 @@ class WindowModalityController; } } -namespace message_center { -class MessageCenter; -} - namespace ash { class AcceleratorController; @@ -444,9 +440,6 @@ class ASH_EXPORT Shell return root_window_host_factory_.get(); } - // MessageCenter is a global list of currently displayed notifications. - message_center::MessageCenter* message_center(); - private: FRIEND_TEST_ALL_PREFIXES(ExtendedDesktopTest, TestCursor); FRIEND_TEST_ALL_PREFIXES(WindowManagerTest, MouseEventCursors); @@ -589,8 +582,6 @@ class ASH_EXPORT Shell scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_; #endif // defined(OS_CHROMEOS) - scoped_ptr<message_center::MessageCenter> message_center_; - // |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a // pointer to vend to test code. AshNativeCursorManager* native_cursor_manager_; diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc index 998123f..cfc1e1c 100644 --- a/ash/system/web_notification/web_notification_tray.cc +++ b/ash/system/web_notification/web_notification_tray.cc @@ -98,7 +98,7 @@ WebNotificationTray::WebNotificationTray( SetVisible(false); message_center_tray_.reset(new message_center::MessageCenterTray( this, - Shell::GetInstance()->message_center())); + message_center::MessageCenter::Get())); OnMessageCenterTrayChanged(); } diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 853cdff..a1cf637 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -30,6 +30,10 @@ #include "ui/gfx/display.h" #include "ui/gfx/screen.h" +#if defined(ENABLE_MESSAGE_CENTER) +#include "ui/message_center/message_center.h" +#endif + #if defined(OS_WIN) #include "ash/test/test_metro_viewer_process_host.h" #include "base/test/test_process_killer_win.h" @@ -96,6 +100,12 @@ void AshTestBase::SetUp() { // Creates Shell and hook with Desktop. test_shell_delegate_ = new TestShellDelegate; + +#if defined(ENABLE_MESSAGE_CENTER) + // Creates MessageCenter since g_browser_process is not created in AshTestBase + // tests. + message_center::MessageCenter::Initialize(); +#endif ash::Shell::CreateInstance(test_shell_delegate_); Shell::GetPrimaryRootWindow()->Show(); Shell::GetPrimaryRootWindow()->ShowRootWindow(); @@ -130,6 +140,12 @@ void AshTestBase::TearDown() { // Tear down the shell. Shell::DeleteInstance(); + +#if defined(ENABLE_MESSAGE_CENTER) + // Remove global message center state. + message_center::MessageCenter::Shutdown(); +#endif + aura::Env::DeleteInstance(); ui::TextInputTestSupport::Shutdown(); |