diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 17:00:54 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 17:00:54 +0000 |
commit | 7a3ea9054dbd3aa6914bd497fac2db52a0e226c1 (patch) | |
tree | 0551f7c65e917eb25d149e759d05787788fe3c4f /chrome/browser/chromeos | |
parent | 4f62d805c9db0281bde49a21e53a81d10470a776 (diff) | |
download | chromium_src-7a3ea9054dbd3aa6914bd497fac2db52a0e226c1.zip chromium_src-7a3ea9054dbd3aa6914bd497fac2db52a0e226c1.tar.gz chromium_src-7a3ea9054dbd3aa6914bd497fac2db52a0e226c1.tar.bz2 |
aura: Update status area text style to match background.
We use a single view for the status area now. In compact
mode, the window underneath it can vary (login screen, lock
screen, regular or incognito browser window, etc.). This
change makes us update the text style used for the status
area accordingly.
BUG=107389
TEST=manual testing in compact mode; also added a browser test
Review URL: https://chromiumcodereview.appspot.com/9197018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
4 files changed, 31 insertions, 18 deletions
diff --git a/chrome/browser/chromeos/status/status_area_button.cc b/chrome/browser/chromeos/status/status_area_button.cc index 7d9ac0e..c524046 100644 --- a/chrome/browser/chromeos/status/status_area_button.cc +++ b/chrome/browser/chromeos/status/status_area_button.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -133,18 +133,6 @@ void StatusAreaButton::SetMenuActive(bool active) { menu_active_ = active; } -int StatusAreaButton::icon_height() { - return 24; -} - -int StatusAreaButton::icon_width() { - return 23; -} - -int StatusAreaButton::horizontal_padding() { - return 1; -} - void StatusAreaButton::UpdateTextStyle() { ClearEmbellishing(); switch (delegate_->GetStatusAreaTextStyle()) { @@ -164,4 +152,17 @@ void StatusAreaButton::UpdateTextStyle() { SetTextShadowOffset(0, 1); break; } + SchedulePaint(); +} + +int StatusAreaButton::icon_height() { + return 24; +} + +int StatusAreaButton::icon_width() { + return 23; +} + +int StatusAreaButton::horizontal_padding() { + return 1; } diff --git a/chrome/browser/chromeos/status/status_area_button.h b/chrome/browser/chromeos/status/status_area_button.h index 67e4d40..f250bba 100644 --- a/chrome/browser/chromeos/status/status_area_button.h +++ b/chrome/browser/chromeos/status/status_area_button.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -78,6 +78,9 @@ class StatusAreaButton : public views::MenuButton { // menus are activated. virtual void SetMenuActive(bool active); + // Refresh the style used to paint this button's text. Schedules repaint. + void UpdateTextStyle(); + bool menu_active() const { return menu_active_; } protected: @@ -101,8 +104,6 @@ class StatusAreaButton : public views::MenuButton { bool menu_active_; private: - void UpdateTextStyle(); - Delegate* delegate_; DISALLOW_COPY_AND_ASSIGN(StatusAreaButton); diff --git a/chrome/browser/chromeos/status/status_area_view.cc b/chrome/browser/chromeos/status/status_area_view.cc index 463ab79..fb04757 100644 --- a/chrome/browser/chromeos/status/status_area_view.cc +++ b/chrome/browser/chromeos/status/status_area_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -114,6 +114,14 @@ void StatusAreaView::UpdateButtonVisibility() { PreferredSizeChanged(); } +void StatusAreaView::UpdateButtonTextStyle() { + for (std::list<StatusAreaButton*>::const_iterator it = buttons_.begin(); + it != buttons_.end(); ++it) { + StatusAreaButton* button = *it; + button->UpdateTextStyle(); + } +} + void StatusAreaView::TakeFocus( bool reverse, const ReturnFocusCallback& return_focus_cb) { diff --git a/chrome/browser/chromeos/status/status_area_view.h b/chrome/browser/chromeos/status/status_area_view.h index 9c53a72..62e1adc 100644 --- a/chrome/browser/chromeos/status/status_area_view.h +++ b/chrome/browser/chromeos/status/status_area_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -28,6 +28,9 @@ class StatusAreaView : public views::AccessiblePaneView, void MakeButtonsActive(bool active); void UpdateButtonVisibility(); + // Refresh the style used to paint all buttons' text. Schedules repaint. + void UpdateButtonTextStyle(); + // Takes focus and transfers it to the first (last if |reverse| is true). // After focus has traversed through all elements, clears focus and calls // |return_focus_cb(reverse)| from the message loop. |