OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/power_save_blocker/power_save_blocker.h" | 5 #include "device/power_save_blocker/power_save_blocker.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void PowerSaveBlocker::InitDisplaySleepBlocker( | 91 void PowerSaveBlocker::InitDisplaySleepBlocker( |
92 const base::WeakPtr<ui::ViewAndroid>& view_android) { | 92 const base::WeakPtr<ui::ViewAndroid>& view_android) { |
93 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); | 93 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); |
94 if (!view_android) | 94 if (!view_android) |
95 return; | 95 return; |
96 | 96 |
97 delegate_ = new Delegate(view_android, ui_task_runner_); | 97 delegate_ = new Delegate(view_android, ui_task_runner_); |
98 delegate_->ApplyBlock(); | 98 delegate_->ApplyBlock(); |
99 } | 99 } |
100 | 100 |
101 bool RegisterPowerSaveBlocker(JNIEnv* env) { | |
102 return RegisterNativesImpl(env); | |
103 } | |
104 | |
105 } // namespace device | 101 } // namespace device |
OLD | NEW |