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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 if (MaterialDesignController::IsShelfMaterial()) { | 109 if (MaterialDesignController::IsShelfMaterial()) { |
110 views::MdTextButton* button = | 110 views::MdTextButton* button = |
111 views::MdTextButton::Create(this, base::string16()); | 111 views::MdTextButton::Create(this, base::string16()); |
112 button->SetProminent(true); | 112 button->SetProminent(true); |
113 button->SetBgColorOverride(gfx::kGoogleRed700); | 113 button->SetBgColorOverride(gfx::kGoogleRed700); |
114 // Base font size + 2 = 14. | 114 // Base font size + 2 = 14. |
115 // TODO(estade): should this 2 be shared with other tray views? See | 115 // TODO(estade): should this 2 be shared with other tray views? See |
116 // crbug.com/623987 | 116 // crbug.com/623987 |
117 button->AdjustFontSize(2); | 117 button->AdjustFontSize(2); |
118 button_ = button; | 118 button_ = button; |
| 119 |
| 120 // Since |logout_button_tray| has a red background and it is distinguished |
| 121 // by itself, no separator is needed on its right side. |
| 122 set_separator_visibility(false); |
119 } else { | 123 } else { |
120 button_ = new LogoutButton(this); | 124 button_ = new LogoutButton(this); |
121 } | 125 } |
122 tray_container()->AddChildView(button_); | 126 tray_container()->AddChildView(button_); |
123 if (!MaterialDesignController::IsShelfMaterial()) | 127 if (!MaterialDesignController::IsShelfMaterial()) |
124 tray_container()->SetBorder(views::NullBorder()); | 128 tray_container()->SetBorder(views::NullBorder()); |
125 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); | 129 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); |
126 } | 130 } |
127 | 131 |
128 LogoutButtonTray::~LogoutButtonTray() { | 132 LogoutButtonTray::~LogoutButtonTray() { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 button_->SetAccessibleName(title); | 203 button_->SetAccessibleName(title); |
200 button_->SetImage( | 204 button_->SetImage( |
201 views::LabelButton::STATE_NORMAL, | 205 views::LabelButton::STATE_NORMAL, |
202 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); | 206 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); |
203 button_->SetMinSize(gfx::Size(button_size, button_size)); | 207 button_->SetMinSize(gfx::Size(button_size, button_size)); |
204 } | 208 } |
205 UpdateVisibility(); | 209 UpdateVisibility(); |
206 } | 210 } |
207 | 211 |
208 } // namespace ash | 212 } // namespace ash |
OLD | NEW |