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

Unified Diff: chrome/browser/chromeos/system/screen_locker_settings.cc

Issue 8573025: chromeos: Move EnableScreenLock to PowerManagerClient from PowerLibrary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed power_manager_client.cc from patch Created 9 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/system/screen_locker_settings.cc
diff --git a/chrome/browser/chromeos/system/screen_locker_settings.cc b/chrome/browser/chromeos/system/screen_locker_settings.cc
new file mode 100644
index 0000000000000000000000000000000000000000..32e03b0a313b07e0ff55088859f07a87bc2184d2
--- /dev/null
+++ b/chrome/browser/chromeos/system/screen_locker_settings.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 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/system/touchpad_settings.h"
+
+#include "base/bind.h"
+#include "base/file_path.h"
+#include "base/file_util.h"
+#include "base/stringprintf.h"
+#include "chrome/browser/chromeos/system/runtime_environment.h"
+#include "content/public/browser/browser_thread.h"
+
+using content::BrowserThread;
+
+namespace {
+
+const char kLockOnIdleSuspendPath[] =
+ "/var/lib/power_manager/lock_on_idle_suspend";
+
+} // namespace
+
+namespace chromeos {
+namespace system {
+namespace screen_locker_settings {
+
+void EnableScreenLock(bool enable) {
+ // Run this on the FILE thread.
+ if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) {
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&EnableScreenLock, enable));
satorux1 2011/11/16 23:58:04 Please don't be call itself. Please create a separ
satorux1 2011/11/16 23:59:15 Please also be sure to put DCHECK(BrowserThread::
Simon Que 2011/11/18 18:56:08 Done.
Simon Que 2011/11/18 18:56:08 Done.
+ return;
+ }
+
+ std::string config = base::StringPrintf("%d", enable);
+ file_util::WriteFile(FilePath(kLockOnIdleSuspendPath),
satorux1 2011/11/16 23:58:04 We shouldn't write this file on linux desktop. Ple
Simon Que 2011/11/18 18:56:08 Done.
+ config.c_str(),
+ config.size());
+}
+
+} // namespace screen_locker_settings
+} // namespace system
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698