Commit 8209f7c1 authored by jonross@chromium.org's avatar jonross@chromium.org

Update Status Area Paint Scheduling

With each TrayBackgroundView now backed by its own layer, calling SchedulePaint on StatusAreaWidgetDelegate no longer notifies them of the need to paint.

When the shelf changes its dimming state it triggers painting. Add support for StatusAreaWidget to notify each of the layer backed trays that painting is needed

TEST=Launch a non-maximized browser. The system tray will be a dark grey. Maximize the browser. The tray should be a lighter grey. This will mimic the colour changes of the application launcher on the shelf.
BUG=378115

Review URL: https://codereview.chromium.org/302153002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274318 0039d316-1c4b-4281-b951-d872f2087c98
parent c3deb1fd
......@@ -717,7 +717,7 @@ void ShelfWidget::SetDimsShelf(bool dimming) {
// status area background, app list button and overflow button.
if (shelf_)
shelf_->SchedulePaint();
status_area_widget_->GetContentsView()->SchedulePaint();
status_area_widget_->SchedulePaint();
}
bool ShelfWidget::GetDimsShelf() const {
......
......@@ -117,6 +117,17 @@ bool StatusAreaWidget::IsMessageBubbleShown() const {
web_notification_tray_->IsMessageCenterBubbleVisible()));
}
void StatusAreaWidget::SchedulePaint() {
status_area_widget_delegate_->SchedulePaint();
web_notification_tray_->SchedulePaint();
system_tray_->SchedulePaint();
#if defined(OS_CHROMEOS)
virtual_keyboard_tray_->SchedulePaint();
logout_button_tray_->SchedulePaint();
#endif
overview_button_tray_->SchedulePaint();
}
void StatusAreaWidget::OnNativeWidgetActivationChanged(bool active) {
Widget::OnNativeWidgetActivationChanged(active);
if (active)
......
......@@ -67,6 +67,10 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget {
// True if any message bubble is shown.
bool IsMessageBubbleShown() const;
// Notifies child trays, and the |status_area_widget_delegate_| to schedule a
// paint.
void SchedulePaint();
// Overridden from views::Widget:
virtual void OnNativeWidgetActivationChanged(bool active) 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