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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 #include "content/browser/media/session/media_session.h" | 63 #include "content/browser/media/session/media_session.h" |
64 #include "content/browser/message_port_message_filter.h" | 64 #include "content/browser/message_port_message_filter.h" |
65 #include "content/browser/plugin_content_origin_whitelist.h" | 65 #include "content/browser/plugin_content_origin_whitelist.h" |
66 #include "content/browser/renderer_host/render_process_host_impl.h" | 66 #include "content/browser/renderer_host/render_process_host_impl.h" |
67 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 67 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
68 #include "content/browser/renderer_host/render_view_host_impl.h" | 68 #include "content/browser/renderer_host/render_view_host_impl.h" |
69 #include "content/browser/renderer_host/render_widget_host_impl.h" | 69 #include "content/browser/renderer_host/render_widget_host_impl.h" |
70 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 70 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
71 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 71 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
72 #include "content/browser/renderer_host/text_input_manager.h" | 72 #include "content/browser/renderer_host/text_input_manager.h" |
73 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h" | 73 #include "content/browser/screen_orientation/screen_orientation_impl.h" |
74 #include "content/browser/site_instance_impl.h" | 74 #include "content/browser/site_instance_impl.h" |
75 #include "content/browser/web_contents/web_contents_view_child_frame.h" | 75 #include "content/browser/web_contents/web_contents_view_child_frame.h" |
76 #include "content/browser/web_contents/web_contents_view_guest.h" | 76 #include "content/browser/web_contents/web_contents_view_guest.h" |
77 #include "content/browser/webui/generic_handler.h" | 77 #include "content/browser/webui/generic_handler.h" |
78 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 78 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
79 #include "content/browser/webui/web_ui_impl.h" | 79 #include "content/browser/webui/web_ui_impl.h" |
80 #include "content/common/browser_plugin/browser_plugin_constants.h" | 80 #include "content/common/browser_plugin/browser_plugin_constants.h" |
81 #include "content/common/browser_plugin/browser_plugin_messages.h" | 81 #include "content/common/browser_plugin/browser_plugin_messages.h" |
82 #include "content/common/frame_messages.h" | 82 #include "content/common/frame_messages.h" |
83 #include "content/common/input_messages.h" | 83 #include "content/common/input_messages.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
95 #include "content/public/browser/guest_mode.h" | 95 #include "content/public/browser/guest_mode.h" |
96 #include "content/public/browser/invalidate_type.h" | 96 #include "content/public/browser/invalidate_type.h" |
97 #include "content/public/browser/javascript_dialog_manager.h" | 97 #include "content/public/browser/javascript_dialog_manager.h" |
98 #include "content/public/browser/load_notification_details.h" | 98 #include "content/public/browser/load_notification_details.h" |
99 #include "content/public/browser/navigation_details.h" | 99 #include "content/public/browser/navigation_details.h" |
100 #include "content/public/browser/notification_details.h" | 100 #include "content/public/browser/notification_details.h" |
101 #include "content/public/browser/notification_service.h" | 101 #include "content/public/browser/notification_service.h" |
102 #include "content/public/browser/notification_types.h" | 102 #include "content/public/browser/notification_types.h" |
103 #include "content/public/browser/render_widget_host_iterator.h" | 103 #include "content/public/browser/render_widget_host_iterator.h" |
104 #include "content/public/browser/resource_request_details.h" | 104 #include "content/public/browser/resource_request_details.h" |
105 #include "content/public/browser/screen_orientation_dispatcher_host.h" | 105 #include "content/public/browser/screen_orientation_provider.h" |
106 #include "content/public/browser/security_style_explanations.h" | 106 #include "content/public/browser/security_style_explanations.h" |
107 #include "content/public/browser/storage_partition.h" | 107 #include "content/public/browser/storage_partition.h" |
108 #include "content/public/browser/user_metrics.h" | 108 #include "content/public/browser/user_metrics.h" |
109 #include "content/public/browser/web_contents_binding_set.h" | 109 #include "content/public/browser/web_contents_binding_set.h" |
110 #include "content/public/browser/web_contents_delegate.h" | 110 #include "content/public/browser/web_contents_delegate.h" |
111 #include "content/public/browser/web_contents_unresponsive_state.h" | 111 #include "content/public/browser/web_contents_unresponsive_state.h" |
112 #include "content/public/common/bindings_policy.h" | 112 #include "content/public/common/bindings_policy.h" |
113 #include "content/public/common/browser_side_navigation_policy.h" | 113 #include "content/public/common/browser_side_navigation_policy.h" |
114 #include "content/public/common/child_process_host.h" | 114 #include "content/public/common/child_process_host.h" |
115 #include "content/public/common/content_constants.h" | 115 #include "content/public/common/content_constants.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
461 #else | 461 #else |
462 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 462 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
463 #endif | 463 #endif |
464 #if defined (ENABLE_PLUGINS) | 464 #if defined (ENABLE_PLUGINS) |
465 pepper_playback_observer_.reset(new PepperPlaybackObserver(this)); | 465 pepper_playback_observer_.reset(new PepperPlaybackObserver(this)); |
466 #endif | 466 #endif |
467 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); | 467 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); |
468 wake_lock_service_context_.reset(new device::WakeLockServiceContext( | 468 wake_lock_service_context_.reset(new device::WakeLockServiceContext( |
469 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 469 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
470 base::Bind(&WebContentsImpl::GetNativeView, base::Unretained(this)))); | 470 base::Bind(&WebContentsImpl::GetNativeView, base::Unretained(this)))); |
471 screen_orientation_.reset(new ScreenOrientationImpl(this)); | |
471 } | 472 } |
472 | 473 |
473 WebContentsImpl::~WebContentsImpl() { | 474 WebContentsImpl::~WebContentsImpl() { |
474 is_being_destroyed_ = true; | 475 is_being_destroyed_ = true; |
475 | 476 |
476 rwh_input_event_router_.reset(); | 477 rwh_input_event_router_.reset(); |
477 | 478 |
478 for (auto& entry : binding_sets_) | 479 for (auto& entry : binding_sets_) |
479 entry.second->CloseAllBindings(); | 480 entry.second->CloseAllBindings(); |
480 | 481 |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1579 | 1580 |
1580 #if defined(ENABLE_PLUGINS) | 1581 #if defined(ENABLE_PLUGINS) |
1581 plugin_content_origin_whitelist_.reset( | 1582 plugin_content_origin_whitelist_.reset( |
1582 new PluginContentOriginWhitelist(this)); | 1583 new PluginContentOriginWhitelist(this)); |
1583 #endif | 1584 #endif |
1584 | 1585 |
1585 registrar_.Add(this, | 1586 registrar_.Add(this, |
1586 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, | 1587 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, |
1587 NotificationService::AllBrowserContextsAndSources()); | 1588 NotificationService::AllBrowserContextsAndSources()); |
1588 | 1589 |
1589 screen_orientation_dispatcher_host_.reset( | |
blundell
2016/10/21 18:16:31
Is there a reason that you moved where this object
lunalu1
2016/10/24 16:57:36
Done.
| |
1590 new ScreenOrientationDispatcherHostImpl(this)); | |
1591 | |
1592 manifest_manager_host_.reset(new ManifestManagerHost(this)); | 1590 manifest_manager_host_.reset(new ManifestManagerHost(this)); |
1593 | 1591 |
1594 #if defined(OS_ANDROID) | 1592 #if defined(OS_ANDROID) |
1595 date_time_chooser_.reset(new DateTimeChooserAndroid()); | 1593 date_time_chooser_.reset(new DateTimeChooserAndroid()); |
1596 #endif | 1594 #endif |
1597 | 1595 |
1598 // BrowserPluginGuest::Init needs to be called after this WebContents has | 1596 // BrowserPluginGuest::Init needs to be called after this WebContents has |
1599 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above. | 1597 // a RenderWidgetHostViewGuest. That is, |view_->CreateView| above. |
1600 if (browser_plugin_guest_) | 1598 if (browser_plugin_guest_) |
1601 browser_plugin_guest_->Init(); | 1599 browser_plugin_guest_->Init(); |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2391 | 2389 |
2392 device::GeolocationServiceContext* | 2390 device::GeolocationServiceContext* |
2393 WebContentsImpl::GetGeolocationServiceContext() { | 2391 WebContentsImpl::GetGeolocationServiceContext() { |
2394 return geolocation_service_context_.get(); | 2392 return geolocation_service_context_.get(); |
2395 } | 2393 } |
2396 | 2394 |
2397 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { | 2395 device::WakeLockServiceContext* WebContentsImpl::GetWakeLockServiceContext() { |
2398 return wake_lock_service_context_.get(); | 2396 return wake_lock_service_context_.get(); |
2399 } | 2397 } |
2400 | 2398 |
2399 ScreenOrientationImpl* WebContentsImpl::GetScreenOrientation() { | |
2400 return screen_orientation_.get(); | |
2401 } | |
2402 | |
2401 void WebContentsImpl::OnShowValidationMessage( | 2403 void WebContentsImpl::OnShowValidationMessage( |
2402 const gfx::Rect& anchor_in_root_view, | 2404 const gfx::Rect& anchor_in_root_view, |
2403 const base::string16& main_text, | 2405 const base::string16& main_text, |
2404 const base::string16& sub_text) { | 2406 const base::string16& sub_text) { |
2405 if (delegate_) | 2407 if (delegate_) |
2406 delegate_->ShowValidationMessage( | 2408 delegate_->ShowValidationMessage( |
2407 this, anchor_in_root_view, main_text, sub_text); | 2409 this, anchor_in_root_view, main_text, sub_text); |
2408 } | 2410 } |
2409 | 2411 |
2410 void WebContentsImpl::OnHideValidationMessage() { | 2412 void WebContentsImpl::OnHideValidationMessage() { |
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5188 dialog_manager_ = dialog_manager; | 5190 dialog_manager_ = dialog_manager; |
5189 } | 5191 } |
5190 | 5192 |
5191 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5193 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
5192 auto it = binding_sets_.find(interface_name); | 5194 auto it = binding_sets_.find(interface_name); |
5193 if (it != binding_sets_.end()) | 5195 if (it != binding_sets_.end()) |
5194 binding_sets_.erase(it); | 5196 binding_sets_.erase(it); |
5195 } | 5197 } |
5196 | 5198 |
5197 } // namespace content | 5199 } // namespace content |
OLD | NEW |