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

Unified Diff: ash/system/tray/system_tray.cc

Issue 10546125: Add WebNotificationTray to the status area (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 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
« no previous file with comments | « ash/system/tray/system_tray.h ('k') | ash/system/tray/system_tray_bubble.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 707c962a5c95939d9cb37f1c8f69ce857397e2ce..0b6e2df5b73e35e202cbdee419a84200c0277d94 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -138,7 +138,8 @@ SystemTray::SystemTray()
update_observer_(NULL),
user_observer_(NULL),
should_show_launcher_(false),
- default_bubble_height_(0) {
+ default_bubble_height_(0),
+ hide_notifications_(false) {
tray_container_ = new internal::SystemTrayContainer;
tray_container_->SetLayoutManager(new views::BoxLayout(
views::BoxLayout::kHorizontal, 0, 0, 0));
@@ -298,6 +299,16 @@ void SystemTray::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
}
}
+void SystemTray::SetHideNotifications(bool hide_notifications) {
+ if (notification_bubble_.get())
+ notification_bubble_->SetVisible(!hide_notifications);
+ hide_notifications_ = hide_notifications;
+}
+
+bool SystemTray::IsBubbleVisible() const {
+ return bubble_.get() && bubble_->IsVisible();
+}
+
bool SystemTray::CloseBubbleForTest() const {
if (!bubble_.get())
return false;
@@ -462,6 +473,8 @@ void SystemTray::UpdateNotificationBubble() {
if (arrow_offset >= 0)
init_params.arrow_offset = arrow_offset;
notification_bubble_->InitView(init_params);
+ if (hide_notifications_)
+ notification_bubble_->SetVisible(false);
}
void SystemTray::UpdateNotificationAnchor() {
« no previous file with comments | « ash/system/tray/system_tray.h ('k') | ash/system/tray/system_tray_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698