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 SetSeparatorVisibility(false); | |
James Cook
2017/01/09 23:50:53
nit: comment why this is false (because logout but
yiyix
2017/01/10 01:02:53
You are right, after removing the entire logics on
| |
119 } else { | 120 } else { |
120 button_ = new LogoutButton(this); | 121 button_ = new LogoutButton(this); |
121 } | 122 } |
122 tray_container()->AddChildView(button_); | 123 tray_container()->AddChildView(button_); |
123 if (!MaterialDesignController::IsShelfMaterial()) | 124 if (!MaterialDesignController::IsShelfMaterial()) |
124 tray_container()->SetBorder(views::NullBorder()); | 125 tray_container()->SetBorder(views::NullBorder()); |
125 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); | 126 WmShell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); |
126 } | 127 } |
127 | 128 |
128 LogoutButtonTray::~LogoutButtonTray() { | 129 LogoutButtonTray::~LogoutButtonTray() { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 button_->SetAccessibleName(title); | 200 button_->SetAccessibleName(title); |
200 button_->SetImage( | 201 button_->SetImage( |
201 views::LabelButton::STATE_NORMAL, | 202 views::LabelButton::STATE_NORMAL, |
202 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); | 203 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); |
203 button_->SetMinSize(gfx::Size(button_size, button_size)); | 204 button_->SetMinSize(gfx::Size(button_size, button_size)); |
204 } | 205 } |
205 UpdateVisibility(); | 206 UpdateVisibility(); |
206 } | 207 } |
207 | 208 |
208 } // namespace ash | 209 } // namespace ash |
OLD | NEW |