| 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" |
| 11 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" | 11 #include "ash/common/system/chromeos/session/logout_confirmation_controller.h" |
| 12 #include "ash/common/system/tray/system_tray_delegate.h" | 12 #include "ash/common/system/tray/system_tray_controller.h" |
| 13 #include "ash/common/system/tray/system_tray_notifier.h" | 13 #include "ash/common/system/tray/system_tray_notifier.h" |
| 14 #include "ash/common/system/tray/tray_constants.h" | 14 #include "ash/common/system/tray/tray_constants.h" |
| 15 #include "ash/common/system/tray/tray_utils.h" | 15 #include "ash/common/system/tray/tray_utils.h" |
| 16 #include "ash/common/system/user/login_status.h" | 16 #include "ash/common/system/user/login_status.h" |
| 17 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
| 18 #include "ash/public/cpp/shelf_types.h" | 18 #include "ash/public/cpp/shelf_types.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "grit/ash_resources.h" | 20 #include "grit/ash_resources.h" |
| 21 #include "third_party/skia/include/core/SkColor.h" | 21 #include "third_party/skia/include/core/SkColor.h" |
| 22 #include "ui/events/event.h" | 22 #include "ui/events/event.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 void LogoutButtonTray::ButtonPressed(views::Button* sender, | 149 void LogoutButtonTray::ButtonPressed(views::Button* sender, |
| 150 const ui::Event& event) { | 150 const ui::Event& event) { |
| 151 if (sender != button_) { | 151 if (sender != button_) { |
| 152 TrayBackgroundView::ButtonPressed(sender, event); | 152 TrayBackgroundView::ButtonPressed(sender, event); |
| 153 return; | 153 return; |
| 154 } | 154 } |
| 155 | 155 |
| 156 if (dialog_duration_ <= base::TimeDelta()) { | 156 if (dialog_duration_ <= base::TimeDelta()) { |
| 157 // Sign out immediately if |dialog_duration_| is non-positive. | 157 // Sign out immediately if |dialog_duration_| is non-positive. |
| 158 WmShell::Get()->system_tray_delegate()->SignOut(); | 158 WmShell::Get()->system_tray_controller()->SignOut(); |
| 159 } else if (WmShell::Get()->logout_confirmation_controller()) { | 159 } else if (WmShell::Get()->logout_confirmation_controller()) { |
| 160 WmShell::Get()->logout_confirmation_controller()->ConfirmLogout( | 160 WmShell::Get()->logout_confirmation_controller()->ConfirmLogout( |
| 161 base::TimeTicks::Now() + dialog_duration_); | 161 base::TimeTicks::Now() + dialog_duration_); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 void LogoutButtonTray::OnShowLogoutButtonInTrayChanged(bool show) { | 165 void LogoutButtonTray::OnShowLogoutButtonInTrayChanged(bool show) { |
| 166 show_logout_button_in_tray_ = show; | 166 show_logout_button_in_tray_ = show; |
| 167 UpdateVisibility(); | 167 UpdateVisibility(); |
| 168 } | 168 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 198 button_->SetAccessibleName(title); | 198 button_->SetAccessibleName(title); |
| 199 button_->SetImage( | 199 button_->SetImage( |
| 200 views::LabelButton::STATE_NORMAL, | 200 views::LabelButton::STATE_NORMAL, |
| 201 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); | 201 gfx::CreateVectorIcon(gfx::VectorIconId::SHELF_LOGOUT, kTrayIconColor)); |
| 202 button_->SetMinSize(gfx::Size(button_size, button_size)); | 202 button_->SetMinSize(gfx::Size(button_size, button_size)); |
| 203 } | 203 } |
| 204 UpdateVisibility(); | 204 UpdateVisibility(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace ash | 207 } // namespace ash |
| OLD | NEW |