Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |