| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/system/chromeos/session/logout_button_tray.h" | 5 #include "ash/common/system/chromeos/session/logout_button_tray.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf) | 103 LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf) |
| 104 : TrayBackgroundView(wm_shelf), | 104 : TrayBackgroundView(wm_shelf), |
| 105 button_(nullptr), | 105 button_(nullptr), |
| 106 login_status_(LoginStatus::NOT_LOGGED_IN), | 106 login_status_(LoginStatus::NOT_LOGGED_IN), |
| 107 show_logout_button_in_tray_(false) { | 107 show_logout_button_in_tray_(false) { |
| 108 if (MaterialDesignController::IsShelfMaterial()) { | 108 if (MaterialDesignController::IsShelfMaterial()) { |
| 109 views::MdTextButton* button = | 109 views::MdTextButton* button = |
| 110 views::MdTextButton::Create(this, base::string16()); | 110 views::MdTextButton::Create(this, base::string16()); |
| 111 button->SetProminent(true); | 111 button->SetProminent(true); |
| 112 button->set_bg_color_override(gfx::kGoogleRed700); | 112 button->SetBgColorOverride(gfx::kGoogleRed700); |
| 113 // Base font size + 2 = 14. | 113 // Base font size + 2 = 14. |
| 114 // TODO(estade): should this 2 be shared with other tray views? See | 114 // TODO(estade): should this 2 be shared with other tray views? See |
| 115 // crbug.com/623987 | 115 // crbug.com/623987 |
| 116 button->AdjustFontSize(2); | 116 button->AdjustFontSize(2); |
| 117 button_ = button; | 117 button_ = button; |
| 118 } else { | 118 } else { |
| 119 button_ = new LogoutButton(this); | 119 button_ = new LogoutButton(this); |
| 120 } | 120 } |
| 121 tray_container()->AddChildView(button_); | 121 tray_container()->AddChildView(button_); |
| 122 if (!ash::MaterialDesignController::IsShelfMaterial()) | 122 if (!ash::MaterialDesignController::IsShelfMaterial()) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 button_->SetAccessibleName(title); | 191 button_->SetAccessibleName(title); |
| 192 button_->SetImage( | 192 button_->SetImage( |
| 193 views::LabelButton::STATE_NORMAL, | 193 views::LabelButton::STATE_NORMAL, |
| 194 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); | 194 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); |
| 195 button_->SetMinSize(gfx::Size(kTrayItemSize, kTrayItemSize)); | 195 button_->SetMinSize(gfx::Size(kTrayItemSize, kTrayItemSize)); |
| 196 } | 196 } |
| 197 UpdateVisibility(); | 197 UpdateVisibility(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace ash | 200 } // namespace ash |
| OLD | NEW |