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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc
diff --git a/chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc b/chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8382874f6763ebde6af45c4085b08238007ec0b1
--- /dev/null
+++ b/chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.cc
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/dbus/chrome_display_power_service_provider_delegate.h"
+
+#include "ash/shell.h"
+#include "ui/display/chromeos/display_configurator.h"
+#include "ui/wm/core/user_activity_detector.h"
+
+namespace chromeos {
+
+ChromeDisplayPowerServiceProviderDelegate::
+ChromeDisplayPowerServiceProviderDelegate() {
+}
+
+ChromeDisplayPowerServiceProviderDelegate::
+~ChromeDisplayPowerServiceProviderDelegate() {
+}
+
+void ChromeDisplayPowerServiceProviderDelegate::SetDisplayPower(
+ DisplayPowerState power_state) {
+ // Turning displays off when the device becomes idle or on just before
+ // we suspend may trigger a mouse move, which would then be incorrectly
+ // reported as user activity. Let the UserActivityDetector
+ // know so that it can ignore such events.
+ wm::UserActivityDetector::Get()->OnDisplayPowerChanging();
+
+ ash::Shell::GetInstance()->display_configurator()->SetDisplayPower(
+ power_state, ui::DisplayConfigurator::kSetDisplayPowerNoFlags);
+}
+
+void ChromeDisplayPowerServiceProviderDelegate::SetDimming(bool dimmed) {
+ ash::Shell::GetInstance()->SetDimming(dimmed);
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698