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 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2630 | 2630 |
2631 device::mojom::WakeLockService* WebContentsImpl::GetRendererWakeLock() { | 2631 device::mojom::WakeLockService* WebContentsImpl::GetRendererWakeLock() { |
2632 // WebContents creates a long-lived connection to one WakeLockServiceImpl. | 2632 // WebContents creates a long-lived connection to one WakeLockServiceImpl. |
2633 // All the frames' requests will be added into the BindingSet of | 2633 // All the frames' requests will be added into the BindingSet of |
2634 // WakeLockServiceImpl via this connection. | 2634 // WakeLockServiceImpl via this connection. |
2635 if (!renderer_wake_lock_) { | 2635 if (!renderer_wake_lock_) { |
2636 device::mojom::WakeLockContext* wake_lock_context = GetWakeLockContext(); | 2636 device::mojom::WakeLockContext* wake_lock_context = GetWakeLockContext(); |
2637 if (!wake_lock_context) { | 2637 if (!wake_lock_context) { |
2638 return nullptr; | 2638 return nullptr; |
2639 } | 2639 } |
2640 wake_lock_context->GetWakeLock(mojo::MakeRequest(&renderer_wake_lock_)); | 2640 wake_lock_context->GetWakeLock( |
| 2641 device::mojom::WakeLockType::PreventDisplaySleep, |
| 2642 device::mojom::WakeLockReason::ReasonOther, "Wake Lock API", |
| 2643 mojo::MakeRequest(&renderer_wake_lock_)); |
2641 } | 2644 } |
2642 return renderer_wake_lock_.get(); | 2645 return renderer_wake_lock_.get(); |
2643 } | 2646 } |
2644 | 2647 |
2645 void WebContentsImpl::OnShowValidationMessage( | 2648 void WebContentsImpl::OnShowValidationMessage( |
2646 RenderViewHostImpl* source, | 2649 RenderViewHostImpl* source, |
2647 const gfx::Rect& anchor_in_root_view, | 2650 const gfx::Rect& anchor_in_root_view, |
2648 const base::string16& main_text, | 2651 const base::string16& main_text, |
2649 const base::string16& sub_text) { | 2652 const base::string16& sub_text) { |
2650 // TODO(nick): Should we consider |source| here or pass it to the delegate? | 2653 // TODO(nick): Should we consider |source| here or pass it to the delegate? |
(...skipping 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5616 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5619 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
5617 if (!render_view_host) | 5620 if (!render_view_host) |
5618 continue; | 5621 continue; |
5619 render_view_host_set.insert(render_view_host); | 5622 render_view_host_set.insert(render_view_host); |
5620 } | 5623 } |
5621 for (RenderViewHost* render_view_host : render_view_host_set) | 5624 for (RenderViewHost* render_view_host : render_view_host_set) |
5622 render_view_host->OnWebkitPreferencesChanged(); | 5625 render_view_host->OnWebkitPreferencesChanged(); |
5623 } | 5626 } |
5624 | 5627 |
5625 } // namespace content | 5628 } // namespace content |
OLD | NEW |