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

Side by Side Diff: chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc

Issue 739123002: Move DisplayPowerServiceProvider to chromeos/dbus/services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698