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/system/session/logout_button_tray.h" | 5 #include "ash/system/session/logout_button_tray.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/public/cpp/shelf_types.h" | 10 #include "ash/public/cpp/shelf_types.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf) | 36 LogoutButtonTray::LogoutButtonTray(WmShelf* wm_shelf) |
37 : TrayBackgroundView(wm_shelf, false), | 37 : TrayBackgroundView(wm_shelf, false), |
38 button_(nullptr), | 38 button_(nullptr), |
39 login_status_(LoginStatus::NOT_LOGGED_IN), | 39 login_status_(LoginStatus::NOT_LOGGED_IN), |
40 show_logout_button_in_tray_(false) { | 40 show_logout_button_in_tray_(false) { |
41 views::MdTextButton* button = | 41 views::MdTextButton* button = |
42 views::MdTextButton::Create(this, base::string16()); | 42 views::MdTextButton::Create(this, base::string16()); |
43 button->SetProminent(true); | 43 button->SetProminent(true); |
44 button->SetBgColorOverride(gfx::kGoogleRed700); | 44 button->SetBgColorOverride(gfx::kGoogleRed700); |
45 // Base font size + 2 = 14. | 45 button->AdjustFontSize(kTrayTextFontSizeIncrease); |
46 // TODO(estade): should this 2 be shared with other tray views? See | |
47 // crbug.com/623987 | |
48 button->AdjustFontSize(2); | |
49 button_ = button; | 46 button_ = button; |
50 | 47 |
51 // Since LogoutButtonTray has a red background and it is distinguished | 48 // Since LogoutButtonTray has a red background and it is distinguished |
52 // by itself, no separator is needed on its right side. | 49 // by itself, no separator is needed on its right side. |
53 set_separator_visibility(false); | 50 set_separator_visibility(false); |
54 tray_container()->AddChildView(button_); | 51 tray_container()->AddChildView(button_); |
55 Shell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); | 52 Shell::Get()->system_tray_notifier()->AddLogoutButtonObserver(this); |
56 } | 53 } |
57 | 54 |
58 LogoutButtonTray::~LogoutButtonTray() { | 55 LogoutButtonTray::~LogoutButtonTray() { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 button_->SetText(base::string16()); | 120 button_->SetText(base::string16()); |
124 button_->SetAccessibleName(title); | 121 button_->SetAccessibleName(title); |
125 button_->SetImage(views::LabelButton::STATE_NORMAL, | 122 button_->SetImage(views::LabelButton::STATE_NORMAL, |
126 gfx::CreateVectorIcon(kShelfLogoutIcon, kTrayIconColor)); | 123 gfx::CreateVectorIcon(kShelfLogoutIcon, kTrayIconColor)); |
127 button_->SetMinSize(gfx::Size(kTrayItemSize, kTrayItemSize)); | 124 button_->SetMinSize(gfx::Size(kTrayItemSize, kTrayItemSize)); |
128 } | 125 } |
129 UpdateVisibility(); | 126 UpdateVisibility(); |
130 } | 127 } |
131 | 128 |
132 } // namespace ash | 129 } // namespace ash |
OLD | NEW |