Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
index da1c2b50f824061fe8431b3c1b5a96837cdfd4df..598fccbf65c3ddbc2abfa4bde8e28ab760677c0a 100644 |
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
@@ -132,6 +132,11 @@ namespace chromeos { |
namespace { |
+// TODO(chirantan): These are used by a temporary workaround for lucid sleep and |
+// should be removed once the proper implementation is ready (crbug.com/414949). |
+const char kDarkResumeAlwaysFile[] = "/sys/power/dark_resume_always"; |
+const char kEnableDarkResumeAlways[] = "1"; |
+ |
void ChromeOSVersionCallback(const std::string& version) { |
base::SetLinuxDistro(std::string("CrOS ") + version); |
} |
@@ -566,9 +571,22 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() { |
renderer_freezer_.reset( |
new RendererFreezer(scoped_ptr<RendererFreezer::Delegate>( |
new FreezerCgroupProcessManager()))); |
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets)) |
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets)) { |
light_bar_.reset(new LightBar()); |
+ // Until the kernel can properly detect the wakeup source, we need to use a |
+ // hack to tell the kernel to always enter dark resume. Chrome can then |
+ // detect any user activity and have the power manager transition out of |
+ // dark resume into regular resume. We don't care if the write succeeds or |
+ // not because most devices will not have this file. |
+ // |
+ // TODO(chirantan): Remove this once we can properly detect the wakeup |
+ // source (crbug.com/414949). |
+ base::WriteFile(base::FilePath(kDarkResumeAlwaysFile), |
Daniel Erat
2014/09/21 14:49:31
can you put this somewhere else instead of chrome_
|
+ kEnableDarkResumeAlways, |
+ strlen(kEnableDarkResumeAlways)); |
+ } |
+ |
g_browser_process->platform_part()->InitializeAutomaticRebootManager(); |
// This observer cannot be created earlier because it requires the shell to be |