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

Unified Diff: chrome/browser/ui/views/message_center/web_notification_tray.cc

Issue 110693004: Moves the notification icon out of the status area overflow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/ui/views/message_center/web_notification_tray.cc
diff --git a/chrome/browser/ui/views/message_center/web_notification_tray.cc b/chrome/browser/ui/views/message_center/web_notification_tray.cc
index 8cab3faddd05c7013c199b228514f77a0a5ba9c8..6ca32b623dbcc519187635d7349755ed60b66d94 100644
--- a/chrome/browser/ui/views/message_center/web_notification_tray.cc
+++ b/chrome/browser/ui/views/message_center/web_notification_tray.cc
@@ -5,12 +5,14 @@
#include "chrome/browser/ui/views/message_center/web_notification_tray.h"
#include "base/i18n/number_formatting.h"
+#include "base/prefs/pref_service.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/status_icons/status_icon.h"
#include "chrome/browser/status_icons/status_icon_menu_model.h"
#include "chrome/browser/status_icons/status_tray.h"
+#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
#include "grit/chromium_strings.h"
#include "grit/theme_resources.h"
@@ -121,10 +123,10 @@ Alignment GetAnchorAlignment(const gfx::Rect& work_area, gfx::Point corner) {
} // namespace internal
MessageCenterTrayDelegate* CreateMessageCenterTray() {
- return new WebNotificationTray();
+ return new WebNotificationTray(g_browser_process->local_state());
}
-WebNotificationTray::WebNotificationTray()
+WebNotificationTray::WebNotificationTray(PrefService* local_state)
: message_center_delegate_(NULL),
status_icon_(NULL),
status_icon_menu_(NULL),
@@ -133,6 +135,13 @@ WebNotificationTray::WebNotificationTray()
message_center_tray_.reset(
new MessageCenterTray(this, g_browser_process->message_center()));
last_quiet_mode_state_ = message_center()->IsQuietMode();
+#if defined(OS_WIN)
+ // |local_state| can be NULL in tests.
+ if (local_state) {
+ did_force_tray_visible_.Init(prefs::kMessageCenterForcedOnTaskbar,
+ local_state);
+ }
+#endif
}
WebNotificationTray::~WebNotificationTray() {
@@ -341,6 +350,12 @@ void WebNotificationTray::CreateStatusIcon(const gfx::ImageSkia& image,
status_icon_->AddObserver(this);
AddQuietModeMenu(status_icon_);
+#if defined(OS_WIN)
+ if (!*did_force_tray_visible_) {
+ EnforceStatusIconVisible();
+ did_force_tray_visible_.SetValue(true);
+ }
+#endif
}
void WebNotificationTray::DestroyStatusIcon() {

Powered by Google App Engine
This is Rietveld 408576698