Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/screen_dimming_observer.h" | 5 #include "chrome/browser/chromeos/power/screen_dimming_observer.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | |
| 7 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 8 #include "ash/wm/screen_dimmer.h" | 9 #include "ash/wm/screen_dimmer.h" |
| 9 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
| 10 | 11 |
| 11 namespace chromeos { | 12 namespace chromeos { |
| 12 | 13 |
| 13 ScreenDimmingObserver::ScreenDimmingObserver() { | 14 ScreenDimmingObserver::ScreenDimmingObserver() { |
| 14 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); | 15 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); |
| 15 } | 16 } |
| 16 | 17 |
| 17 ScreenDimmingObserver::~ScreenDimmingObserver() { | 18 ScreenDimmingObserver::~ScreenDimmingObserver() { |
| 18 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); | 19 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); |
| 19 } | 20 } |
| 20 | 21 |
| 21 void ScreenDimmingObserver::ScreenDimmingRequested(ScreenDimmingState state) { | 22 void ScreenDimmingObserver::ScreenDimmingRequested(ScreenDimmingState state) { |
| 22 ash::Shell::GetInstance()->screen_dimmer()->SetDimming( | 23 ash::Shell::GetPrimaryRootWindowController()->screen_dimmer()->SetDimming( |
|
oshima
2012/06/13 00:46:09
Oops, I was going to define Shell::SetDimming. Ple
| |
| 23 state == PowerManagerClient::Observer::SCREEN_DIMMING_IDLE); | 24 state == PowerManagerClient::Observer::SCREEN_DIMMING_IDLE); |
| 24 } | 25 } |
| 25 | 26 |
| 26 } // namespace chromeos | 27 } // namespace chromeos |
| OLD | NEW |