Commit fb140bcf authored by stevenjb@google.com's avatar stevenjb@google.com

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

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=151752

Review URL: https://chromiumcodereview.appspot.com/10834338

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151775 0039d316-1c4b-4281-b951-d872f2087c98
parent e2b43e4d
...@@ -324,9 +324,12 @@ StatusAreaWidget::~StatusAreaWidget() { ...@@ -324,9 +324,12 @@ StatusAreaWidget::~StatusAreaWidget() {
void StatusAreaWidget::CreateTrayViews(ShellDelegate* shell_delegate) { void StatusAreaWidget::CreateTrayViews(ShellDelegate* shell_delegate) {
AddWebNotificationTray(); AddWebNotificationTray();
AddSystemTray(shell_delegate); AddSystemTray(shell_delegate);
// SetBorder() must be called after all trays have been created. // Initialize() must be called after all trays have been created.
web_notification_tray_->SetBorder(); if (system_tray_)
system_tray_->SetBorder(); system_tray_->Initialize();
if (web_notification_tray_)
web_notification_tray_->Initialize();
UpdateAfterLoginStatusChange(system_tray_delegate_->GetUserLoginStatus());
} }
void StatusAreaWidget::Shutdown() { void StatusAreaWidget::Shutdown() {
...@@ -343,7 +346,6 @@ void StatusAreaWidget::Shutdown() { ...@@ -343,7 +346,6 @@ void StatusAreaWidget::Shutdown() {
void StatusAreaWidget::AddSystemTray(ShellDelegate* shell_delegate) { void StatusAreaWidget::AddSystemTray(ShellDelegate* shell_delegate) {
system_tray_ = new SystemTray(this); system_tray_ = new SystemTray(this);
status_area_widget_delegate_->AddTray(system_tray_); status_area_widget_delegate_->AddTray(system_tray_);
system_tray_->Initialize(); // Called after added to widget.
if (shell_delegate) { if (shell_delegate) {
system_tray_delegate_.reset( system_tray_delegate_.reset(
...@@ -351,9 +353,6 @@ void StatusAreaWidget::AddSystemTray(ShellDelegate* shell_delegate) { ...@@ -351,9 +353,6 @@ void StatusAreaWidget::AddSystemTray(ShellDelegate* shell_delegate) {
} }
if (!system_tray_delegate_.get()) if (!system_tray_delegate_.get())
system_tray_delegate_.reset(new DummySystemTrayDelegate()); system_tray_delegate_.reset(new DummySystemTrayDelegate());
system_tray_->CreateItems(); // Called after delegate is created.
UpdateAfterLoginStatusChange(system_tray_delegate_->GetUserLoginStatus());
} }
void StatusAreaWidget::AddWebNotificationTray() { void StatusAreaWidget::AddWebNotificationTray() {
......
...@@ -51,39 +51,9 @@ ...@@ -51,39 +51,9 @@
namespace ash { namespace ash {
namespace internal {
// Observe the tray layer animation and update the anchor when it changes.
// TODO(stevenjb): Observe or mirror the actual animation, not just the start
// and end points.
class SystemTrayLayerAnimationObserver : public ui::LayerAnimationObserver {
public:
explicit SystemTrayLayerAnimationObserver(SystemTray* host) : host_(host) {}
virtual void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) {
host_->UpdateNotificationAnchor();
}
virtual void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) {
host_->UpdateNotificationAnchor();
}
virtual void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) {
host_->UpdateNotificationAnchor();
}
private:
SystemTray* host_;
DISALLOW_COPY_AND_ASSIGN(SystemTrayLayerAnimationObserver);
};
} // namespace internal
// SystemTray // SystemTray
using internal::SystemTrayBubble; using internal::SystemTrayBubble;
using internal::SystemTrayLayerAnimationObserver;
using internal::TrayBubbleView; using internal::TrayBubbleView;
SystemTray::SystemTray(internal::StatusAreaWidget* status_area_widget) SystemTray::SystemTray(internal::StatusAreaWidget* status_area_widget)
...@@ -113,14 +83,6 @@ SystemTray::~SystemTray() { ...@@ -113,14 +83,6 @@ SystemTray::~SystemTray() {
++it) { ++it) {
(*it)->DestroyTrayView(); (*it)->DestroyTrayView();
} }
GetWidget()->GetNativeView()->layer()->GetAnimator()->RemoveObserver(
layer_animation_observer_.get());
}
void SystemTray::Initialize() {
layer_animation_observer_.reset(new SystemTrayLayerAnimationObserver(this));
GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver(
layer_animation_observer_.get());
} }
void SystemTray::CreateItems() { void SystemTray::CreateItems() {
...@@ -181,8 +143,7 @@ void SystemTray::AddTrayItem(SystemTrayItem* item) { ...@@ -181,8 +143,7 @@ void SystemTray::AddTrayItem(SystemTrayItem* item) {
SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate(); SystemTrayDelegate* delegate = Shell::GetInstance()->tray_delegate();
views::View* tray_item = item->CreateTrayView(delegate->GetUserLoginStatus()); views::View* tray_item = item->CreateTrayView(delegate->GetUserLoginStatus());
item->UpdateAfterShelfAlignmentChange( item->UpdateAfterShelfAlignmentChange(shelf_alignment());
ash::Shell::GetInstance()->system_tray()->shelf_alignment());
if (tray_item) { if (tray_item) {
tray_container()->AddChildViewAt(tray_item, 0); tray_container()->AddChildViewAt(tray_item, 0);
...@@ -435,12 +396,9 @@ void SystemTray::UpdateNotificationBubble() { ...@@ -435,12 +396,9 @@ void SystemTray::UpdateNotificationBubble() {
status_area_widget()->HideNonSystemNotifications(); status_area_widget()->HideNonSystemNotifications();
} }
void SystemTray::UpdateNotificationAnchor() { void SystemTray::Initialize() {
if (!notification_bubble_.get()) internal::TrayBackgroundView::Initialize();
return; CreateItems();
notification_bubble_->bubble_view()->UpdateBubble();
// Ensure that the notification buble is above the launcher/status area.
notification_bubble_->bubble_view()->GetWidget()->StackAtTop();
} }
void SystemTray::SetShelfAlignment(ShelfAlignment alignment) { void SystemTray::SetShelfAlignment(ShelfAlignment alignment) {
...@@ -457,6 +415,16 @@ void SystemTray::SetShelfAlignment(ShelfAlignment alignment) { ...@@ -457,6 +415,16 @@ void SystemTray::SetShelfAlignment(ShelfAlignment alignment) {
} }
} }
void SystemTray::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 (bubble_.get())
bubble_->bubble_view()->UpdateBubble();
}
bool SystemTray::PerformAction(const ui::Event& event) { bool SystemTray::PerformAction(const ui::Event& event) {
// If we're already showing the default view, hide it; otherwise, show it // If we're already showing the default view, hide it; otherwise, show it
// (and hide any popup that's currently shown). // (and hide any popup that's currently shown).
...@@ -491,24 +459,10 @@ void SystemTray::OnMouseExited(const ui::MouseEvent& event) { ...@@ -491,24 +459,10 @@ void SystemTray::OnMouseExited(const ui::MouseEvent& event) {
should_show_launcher_ = false; should_show_launcher_ = false;
} }
void SystemTray::AboutToRequestFocusFromTabTraversal(bool reverse) {
views::View* v = GetNextFocusableView();
if (v)
v->AboutToRequestFocusFromTabTraversal(reverse);
}
void SystemTray::GetAccessibleState(ui::AccessibleViewState* state) { void SystemTray::GetAccessibleState(ui::AccessibleViewState* state) {
state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
state->name = l10n_util::GetStringUTF16( state->name = l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME); IDS_ASH_STATUS_TRAY_ACCESSIBLE_NAME);
} }
void SystemTray::OnPaintFocusBorder(gfx::Canvas* canvas) {
// The tray itself expands to the right and bottom edge of the screen to make
// sure clicking on the edges brings up the popup. However, the focus border
// should be only around the container.
if (GetWidget() && GetWidget()->IsActive())
DrawBorder(canvas, GetContentsBounds());
}
} // namespace ash } // namespace ash
...@@ -41,7 +41,6 @@ class SystemTrayItem; ...@@ -41,7 +41,6 @@ class SystemTrayItem;
namespace internal { namespace internal {
class SystemTrayBubble; class SystemTrayBubble;
class SystemTrayContainer; class SystemTrayContainer;
class SystemTrayLayerAnimationObserver;
} }
// There are different methods for creating bubble views. // There are different methods for creating bubble views.
...@@ -55,9 +54,6 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView { ...@@ -55,9 +54,6 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView {
explicit SystemTray(internal::StatusAreaWidget* status_area_widget); explicit SystemTray(internal::StatusAreaWidget* status_area_widget);
virtual ~SystemTray(); virtual ~SystemTray();
// Called after the tray has been added to the widget containing it.
void Initialize();
// Creates the default set of items for the sytem tray. // Creates the default set of items for the sytem tray.
void CreateItems(); void CreateItems();
...@@ -156,10 +152,11 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView { ...@@ -156,10 +152,11 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView {
bool CloseBubbleForTest() const; bool CloseBubbleForTest() const;
// Overridden from TrayBackgroundView. // Overridden from TrayBackgroundView.
virtual void Initialize() OVERRIDE;
virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE;
virtual void AnchorUpdated() OVERRIDE;
private: private:
friend class internal::SystemTrayLayerAnimationObserver;
friend class internal::SystemTrayBubble; friend class internal::SystemTrayBubble;
// Resets |bubble_| and clears any related state. // Resets |bubble_| and clears any related state.
...@@ -191,18 +188,13 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView { ...@@ -191,18 +188,13 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView {
// |notification_items_|, or destroys it if there are no notification items. // |notification_items_|, or destroys it if there are no notification items.
void UpdateNotificationBubble(); void UpdateNotificationBubble();
// Called when the anchor (tray or bubble) may have moved or changed.
void UpdateNotificationAnchor();
// Overridden from internal::ActionableView. // Overridden from internal::ActionableView.
virtual bool PerformAction(const ui::Event& event) OVERRIDE; virtual bool PerformAction(const ui::Event& event) OVERRIDE;
// Overridden from views::View. // Overridden from views::View.
virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
// Owned items. // Owned items.
ScopedVector<SystemTrayItem> items_; ScopedVector<SystemTrayItem> items_;
...@@ -239,9 +231,6 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView { ...@@ -239,9 +231,6 @@ class ASH_EXPORT SystemTray : public internal::TrayBackgroundView {
// See description agove getter. // See description agove getter.
bool should_show_launcher_; bool should_show_launcher_;
scoped_ptr<internal::SystemTrayLayerAnimationObserver>
layer_animation_observer_;
// Keep track of the default view height so that when we create detailed // Keep track of the default view height so that when we create detailed
// views directly (e.g. from a notification) we know what height to use. // views directly (e.g. from a notification) we know what height to use.
int default_bubble_height_; int default_bubble_height_;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "ash/system/status_area_widget_delegate.h" #include "ash/system/status_area_widget_delegate.h"
#include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_constants.h"
#include "ui/aura/window.h" #include "ui/aura/window.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/skia_util.h" #include "ui/gfx/skia_util.h"
#include "ui/views/background.h" #include "ui/views/background.h"
...@@ -32,6 +33,33 @@ const int kTrayContainerHorizontalPaddingVerticalAlignment = 1; ...@@ -32,6 +33,33 @@ const int kTrayContainerHorizontalPaddingVerticalAlignment = 1;
namespace ash { namespace ash {
namespace internal { namespace internal {
// Observe the tray layer animation and update the anchor when it changes.
// TODO(stevenjb): Observe or mirror the actual animation, not just the start
// and end points.
class TrayLayerAnimationObserver : public ui::LayerAnimationObserver {
public:
explicit TrayLayerAnimationObserver(TrayBackgroundView* host)
: host_(host) {
}
virtual void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) {
host_->AnchorUpdated();
}
virtual void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) {
host_->AnchorUpdated();
}
virtual void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) {
host_->AnchorUpdated();
}
private:
TrayBackgroundView* host_;
DISALLOW_COPY_AND_ASSIGN(TrayLayerAnimationObserver);
};
class TrayBackground : public views::Background { class TrayBackground : public views::Background {
public: public:
TrayBackground() : alpha_(kTrayBackgroundAlpha) {} TrayBackground() : alpha_(kTrayBackgroundAlpha) {}
...@@ -131,7 +159,9 @@ TrayBackgroundView::TrayBackgroundView( ...@@ -131,7 +159,9 @@ TrayBackgroundView::TrayBackgroundView(
ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_( ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_(
this, 0, kTrayBackgroundAlpha)), this, 0, kTrayBackgroundAlpha)),
ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_( ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_(
this, 0, kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha)) { this, 0, kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha)),
ALLOW_THIS_IN_INITIALIZER_LIST(layer_animation_observer_(
new TrayLayerAnimationObserver(this))) {
set_notify_enter_exit_on_child(true); set_notify_enter_exit_on_child(true);
// Initially we want to paint the background, but without the hover effect. // Initially we want to paint the background, but without the hover effect.
...@@ -144,6 +174,16 @@ TrayBackgroundView::TrayBackgroundView( ...@@ -144,6 +174,16 @@ TrayBackgroundView::TrayBackgroundView(
} }
TrayBackgroundView::~TrayBackgroundView() { TrayBackgroundView::~TrayBackgroundView() {
if (GetWidget()) {
GetWidget()->GetNativeView()->layer()->GetAnimator()->RemoveObserver(
layer_animation_observer_.get());
}
}
void TrayBackgroundView::Initialize() {
GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver(
layer_animation_observer_.get());
SetBorder();
} }
void TrayBackgroundView::OnMouseEntered(const ui::MouseEvent& event) { void TrayBackgroundView::OnMouseEntered(const ui::MouseEvent& event) {
...@@ -160,6 +200,21 @@ void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) { ...@@ -160,6 +200,21 @@ void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) {
PreferredSizeChanged(); PreferredSizeChanged();
} }
void TrayBackgroundView::OnPaintFocusBorder(gfx::Canvas* canvas) {
// The tray itself expands to the right and bottom edge of the screen to make
// sure clicking on the edges brings up the popup. However, the focus border
// should be only around the container.
if (GetWidget() && GetWidget()->IsActive())
DrawBorder(canvas, GetContentsBounds());
}
void TrayBackgroundView::AboutToRequestFocusFromTabTraversal(bool reverse) {
// Return focus to the login view. See crbug.com/120500.
views::View* v = GetNextFocusableView();
if (v)
v->AboutToRequestFocusFromTabTraversal(reverse);
}
bool TrayBackgroundView::PerformAction(const ui::Event& event) { bool TrayBackgroundView::PerformAction(const ui::Event& event) {
return false; return false;
} }
......
...@@ -15,6 +15,7 @@ namespace internal { ...@@ -15,6 +15,7 @@ namespace internal {
class StatusAreaWidget; class StatusAreaWidget;
class TrayBackground; class TrayBackground;
class TrayLayerAnimationObserver;
// Base class for children of StatusAreaWidget: SystemTray, WebNotificationTray. // Base class for children of StatusAreaWidget: SystemTray, WebNotificationTray.
// This class handles setting and animating the background when the Launcher // This class handles setting and animating the background when the Launcher
...@@ -58,10 +59,15 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView, ...@@ -58,10 +59,15 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView,
explicit TrayBackgroundView(internal::StatusAreaWidget* status_area_widget); explicit TrayBackgroundView(internal::StatusAreaWidget* status_area_widget);
virtual ~TrayBackgroundView(); virtual ~TrayBackgroundView();
// Called after the tray has been added to the widget containing it.
virtual void Initialize();
// Overridden from views::View. // Overridden from views::View.
virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
// Overridden from internal::ActionableView. // Overridden from internal::ActionableView.
virtual bool PerformAction(const ui::Event& event) OVERRIDE; virtual bool PerformAction(const ui::Event& event) OVERRIDE;
...@@ -72,6 +78,9 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView, ...@@ -72,6 +78,9 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView,
// Called whenever the shelf alignment changes. // Called whenever the shelf alignment changes.
virtual void SetShelfAlignment(ShelfAlignment alignment); virtual void SetShelfAlignment(ShelfAlignment alignment);
// Called when the anchor (tray or bubble) may have moved or changed.
virtual void AnchorUpdated() {}
// Sets |contents| as a child and sets its background to |background_|. // Sets |contents| as a child and sets its background to |background_|.
void SetContents(views::View* contents); void SetContents(views::View* contents);
...@@ -81,10 +90,6 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView, ...@@ -81,10 +90,6 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView,
bool value, bool value,
internal::BackgroundAnimator::ChangeType change_type); internal::BackgroundAnimator::ChangeType change_type);
// Called after all status area trays have been created. Sets the border
// based on the position of the view.
void SetBorder();
StatusAreaWidget* status_area_widget() { StatusAreaWidget* status_area_widget() {
return status_area_widget_; return status_area_widget_;
} }
...@@ -92,6 +97,12 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView, ...@@ -92,6 +97,12 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView,
ShelfAlignment shelf_alignment() const { return shelf_alignment_; } ShelfAlignment shelf_alignment() const { return shelf_alignment_; }
private: private:
friend class TrayLayerAnimationObserver;
// Called from Initialize after all status area trays have been created.
// Sets the border based on the position of the view.
void SetBorder();
// Unowned pointer to parent widget. // Unowned pointer to parent widget.
StatusAreaWidget* status_area_widget_; StatusAreaWidget* status_area_widget_;
...@@ -106,6 +117,8 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView, ...@@ -106,6 +117,8 @@ class ASH_EXPORT TrayBackgroundView : public internal::ActionableView,
internal::BackgroundAnimator hide_background_animator_; internal::BackgroundAnimator hide_background_animator_;
internal::BackgroundAnimator hover_background_animator_; internal::BackgroundAnimator hover_background_animator_;
scoped_ptr<internal::TrayLayerAnimationObserver>
layer_animation_observer_;
DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView);
}; };
......
...@@ -762,6 +762,7 @@ class WebNotificationTray::Bubble : public TrayBubbleView::Host, ...@@ -762,6 +762,7 @@ class WebNotificationTray::Bubble : public TrayBubbleView::Host,
} }
views::Widget* bubble_widget() const { return bubble_widget_; } views::Widget* bubble_widget() const { return bubble_widget_; }
TrayBubbleView* bubble_view() const { return bubble_view_; }
// Overridden from TrayBubbleView::Host. // Overridden from TrayBubbleView::Host.
virtual void BubbleViewDestroyed() OVERRIDE { virtual void BubbleViewDestroyed() OVERRIDE {
...@@ -966,6 +967,16 @@ void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { ...@@ -966,6 +967,16 @@ void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) {
HideNotificationBubble(); 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) // Protected methods (invoked only from Bubble and its child classes)
void WebNotificationTray::SendRemoveNotification(const std::string& id) { void WebNotificationTray::SendRemoveNotification(const std::string& id) {
...@@ -1041,7 +1052,10 @@ void WebNotificationTray::UpdateTray() { ...@@ -1041,7 +1052,10 @@ void WebNotificationTray::UpdateTray() {
count_label_->SetEnabledColor( count_label_->SetEnabledColor(
(notification_list()->notifications().size() == 0) ? (notification_list()->notifications().size() == 0) ?
kMessageCountDimmedColor : kMessageCountColor); 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(); Layout();
SchedulePaint(); SchedulePaint();
} }
......
...@@ -118,6 +118,7 @@ class ASH_EXPORT WebNotificationTray : public internal::TrayBackgroundView { ...@@ -118,6 +118,7 @@ class ASH_EXPORT WebNotificationTray : public internal::TrayBackgroundView {
// Overridden from TrayBackgroundView. // Overridden from TrayBackgroundView.
virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE;
virtual void AnchorUpdated() OVERRIDE;
// Overridden from internal::ActionableView. // Overridden from internal::ActionableView.
virtual bool PerformAction(const ui::Event& event) OVERRIDE; virtual bool PerformAction(const ui::Event& event) OVERRIDE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment