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

Side by Side Diff: chrome/browser/chromeos/power/power_button_observer.cc

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 4 years, 6 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/power/power_button_observer.h" 5 #include "chrome/browser/chromeos/power/power_button_observer.h"
6 6
7 #include "ash/common/system/tray/system_tray_delegate.h" 7 #include "ash/common/system/tray/system_tray_delegate.h"
8 #include "ash/common/wm_shell.h"
8 #include "ash/shell.h" 9 #include "ash/shell.h"
9 #include "ash/system/user/login_status.h" 10 #include "ash/system/user/login_status.h"
10 #include "ash/wm/power_button_controller.h" 11 #include "ash/wm/power_button_controller.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 14 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
14 #include "chrome/browser/chromeos/power/session_state_controller_delegate_chrome os.h" 15 #include "chrome/browser/chromeos/power/session_state_controller_delegate_chrome os.h"
15 #include "chromeos/dbus/dbus_thread_manager.h" 16 #include "chromeos/dbus/dbus_thread_manager.h"
16 #include "content/public/browser/notification_service.h" 17 #include "content/public/browser/notification_service.h"
17 18
18 namespace ash { 19 namespace ash {
19 class LockStateControllerDelegate; 20 class LockStateControllerDelegate;
20 } 21 }
21 22
22 namespace chromeos { 23 namespace chromeos {
23 24
24 namespace { 25 namespace {
25 26
26 ash::LoginStatus GetCurrentLoginStatus() { 27 ash::LoginStatus GetCurrentLoginStatus() {
27 if (!ash::Shell::GetInstance()->system_tray_delegate()) 28 if (ash::WmShell::Get()->system_tray_delegate())
28 return ash::LoginStatus::NOT_LOGGED_IN; 29 return ash::WmShell::Get()->system_tray_delegate()->GetUserLoginStatus();
29 return ash::Shell::GetInstance()->system_tray_delegate()-> 30
30 GetUserLoginStatus(); 31 return ash::LoginStatus::NOT_LOGGED_IN;
31 } 32 }
32 33
33 } // namespace 34 } // namespace
34 35
35 PowerButtonObserver::PowerButtonObserver() { 36 PowerButtonObserver::PowerButtonObserver() {
36 // TODO: Remove after resolving crbug.com/452599. 37 // TODO: Remove after resolving crbug.com/452599.
37 VLOG(0) << "Creating PowerButtonObserver " << this; 38 VLOG(0) << "Creating PowerButtonObserver " << this;
38 39
39 ash::Shell::GetInstance()->lock_state_controller()->SetDelegate( 40 ash::Shell::GetInstance()->lock_state_controller()->SetDelegate(
40 std::unique_ptr<ash::LockStateControllerDelegate>( 41 std::unique_ptr<ash::LockStateControllerDelegate>(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 97 }
97 } 98 }
98 99
99 void PowerButtonObserver::PowerButtonEventReceived( 100 void PowerButtonObserver::PowerButtonEventReceived(
100 bool down, const base::TimeTicks& timestamp) { 101 bool down, const base::TimeTicks& timestamp) {
101 ash::Shell::GetInstance()->power_button_controller()-> 102 ash::Shell::GetInstance()->power_button_controller()->
102 OnPowerButtonEvent(down, timestamp); 103 OnPowerButtonEvent(down, timestamp);
103 } 104 }
104 105
105 } // namespace chromeos 106 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698