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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2011 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/system/touchpad_settings.h"
6
7 #include "base/bind.h"
8 #include "base/file_path.h"
9 #include "base/file_util.h"
10 #include "base/stringprintf.h"
11 #include "chrome/browser/chromeos/system/runtime_environment.h"
12 #include "content/public/browser/browser_thread.h"
13
14 using content::BrowserThread;
15
16 namespace {
17
18 const char kLockOnIdleSuspendPath[] =
19 "/var/lib/power_manager/lock_on_idle_suspend";
20
21 } // namespace
22
23 namespace chromeos {
24 namespace system {
25 namespace screen_locker_settings {
26
27 void EnableScreenLock(bool enable) {
28 // Run this on the FILE thread.
29 if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) {
30 BrowserThread::PostTask(
31 BrowserThread::FILE, FROM_HERE,
32 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.
33 return;
34 }
35
36 std::string config = base::StringPrintf("%d", enable);
37 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.
38 config.c_str(),
39 config.size());
40 }
41
42 } // namespace screen_locker_settings
43 } // namespace system
44 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698