Chromium Code Reviews| Index: chrome/browser/chromeos/login/background_view.cc |
| diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc |
| index e07b6598184468a07ef083e5e1cabe0103f3ad4e..61b22d608b0f03fdc0af4933908b19836dd17bd2 100644 |
| --- a/chrome/browser/chromeos/login/background_view.cc |
| +++ b/chrome/browser/chromeos/login/background_view.cc |
| @@ -19,9 +19,6 @@ |
| #include "chrome/browser/chromeos/login/shutdown_button.h" |
| #include "chrome/browser/chromeos/login/wizard_controller.h" |
| #include "chrome/browser/chromeos/status/clock_menu_button.h" |
| -#include "chrome/browser/chromeos/status/input_method_menu_button.h" |
| -#include "chrome/browser/chromeos/status/network_menu_button.h" |
| -#include "chrome/browser/chromeos/status/status_area_view.h" |
| #include "chrome/browser/policy/browser_policy_connector.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/ui/views/dom_view.h" |
| @@ -81,6 +78,7 @@ namespace chromeos { |
| BackgroundView::BackgroundView() |
| : status_area_(NULL), |
| + screen_mode_(StatusAreaViewChromeos::LOGIN_MODE_VIEWS), |
| os_version_label_(NULL), |
| boot_times_label_(NULL), |
| progress_bar_(NULL), |
| @@ -216,7 +214,10 @@ bool BackgroundView::ScreenSaverEnabled() { |
| void BackgroundView::SetDefaultUse24HourClock(bool use_24hour_clock) { |
| DCHECK(status_area_); |
| - status_area_->clock_view()->SetDefaultUse24HourClock(use_24hour_clock); |
| + ClockMenuButton* clock_view = static_cast<ClockMenuButton*>( |
|
DaveMoore
2011/11/07 15:36:18
I'd rather see GetClockMenuButton() in StatusAreaV
stevenjb
2011/11/08 00:24:22
I think all of this is better off in StatusAreaVie
|
| + status_area_->GetViewByID(VIEW_ID_STATUS_BUTTON_CLOCK)); |
| + if (clock_view) |
| + clock_view->SetDefaultUse24HourClock(use_24hour_clock); |
| } |
| /////////////////////////////////////////////////////////////////////////////// |
| @@ -271,24 +272,18 @@ void BackgroundView::ChildPreferredSizeChanged(View* child) { |
| SchedulePaint(); |
| } |
| -Profile* BackgroundView::GetProfile() const { |
| - return NULL; |
| -} |
| +// Overridden from StatusAreaButton::Delegate: |
| -bool BackgroundView::ShouldOpenButtonOptions( |
| - const views::View* button_view) const { |
| - if (button_view == status_area_->network_view()) { |
| +bool BackgroundView::ShouldExecuteStatusAreaCommand( |
| + const views::View* button_view, int command_id) const { |
| + if (command_id == StatusAreaViewChromeos::SHOW_NETWORK_OPTIONS) |
| return true; |
| - } |
| - if (button_view == status_area_->clock_view() || |
| - button_view == status_area_->input_method_view()) { |
| - return false; |
| - } |
| - return true; |
| + return false; |
| } |
| -void BackgroundView::OpenButtonOptions(const views::View* button_view) { |
| - if (button_view == status_area_->network_view()) { |
| +void BackgroundView::ExecuteStatusAreaCommand( |
| + const views::View* button_view, int command_id) { |
| + if (command_id == StatusAreaViewChromeos::SHOW_NETWORK_OPTIONS) { |
| if (proxy_settings_dialog_.get() == NULL) { |
| proxy_settings_dialog_.reset(new ProxySettingsDialog( |
| this, GetNativeWindow())); |
| @@ -297,19 +292,20 @@ void BackgroundView::OpenButtonOptions(const views::View* button_view) { |
| } |
| } |
| -StatusAreaHost::ScreenMode BackgroundView::GetScreenMode() const { |
| - return kViewsLoginMode; |
| +int BackgroundView::GetFontStyle(const gfx::Font& font) const { |
| + return gfx::Font::BOLD; |
| } |
| -StatusAreaHost::TextStyle BackgroundView::GetTextStyle() const { |
| - return kGrayPlain; |
| +StatusAreaButton::TextStyle BackgroundView::GetTextStyle() const { |
| + return StatusAreaButton::GRAY_PLAIN; |
| } |
| void BackgroundView::ButtonVisibilityChanged(views::View* button_view) { |
| - status_area_->ButtonVisibilityChanged(button_view); |
| + status_area_->UpdateButtonVisibility(); |
| } |
| // Overridden from LoginHtmlDialog::Delegate: |
| + |
| void BackgroundView::OnLocaleChanged() { |
| // Proxy settings dialog contains localized strings. |
| proxy_settings_dialog_.reset(); |
| @@ -332,8 +328,8 @@ void BackgroundView::OnBootTimesLabelTextUpdated( |
| void BackgroundView::InitStatusArea() { |
| DCHECK(status_area_ == NULL); |
| - status_area_ = new StatusAreaView(this); |
| - status_area_->Init(); |
| + status_area_ = new StatusAreaViewChromeos(); |
| + status_area_->Init(this, screen_mode_); |
| AddChildView(status_area_); |
| } |