Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: ash/common/system/chromeos/session/logout_button_tray.cc

Issue 2505783002: chromeos: Migrate SignOut and RequestRestartForUpdate to mojo interface (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray_controller.h » ('j') | ash/common/wm_shell.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray_controller.h » ('j') | ash/common/wm_shell.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698