| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/sequenced_task_runner.h" |
| 12 #include "jni/PowerSaveBlocker_jni.h" | 13 #include "jni/PowerSaveBlocker_jni.h" |
| 13 #include "ui/android/view_android.h" | 14 #include "ui/android/view_android.h" |
| 14 | 15 |
| 15 namespace device { | 16 namespace device { |
| 16 | 17 |
| 17 using base::android::AttachCurrentThread; | 18 using base::android::AttachCurrentThread; |
| 18 using base::android::ScopedJavaLocalRef; | 19 using base::android::ScopedJavaLocalRef; |
| 19 | 20 |
| 20 class PowerSaveBlocker::Delegate | 21 class PowerSaveBlocker::Delegate |
| 21 : public base::RefCountedThreadSafe<PowerSaveBlocker::Delegate> { | 22 : public base::RefCountedThreadSafe<PowerSaveBlocker::Delegate> { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 86 |
| 86 void PowerSaveBlocker::InitDisplaySleepBlocker(ui::ViewAndroid* view_android) { | 87 void PowerSaveBlocker::InitDisplaySleepBlocker(ui::ViewAndroid* view_android) { |
| 87 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); | 88 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); |
| 88 DCHECK(view_android); | 89 DCHECK(view_android); |
| 89 | 90 |
| 90 delegate_ = new Delegate(ui_task_runner_); | 91 delegate_ = new Delegate(ui_task_runner_); |
| 91 delegate_->ApplyBlock(view_android); | 92 delegate_->ApplyBlock(view_android); |
| 92 } | 93 } |
| 93 | 94 |
| 94 } // namespace device | 95 } // namespace device |
| OLD | NEW |