| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/wake_lock/wake_lock_service_context.h" | 5 #include "device/wake_lock/wake_lock_service_context.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 #include "device/power_save_blocker/power_save_blocker.h" | 13 #include "device/power_save_blocker/power_save_blocker.h" |
| 13 #include "mojo/public/cpp/bindings/strong_binding.h" | 14 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 14 | 15 |
| 15 namespace device { | 16 namespace device { |
| 16 | 17 |
| 17 WakeLockServiceContext::WakeLockServiceContext( | 18 WakeLockServiceContext::WakeLockServiceContext( |
| 18 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, | 19 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner, |
| 19 base::Callback<gfx::NativeView()> native_view_getter) | 20 base::Callback<gfx::NativeView()> native_view_getter) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 if (num_lock_requests_) { | 74 if (num_lock_requests_) { |
| 74 if (!wake_lock_) | 75 if (!wake_lock_) |
| 75 CreateWakeLock(); | 76 CreateWakeLock(); |
| 76 } else { | 77 } else { |
| 77 if (wake_lock_) | 78 if (wake_lock_) |
| 78 RemoveWakeLock(); | 79 RemoveWakeLock(); |
| 79 } | 80 } |
| 80 } | 81 } |
| 81 | 82 |
| 82 } // namespace device | 83 } // namespace device |
| OLD | NEW |