summaryrefslogtreecommitdiffstats
path: root/ash/system/web_notification
diff options
context:
space:
mode:
authorstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 21:31:28 +0000
committerstevenjb@google.com <stevenjb@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-15 21:31:28 +0000
commit24d162314ba4996e06ba33181243d92fbd2ba382 (patch)
tree430b17d1a546bec8bffd16b4202b1a24f68b9003 /ash/system/web_notification
parent957131cfc356db128b515701ceb9e8999c5ecdc4 (diff)
downloadchromium_src-24d162314ba4996e06ba33181243d92fbd2ba382.zip
chromium_src-24d162314ba4996e06ba33181243d92fbd2ba382.tar.gz
chromium_src-24d162314ba4996e06ba33181243d92fbd2ba382.tar.bz2
Move non SystemTray specific code to TrayBackgroundView
This fixes the behavior of the web notification tray with launcher auto-hide. It also fixes visibility of the web notification tray in the lock screen. BUG=142506 Review URL: https://chromiumcodereview.appspot.com/10834338 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151752 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/web_notification')
-rw-r--r--ash/system/web_notification/web_notification_tray.cc16
-rw-r--r--ash/system/web_notification/web_notification_tray.h1
2 files changed, 16 insertions, 1 deletions
diff --git a/ash/system/web_notification/web_notification_tray.cc b/ash/system/web_notification/web_notification_tray.cc
index 44e1999..6c1043c 100644
--- a/ash/system/web_notification/web_notification_tray.cc
+++ b/ash/system/web_notification/web_notification_tray.cc
@@ -762,6 +762,7 @@ class WebNotificationTray::Bubble : public TrayBubbleView::Host,
}
views::Widget* bubble_widget() const { return bubble_widget_; }
+ TrayBubbleView* bubble_view() const { return bubble_view_; }
// Overridden from TrayBubbleView::Host.
virtual void BubbleViewDestroyed() OVERRIDE {
@@ -966,6 +967,16 @@ void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) {
HideNotificationBubble();
}
+void WebNotificationTray::AnchorUpdated() {
+ if (notification_bubble_.get()) {
+ notification_bubble_->bubble_view()->UpdateBubble();
+ // Ensure that the notification buble is above the launcher/status area.
+ notification_bubble_->bubble_view()->GetWidget()->StackAtTop();
+ }
+ if (message_center_bubble_.get())
+ message_center_bubble_->bubble_view()->UpdateBubble();
+}
+
// Protected methods (invoked only from Bubble and its child classes)
void WebNotificationTray::SendRemoveNotification(const std::string& id) {
@@ -1041,7 +1052,10 @@ void WebNotificationTray::UpdateTray() {
count_label_->SetEnabledColor(
(notification_list()->notifications().size() == 0) ?
kMessageCountDimmedColor : kMessageCountColor);
- SetVisible((status_area_widget()->login_status() != user::LOGGED_IN_NONE));
+ bool is_visible =
+ (status_area_widget()->login_status() != user::LOGGED_IN_NONE) &&
+ (status_area_widget()->login_status() != user::LOGGED_IN_LOCKED);
+ SetVisible(is_visible);
Layout();
SchedulePaint();
}
diff --git a/ash/system/web_notification/web_notification_tray.h b/ash/system/web_notification/web_notification_tray.h
index 960ead8..726f787 100644
--- a/ash/system/web_notification/web_notification_tray.h
+++ b/ash/system/web_notification/web_notification_tray.h
@@ -118,6 +118,7 @@ class ASH_EXPORT WebNotificationTray : public internal::TrayBackgroundView {
// Overridden from TrayBackgroundView.
virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE;
+ virtual void AnchorUpdated() OVERRIDE;
// Overridden from internal::ActionableView.
virtual bool PerformAction(const ui::Event& event) OVERRIDE;