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 "content/browser/wake_lock/wake_lock_service_context.h" | 5 #include "content/browser/wake_lock/wake_lock_service_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "build/build_config.h" |
8 #include "content/browser/power_save_blocker_impl.h" | 9 #include "content/browser/power_save_blocker_impl.h" |
9 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/browser/power_save_blocker.h" | 11 #include "content/public/browser/power_save_blocker.h" |
11 #include "content/public/browser/render_frame_host.h" | 12 #include "content/public/browser/render_frame_host.h" |
12 #include "content/public/browser/render_process_host.h" | 13 #include "content/public/browser/render_process_host.h" |
13 #include "content/public/common/service_registry.h" | 14 #include "content/public/common/service_registry.h" |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 WakeLockServiceContext::WakeLockServiceContext(WebContents* web_contents) | 18 WakeLockServiceContext::WakeLockServiceContext(WebContents* web_contents) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (!frames_requesting_lock_.empty()) { | 82 if (!frames_requesting_lock_.empty()) { |
82 if (!wake_lock_) | 83 if (!wake_lock_) |
83 CreateWakeLock(); | 84 CreateWakeLock(); |
84 } else { | 85 } else { |
85 if (wake_lock_) | 86 if (wake_lock_) |
86 RemoveWakeLock(); | 87 RemoveWakeLock(); |
87 } | 88 } |
88 } | 89 } |
89 | 90 |
90 } // namespace content | 91 } // namespace content |
OLD | NEW |