summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-12 23:08:56 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-12 23:08:56 +0000
commit9a22457f69b4cddf6a360559f0663e51fc5ab9c5 (patch)
tree967b7c63bca70dfa1efae86d1c9c0caa559a7c61 /ash
parent24b12e5ba96d93ab90314d89e43148d52aa3c3f4 (diff)
downloadchromium_src-9a22457f69b4cddf6a360559f0663e51fc5ab9c5.zip
chromium_src-9a22457f69b4cddf6a360559f0663e51fc5ab9c5.tar.gz
chromium_src-9a22457f69b4cddf6a360559f0663e51fc5ab9c5.tar.bz2
Revert 199625 "Remove ENABLE_MESSAGE_CENTER"
Caused a static initializer on Linux: # message_center_constants.cc __i686.get_pc_thunk.cx (Not on Mac though. The SkGetColor() macro has a comment about it not adding a static initializer on release builds, so maybe it's the float-int-multiplication? I don't have a linux box around to check, sorry.) > Remove ENABLE_MESSAGE_CENTER > > Next step on re-factoring Notifications. This will bring the MessageCenter classes, most important message_center::Notification, into build on all systems, including those where the MessageCenter is not yet appearign in UI. This will allow to start using this Notification class in client code and remove the old Notification class defined in chrome/browser/notificaitons/notification.h > > That will allow the clients that already use Rich Notifications to use richer data type support, for example supply an image bits for a Notification (as in Snapshot notifications). > > This also removes a lot of compile-time @ifdefs and replaces them with checking a runtime flag which we already have anyways. > > On Android and iOS, the MessageCenter is not compiled in, for the size concerns and uncertain story for notifications in general - the existing ENABLE_NOTIFICATIONS define is used for that. > > BUG=174164 > > Review URL: https://chromiumcodereview.appspot.com/15025002 TBR=dimich@chromium.org Review URL: https://codereview.chromium.org/14631021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/shell/content_client/shell_browser_main_parts.cc9
-rw-r--r--ash/test/ash_test_helper.cc8
2 files changed, 16 insertions, 1 deletions
diff --git a/ash/shell/content_client/shell_browser_main_parts.cc b/ash/shell/content_client/shell_browser_main_parts.cc
index a692775..b2393e6 100644
--- a/ash/shell/content_client/shell_browser_main_parts.cc
+++ b/ash/shell/content_client/shell_browser_main_parts.cc
@@ -28,10 +28,13 @@
#include "ui/compositor/compositor.h"
#include "ui/compositor/test/compositor_test_support.h"
#include "ui/gfx/screen.h"
-#include "ui/message_center/message_center.h"
#include "ui/views/focus/accelerator_handler.h"
#include "ui/views/test/test_views_delegate.h"
+#if defined(ENABLE_MESSAGE_CENTER)
+#include "ui/message_center/message_center.h"
+#endif
+
#if defined(USE_X11)
#include "ui/base/touch/touch_factory_x11.h"
#endif
@@ -106,9 +109,11 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
views::ViewsDelegate::views_delegate = new ShellViewsDelegate;
delegate_ = new ash::shell::ShellDelegateImpl;
+#if defined(ENABLE_MESSAGE_CENTER)
// The global message center state must be initialized absent
// g_browser_process.
message_center::MessageCenter::Initialize();
+#endif
ash::Shell::CreateInstance(delegate_);
ash::Shell::GetInstance()->set_browser_context(browser_context_.get());
@@ -137,9 +142,11 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() {
delegate_->SetWatcher(NULL);
delegate_ = NULL;
ash::Shell::DeleteInstance();
+#if defined(ENABLE_MESSAGE_CENTER)
// The global message center state must be shutdown absent
// g_browser_process.
message_center::MessageCenter::Shutdown();
+#endif
aura::Env::DeleteInstance();
// The keyboard may have created a WebContents. The WebContents is destroyed
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index a2fb390f..c95fe28 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -14,7 +14,11 @@
#include "ui/aura/env.h"
#include "ui/base/ime/text_input_test_support.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
+
+
+#if defined(ENABLE_MESSAGE_CENTER)
#include "ui/message_center/message_center.h"
+#endif
namespace ash {
namespace test {
@@ -41,9 +45,11 @@ void AshTestHelper::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* shell = Shell::GetInstance();
test::DisplayManagerTestApi(shell->display_manager()).
@@ -56,8 +62,10 @@ void AshTestHelper::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();