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/chromeos/session/logout_button_tray.h" | 5 #include "ash/system/chromeos/session/logout_button_tray.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "ash/shelf/shelf_types.h" | 9 #include "ash/shelf/shelf_types.h" |
8 #include "ash/shell.h" | 10 #include "ash/shell.h" |
9 #include "ash/system/chromeos/session/logout_confirmation_controller.h" | 11 #include "ash/system/chromeos/session/logout_confirmation_controller.h" |
10 #include "ash/system/status_area_widget.h" | 12 #include "ash/system/status_area_widget.h" |
11 #include "ash/system/tray/system_tray_delegate.h" | 13 #include "ash/system/tray/system_tray_delegate.h" |
12 #include "ash/system/tray/system_tray_notifier.h" | 14 #include "ash/system/tray/system_tray_notifier.h" |
13 #include "ash/system/tray/tray_constants.h" | 15 #include "ash/system/tray/tray_constants.h" |
14 #include "ash/system/tray/tray_utils.h" | 16 #include "ash/system/tray/tray_utils.h" |
15 #include "base/logging.h" | 17 #include "base/logging.h" |
16 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 border->SetPainter(false, views::Button::STATE_NORMAL, | 78 border->SetPainter(false, views::Button::STATE_NORMAL, |
77 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); | 79 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); |
78 border->SetPainter(false, views::Button::STATE_HOVERED, | 80 border->SetPainter(false, views::Button::STATE_HOVERED, |
79 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); | 81 views::Painter::CreateImageGridPainter(kLogoutButtonNormalImages)); |
80 border->SetPainter(false, views::Button::STATE_PRESSED, | 82 border->SetPainter(false, views::Button::STATE_PRESSED, |
81 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages)); | 83 views::Painter::CreateImageGridPainter(kLogoutButtonPushedImages)); |
82 gfx::Insets insets = border->GetInsets(); | 84 gfx::Insets insets = border->GetInsets(); |
83 insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding, | 85 insets += gfx::Insets(0, kLogoutButtonHorizontalExtraPadding, |
84 0, kLogoutButtonHorizontalExtraPadding); | 86 0, kLogoutButtonHorizontalExtraPadding); |
85 border->set_insets(insets); | 87 border->set_insets(insets); |
86 SetBorder(border.Pass()); | 88 SetBorder(std::move(border)); |
87 set_animate_on_state_change(false); | 89 set_animate_on_state_change(false); |
88 | 90 |
89 SetMinSize(gfx::Size(0, kShelfItemHeight)); | 91 SetMinSize(gfx::Size(0, kShelfItemHeight)); |
90 } | 92 } |
91 | 93 |
92 LogoutButton::~LogoutButton() { | 94 LogoutButton::~LogoutButton() { |
93 } | 95 } |
94 | 96 |
95 LogoutButtonTray::LogoutButtonTray(StatusAreaWidget* status_area_widget) | 97 LogoutButtonTray::LogoutButtonTray(StatusAreaWidget* status_area_widget) |
96 : TrayBackgroundView(status_area_widget), | 98 : TrayBackgroundView(status_area_widget), |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 UpdateVisibility(); | 158 UpdateVisibility(); |
157 } | 159 } |
158 | 160 |
159 void LogoutButtonTray::UpdateVisibility() { | 161 void LogoutButtonTray::UpdateVisibility() { |
160 SetVisible(show_logout_button_in_tray_ && | 162 SetVisible(show_logout_button_in_tray_ && |
161 login_status_ != user::LOGGED_IN_NONE && | 163 login_status_ != user::LOGGED_IN_NONE && |
162 login_status_ != user::LOGGED_IN_LOCKED); | 164 login_status_ != user::LOGGED_IN_LOCKED); |
163 } | 165 } |
164 | 166 |
165 } // namespace ash | 167 } // namespace ash |
OLD | NEW |