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

Unified Diff: chrome/browser/chromeos/power/suspend_observer.cc

Issue 12036092: Implement support for monitor suspend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@git-svn
Patch Set: Fixed nits Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/power/suspend_observer.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/power/suspend_observer.cc
diff --git a/chrome/browser/chromeos/power/suspend_observer.cc b/chrome/browser/chromeos/power/suspend_observer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c203d484ed942ffe965fb0f95ee820d842685e26
--- /dev/null
+++ b/chrome/browser/chromeos/power/suspend_observer.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2013 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/power/suspend_observer.h"
+#include "chrome/browser/extensions/system/system_api.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/display/output_configurator.h"
+
+namespace chromeos {
+
+SuspendObserver::SuspendObserver() {
+ DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this);
+}
+
+SuspendObserver::~SuspendObserver() {
+ DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
+}
+
+void SuspendObserver::SuspendImminent() {
+ ash::Shell::GetInstance()->output_configurator()->SuspendDisplays();
+}
+
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/power/suspend_observer.h ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698