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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "content/browser/plugin_content_origin_whitelist.h" | 51 #include "content/browser/plugin_content_origin_whitelist.h" |
52 #include "content/browser/power_save_blocker_impl.h" | 52 #include "content/browser/power_save_blocker_impl.h" |
53 #include "content/browser/renderer_host/render_process_host_impl.h" | 53 #include "content/browser/renderer_host/render_process_host_impl.h" |
54 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 54 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
55 #include "content/browser/renderer_host/render_view_host_impl.h" | 55 #include "content/browser/renderer_host/render_view_host_impl.h" |
56 #include "content/browser/renderer_host/render_widget_host_impl.h" | 56 #include "content/browser/renderer_host/render_widget_host_impl.h" |
57 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 57 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
58 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 58 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
59 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" | 59 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_
impl.h" |
60 #include "content/browser/site_instance_impl.h" | 60 #include "content/browser/site_instance_impl.h" |
| 61 #include "content/browser/wake_lock/wake_lock_service_context.h" |
61 #include "content/browser/web_contents/web_contents_view_guest.h" | 62 #include "content/browser/web_contents/web_contents_view_guest.h" |
62 #include "content/browser/webui/generic_handler.h" | 63 #include "content/browser/webui/generic_handler.h" |
63 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 64 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
64 #include "content/browser/webui/web_ui_impl.h" | 65 #include "content/browser/webui/web_ui_impl.h" |
65 #include "content/common/browser_plugin/browser_plugin_constants.h" | 66 #include "content/common/browser_plugin/browser_plugin_constants.h" |
66 #include "content/common/browser_plugin/browser_plugin_messages.h" | 67 #include "content/common/browser_plugin/browser_plugin_messages.h" |
67 #include "content/common/frame_messages.h" | 68 #include "content/common/frame_messages.h" |
68 #include "content/common/input_messages.h" | 69 #include "content/common/input_messages.h" |
69 #include "content/common/site_isolation_policy.h" | 70 #include "content/common/site_isolation_policy.h" |
70 #include "content/common/ssl_status_serialization.h" | 71 #include "content/common/ssl_status_serialization.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), | 406 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()), |
406 audio_stream_monitor_(this), | 407 audio_stream_monitor_(this), |
407 virtual_keyboard_requested_(false), | 408 virtual_keyboard_requested_(false), |
408 loading_weak_factory_(this) { | 409 loading_weak_factory_(this) { |
409 frame_tree_.SetFrameRemoveListener( | 410 frame_tree_.SetFrameRemoveListener( |
410 base::Bind(&WebContentsImpl::OnFrameRemoved, | 411 base::Bind(&WebContentsImpl::OnFrameRemoved, |
411 base::Unretained(this))); | 412 base::Unretained(this))); |
412 #if defined(ENABLE_BROWSER_CDMS) | 413 #if defined(ENABLE_BROWSER_CDMS) |
413 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 414 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
414 #endif | 415 #endif |
| 416 |
| 417 wake_lock_service_context_.reset(new WakeLockServiceContext(this)); |
415 } | 418 } |
416 | 419 |
417 WebContentsImpl::~WebContentsImpl() { | 420 WebContentsImpl::~WebContentsImpl() { |
418 is_being_destroyed_ = true; | 421 is_being_destroyed_ = true; |
419 | 422 |
420 rwh_input_event_router_.reset(); | 423 rwh_input_event_router_.reset(); |
421 | 424 |
422 // Delete all RFH pending shutdown, which will lead the corresponding RVH to | 425 // Delete all RFH pending shutdown, which will lead the corresponding RVH to |
423 // shutdown and be deleted as well. | 426 // shutdown and be deleted as well. |
424 frame_tree_.ForEach( | 427 frame_tree_.ForEach( |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 if (!guest) | 2055 if (!guest) |
2053 return nullptr; | 2056 return nullptr; |
2054 | 2057 |
2055 return guest->GetMainFrame(); | 2058 return guest->GetMainFrame(); |
2056 } | 2059 } |
2057 | 2060 |
2058 GeolocationServiceContext* WebContentsImpl::GetGeolocationServiceContext() { | 2061 GeolocationServiceContext* WebContentsImpl::GetGeolocationServiceContext() { |
2059 return geolocation_service_context_.get(); | 2062 return geolocation_service_context_.get(); |
2060 } | 2063 } |
2061 | 2064 |
| 2065 WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { |
| 2066 return wake_lock_service_context_.get(); |
| 2067 } |
| 2068 |
2062 void WebContentsImpl::OnShowValidationMessage( | 2069 void WebContentsImpl::OnShowValidationMessage( |
2063 const gfx::Rect& anchor_in_root_view, | 2070 const gfx::Rect& anchor_in_root_view, |
2064 const base::string16& main_text, | 2071 const base::string16& main_text, |
2065 const base::string16& sub_text) { | 2072 const base::string16& sub_text) { |
2066 if (delegate_) | 2073 if (delegate_) |
2067 delegate_->ShowValidationMessage( | 2074 delegate_->ShowValidationMessage( |
2068 this, anchor_in_root_view, main_text, sub_text); | 2075 this, anchor_in_root_view, main_text, sub_text); |
2069 } | 2076 } |
2070 | 2077 |
2071 void WebContentsImpl::OnHideValidationMessage() { | 2078 void WebContentsImpl::OnHideValidationMessage() { |
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4627 return NULL; | 4634 return NULL; |
4628 } | 4635 } |
4629 | 4636 |
4630 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4637 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4631 force_disable_overscroll_content_ = force_disable; | 4638 force_disable_overscroll_content_ = force_disable; |
4632 if (view_) | 4639 if (view_) |
4633 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4640 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4634 } | 4641 } |
4635 | 4642 |
4636 } // namespace content | 4643 } // namespace content |
OLD | NEW |