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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #include "content/public/browser/notification_details.h" | 98 #include "content/public/browser/notification_details.h" |
99 #include "content/public/browser/notification_service.h" | 99 #include "content/public/browser/notification_service.h" |
100 #include "content/public/browser/notification_types.h" | 100 #include "content/public/browser/notification_types.h" |
101 #include "content/public/browser/render_widget_host_iterator.h" | 101 #include "content/public/browser/render_widget_host_iterator.h" |
102 #include "content/public/browser/resource_request_details.h" | 102 #include "content/public/browser/resource_request_details.h" |
103 #include "content/public/browser/screen_orientation_dispatcher_host.h" | 103 #include "content/public/browser/screen_orientation_dispatcher_host.h" |
104 #include "content/public/browser/security_style_explanations.h" | 104 #include "content/public/browser/security_style_explanations.h" |
105 #include "content/public/browser/storage_partition.h" | 105 #include "content/public/browser/storage_partition.h" |
106 #include "content/public/browser/user_metrics.h" | 106 #include "content/public/browser/user_metrics.h" |
107 #include "content/public/browser/web_contents_delegate.h" | 107 #include "content/public/browser/web_contents_delegate.h" |
| 108 #include "content/public/browser/web_contents_interface_registry.h" |
108 #include "content/public/common/bindings_policy.h" | 109 #include "content/public/common/bindings_policy.h" |
109 #include "content/public/common/browser_plugin_guest_mode.h" | 110 #include "content/public/common/browser_plugin_guest_mode.h" |
110 #include "content/public/common/browser_side_navigation_policy.h" | 111 #include "content/public/common/browser_side_navigation_policy.h" |
111 #include "content/public/common/child_process_host.h" | 112 #include "content/public/common/child_process_host.h" |
112 #include "content/public/common/content_constants.h" | 113 #include "content/public/common/content_constants.h" |
113 #include "content/public/common/content_switches.h" | 114 #include "content/public/common/content_switches.h" |
114 #include "content/public/common/page_zoom.h" | 115 #include "content/public/common/page_zoom.h" |
115 #include "content/public/common/result_codes.h" | 116 #include "content/public/common/result_codes.h" |
116 #include "content/public/common/url_constants.h" | 117 #include "content/public/common/url_constants.h" |
117 #include "content/public/common/url_utils.h" | 118 #include "content/public/common/url_utils.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 << "Only the outermost WebContents tracks focus."; | 383 << "Only the outermost WebContents tracks focus."; |
383 focused_web_contents_ = web_contents; | 384 focused_web_contents_ = web_contents; |
384 } | 385 } |
385 | 386 |
386 // WebContentsImpl ------------------------------------------------------------- | 387 // WebContentsImpl ------------------------------------------------------------- |
387 | 388 |
388 WebContentsImpl::WebContentsImpl(BrowserContext* browser_context) | 389 WebContentsImpl::WebContentsImpl(BrowserContext* browser_context) |
389 : delegate_(NULL), | 390 : delegate_(NULL), |
390 controller_(this, browser_context), | 391 controller_(this, browser_context), |
391 render_view_host_delegate_view_(NULL), | 392 render_view_host_delegate_view_(NULL), |
| 393 interfaces_(this), |
392 created_with_opener_(false), | 394 created_with_opener_(false), |
393 frame_tree_(new NavigatorImpl(&controller_, this), | 395 frame_tree_(new NavigatorImpl(&controller_, this), |
394 this, | 396 this, |
395 this, | 397 this, |
396 this, | 398 this, |
397 this), | 399 this), |
398 is_load_to_different_document_(false), | 400 is_load_to_different_document_(false), |
399 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 401 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
400 crashed_error_code_(0), | 402 crashed_error_code_(0), |
401 waiting_for_response_(false), | 403 waiting_for_response_(false), |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 if (view_) | 814 if (view_) |
813 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 815 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
814 } | 816 } |
815 } | 817 } |
816 | 818 |
817 RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { | 819 RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { |
818 RenderViewHostImpl* host = GetRenderManager()->current_host(); | 820 RenderViewHostImpl* host = GetRenderManager()->current_host(); |
819 return host ? host->GetProcess() : NULL; | 821 return host ? host->GetProcess() : NULL; |
820 } | 822 } |
821 | 823 |
| 824 WebContentsInterfaceRegistry* WebContentsImpl::GetInterfaces() { |
| 825 return &interfaces_; |
| 826 } |
| 827 |
822 RenderFrameHostImpl* WebContentsImpl::GetMainFrame() { | 828 RenderFrameHostImpl* WebContentsImpl::GetMainFrame() { |
823 return frame_tree_.root()->current_frame_host(); | 829 return frame_tree_.root()->current_frame_host(); |
824 } | 830 } |
825 | 831 |
826 RenderFrameHostImpl* WebContentsImpl::GetFocusedFrame() { | 832 RenderFrameHostImpl* WebContentsImpl::GetFocusedFrame() { |
827 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); | 833 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); |
828 if (!focused_node) | 834 if (!focused_node) |
829 return nullptr; | 835 return nullptr; |
830 return focused_node->current_frame_host(); | 836 return focused_node->current_frame_host(); |
831 } | 837 } |
(...skipping 4373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5205 for (RenderViewHost* render_view_host : render_view_host_set) | 5211 for (RenderViewHost* render_view_host : render_view_host_set) |
5206 render_view_host->OnWebkitPreferencesChanged(); | 5212 render_view_host->OnWebkitPreferencesChanged(); |
5207 } | 5213 } |
5208 | 5214 |
5209 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 5215 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
5210 JavaScriptDialogManager* dialog_manager) { | 5216 JavaScriptDialogManager* dialog_manager) { |
5211 dialog_manager_ = dialog_manager; | 5217 dialog_manager_ = dialog_manager; |
5212 } | 5218 } |
5213 | 5219 |
5214 } // namespace content | 5220 } // namespace content |
OLD | NEW |