| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/logout_button/tray_logout_button.h" | 5 #include "ash/system/logout_button/tray_logout_button.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 login_status_(user::LOGGED_IN_NONE), | 73 login_status_(user::LOGGED_IN_NONE), |
| 74 show_logout_button_in_tray_(false) { | 74 show_logout_button_in_tray_(false) { |
| 75 views::BoxLayout* layout = new views::BoxLayout( | 75 views::BoxLayout* layout = new views::BoxLayout( |
| 76 views::BoxLayout::kHorizontal, 0, 0, 0); | 76 views::BoxLayout::kHorizontal, 0, 0, 0); |
| 77 layout->set_spread_blank_space(true); | 77 layout->set_spread_blank_space(true); |
| 78 SetLayoutManager(layout); | 78 SetLayoutManager(layout); |
| 79 set_border(views::Border::CreateEmptyBorder( | 79 set_border(views::Border::CreateEmptyBorder( |
| 80 0, kTrayLabelItemHorizontalPaddingBottomAlignment, 0, 0)); | 80 0, kTrayLabelItemHorizontalPaddingBottomAlignment, 0, 0)); |
| 81 | 81 |
| 82 button_ = new views::LabelButton(this, string16()); | 82 button_ = new views::LabelButton(this, string16()); |
| 83 for (size_t state = 0; state < views::CustomButton::STATE_COUNT; ++state) { | 83 for (size_t state = 0; state < views::Button::STATE_COUNT; ++state) { |
| 84 button_->SetTextColor( | 84 button_->SetTextColor( |
| 85 static_cast<views::CustomButton::ButtonState>(state), SK_ColorWHITE); | 85 static_cast<views::Button::ButtonState>(state), SK_ColorWHITE); |
| 86 } | 86 } |
| 87 button_->SetFont(button_->GetFont().DeriveFont(1)); | 87 button_->SetFont(button_->GetFont().DeriveFont(1)); |
| 88 views::LabelButtonBorder* border = new views::LabelButtonBorder(); | 88 views::LabelButtonBorder* border = |
| 89 border->SetPainter(views::CustomButton::STATE_NORMAL, | 89 new views::LabelButtonBorder(views::Button::STYLE_TEXTBUTTON); |
| 90 border->SetPainter(views::Button::STATE_NORMAL, |
| 90 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); | 91 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); |
| 91 border->SetPainter(views::CustomButton::STATE_HOVERED, | 92 border->SetPainter(views::Button::STATE_HOVERED, |
| 92 views::Painter::CreateImageGridPainter(kLogoutButtonHotImages)); | 93 views::Painter::CreateImageGridPainter(kLogoutButtonHotImages)); |
| 93 border->SetPainter(views::CustomButton::STATE_PRESSED, | 94 border->SetPainter(views::Button::STATE_PRESSED, |
| 94 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages)); | 95 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages)); |
| 95 button_->set_border(border); | 96 button_->set_border(border); |
| 96 AddChildView(button_); | 97 AddChildView(button_); |
| 97 OnLoginStatusChanged(status); | 98 OnLoginStatusChanged(status); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void OnLoginStatusChanged(user::LoginStatus status) { | 101 void OnLoginStatusChanged(user::LoginStatus status) { |
| 101 login_status_ = status; | 102 login_status_ = status; |
| 102 const string16 title = GetLocalizedSignOutStringForStatus(login_status_, | 103 const string16 title = GetLocalizedSignOutStringForStatus(login_status_, |
| 103 false); | 104 false); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 159 void TrayLogoutButton::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 159 logout_button_->OnLoginStatusChanged(status); | 160 logout_button_->OnLoginStatusChanged(status); |
| 160 } | 161 } |
| 161 | 162 |
| 162 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { | 163 void TrayLogoutButton::OnShowLogoutButtonInTrayChanged(bool show) { |
| 163 logout_button_->OnShowLogoutButtonInTrayChanged(show); | 164 logout_button_->OnShowLogoutButtonInTrayChanged(show); |
| 164 } | 165 } |
| 165 | 166 |
| 166 } // namespace internal | 167 } // namespace internal |
| 167 } // namespace ash | 168 } // namespace ash |
| OLD | NEW |