| 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2635 WebContentsImpl::GetGeolocationServiceContext() { | 2635 WebContentsImpl::GetGeolocationServiceContext() { |
| 2636 return geolocation_service_context_.get(); | 2636 return geolocation_service_context_.get(); |
| 2637 } | 2637 } |
| 2638 | 2638 |
| 2639 device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockContext() { | 2639 device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockContext() { |
| 2640 if (!wake_lock_context_host_) | 2640 if (!wake_lock_context_host_) |
| 2641 wake_lock_context_host_.reset(new WakeLockContextHost(this)); | 2641 wake_lock_context_host_.reset(new WakeLockContextHost(this)); |
| 2642 return wake_lock_context_host_->GetWakeLockContext(); | 2642 return wake_lock_context_host_->GetWakeLockContext(); |
| 2643 } | 2643 } |
| 2644 | 2644 |
| 2645 device::mojom::WakeLockService* WebContentsImpl::GetRendererWakeLock() { | 2645 device::mojom::WakeLock* WebContentsImpl::GetRendererWakeLock() { |
| 2646 // WebContents creates a long-lived connection to one WakeLockServiceImpl. | 2646 // WebContents creates a long-lived connection to one WakeLock. |
| 2647 // All the frames' requests will be added into the BindingSet of | 2647 // All the frames' requests will be added into the BindingSet of |
| 2648 // WakeLockServiceImpl via this connection. | 2648 // WakeLock via this connection. |
| 2649 if (!renderer_wake_lock_) { | 2649 if (!renderer_wake_lock_) { |
| 2650 device::mojom::WakeLockContext* wake_lock_context = GetWakeLockContext(); | 2650 device::mojom::WakeLockContext* wake_lock_context = GetWakeLockContext(); |
| 2651 if (!wake_lock_context) { | 2651 if (!wake_lock_context) { |
| 2652 return nullptr; | 2652 return nullptr; |
| 2653 } | 2653 } |
| 2654 wake_lock_context->GetWakeLock( | 2654 wake_lock_context->GetWakeLock( |
| 2655 device::mojom::WakeLockType::PreventDisplaySleep, | 2655 device::mojom::WakeLockType::PreventDisplaySleep, |
| 2656 device::mojom::WakeLockReason::ReasonOther, "Wake Lock API", | 2656 device::mojom::WakeLockReason::ReasonOther, "Wake Lock API", |
| 2657 mojo::MakeRequest(&renderer_wake_lock_)); | 2657 mojo::MakeRequest(&renderer_wake_lock_)); |
| 2658 } | 2658 } |
| (...skipping 3029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5688 new_root->SetOriginalOpener(opener->frame_tree()->root()); | 5688 new_root->SetOriginalOpener(opener->frame_tree()->root()); |
| 5689 | 5689 |
| 5690 if (!opener_suppressed) { | 5690 if (!opener_suppressed) { |
| 5691 new_root->SetOpener(opener); | 5691 new_root->SetOpener(opener); |
| 5692 created_with_opener_ = true; | 5692 created_with_opener_ = true; |
| 5693 } | 5693 } |
| 5694 } | 5694 } |
| 5695 } | 5695 } |
| 5696 | 5696 |
| 5697 } // namespace content | 5697 } // namespace content |
| OLD | NEW |