OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/dbus/chrome_display_power_service_provider_del
egate.h" |
| 6 |
| 7 #include "ash/shell.h" |
| 8 #include "ui/display/chromeos/display_configurator.h" |
| 9 #include "ui/wm/core/user_activity_detector.h" |
| 10 |
| 11 namespace chromeos { |
| 12 |
| 13 ChromeDisplayPowerServiceProviderDelegate:: |
| 14 ChromeDisplayPowerServiceProviderDelegate() { |
| 15 } |
| 16 |
| 17 ChromeDisplayPowerServiceProviderDelegate:: |
| 18 ~ChromeDisplayPowerServiceProviderDelegate() { |
| 19 } |
| 20 |
| 21 void ChromeDisplayPowerServiceProviderDelegate::SetDisplayPower( |
| 22 DisplayPowerState power_state) { |
| 23 // Turning displays off when the device becomes idle or on just before |
| 24 // we suspend may trigger a mouse move, which would then be incorrectly |
| 25 // reported as user activity. Let the UserActivityDetector |
| 26 // know so that it can ignore such events. |
| 27 wm::UserActivityDetector::Get()->OnDisplayPowerChanging(); |
| 28 |
| 29 ash::Shell::GetInstance()->display_configurator()->SetDisplayPower( |
| 30 power_state, ui::DisplayConfigurator::kSetDisplayPowerNoFlags); |
| 31 } |
| 32 |
| 33 void ChromeDisplayPowerServiceProviderDelegate::SetDimming(bool dimmed) { |
| 34 ash::Shell::GetInstance()->SetDimming(dimmed); |
| 35 } |
| 36 |
| 37 } // namespace chromeos |
OLD | NEW |