| 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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 } | 915 } |
| 916 | 916 |
| 917 RenderWidgetHostView* WebContentsImpl::GetTopLevelRenderWidgetHostView() { | 917 RenderWidgetHostView* WebContentsImpl::GetTopLevelRenderWidgetHostView() { |
| 918 if (GetOuterWebContents()) | 918 if (GetOuterWebContents()) |
| 919 return GetOuterWebContents()->GetTopLevelRenderWidgetHostView(); | 919 return GetOuterWebContents()->GetTopLevelRenderWidgetHostView(); |
| 920 return GetRenderManager()->GetRenderWidgetHostView(); | 920 return GetRenderManager()->GetRenderWidgetHostView(); |
| 921 } | 921 } |
| 922 | 922 |
| 923 RenderWidgetHostView* WebContentsImpl::GetFullscreenRenderWidgetHostView() | 923 RenderWidgetHostView* WebContentsImpl::GetFullscreenRenderWidgetHostView() |
| 924 const { | 924 const { |
| 925 RenderWidgetHost* const widget_host = | 925 if (auto widget_host = GetFullscreenRenderWidgetHost()) |
| 926 RenderWidgetHostImpl::FromID(fullscreen_widget_process_id_, | 926 return widget_host->GetView(); |
| 927 fullscreen_widget_routing_id_); | 927 return nullptr; |
| 928 return widget_host ? widget_host->GetView() : NULL; | |
| 929 } | 928 } |
| 930 | 929 |
| 931 WebContentsView* WebContentsImpl::GetView() const { | 930 WebContentsView* WebContentsImpl::GetView() const { |
| 932 return view_.get(); | 931 return view_.get(); |
| 933 } | 932 } |
| 934 | 933 |
| 935 SkColor WebContentsImpl::GetThemeColor() const { | 934 SkColor WebContentsImpl::GetThemeColor() const { |
| 936 return theme_color_; | 935 return theme_color_; |
| 937 } | 936 } |
| 938 | 937 |
| (...skipping 4142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5081 return capturer_count_ == 0 && !should_normally_be_visible_; | 5080 return capturer_count_ == 0 && !should_normally_be_visible_; |
| 5082 } | 5081 } |
| 5083 | 5082 |
| 5084 int WebContentsImpl::GetOuterDelegateFrameTreeNodeId() { | 5083 int WebContentsImpl::GetOuterDelegateFrameTreeNodeId() { |
| 5085 if (node_ && node_->outer_web_contents()) | 5084 if (node_ && node_->outer_web_contents()) |
| 5086 return node_->outer_contents_frame_tree_node_id(); | 5085 return node_->outer_contents_frame_tree_node_id(); |
| 5087 | 5086 |
| 5088 return FrameTreeNode::kFrameTreeNodeInvalidId; | 5087 return FrameTreeNode::kFrameTreeNodeInvalidId; |
| 5089 } | 5088 } |
| 5090 | 5089 |
| 5090 RenderWidgetHostImpl* WebContentsImpl::GetFullscreenRenderWidgetHost() const { |
| 5091 return RenderWidgetHostImpl::FromID(fullscreen_widget_process_id_, |
| 5092 fullscreen_widget_routing_id_); |
| 5093 } |
| 5094 |
| 5091 RenderFrameHostManager* WebContentsImpl::GetRenderManager() const { | 5095 RenderFrameHostManager* WebContentsImpl::GetRenderManager() const { |
| 5092 return frame_tree_.root()->render_manager(); | 5096 return frame_tree_.root()->render_manager(); |
| 5093 } | 5097 } |
| 5094 | 5098 |
| 5095 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { | 5099 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() const { |
| 5096 return browser_plugin_guest_.get(); | 5100 return browser_plugin_guest_.get(); |
| 5097 } | 5101 } |
| 5098 | 5102 |
| 5099 void WebContentsImpl::SetBrowserPluginGuest(BrowserPluginGuest* guest) { | 5103 void WebContentsImpl::SetBrowserPluginGuest(BrowserPluginGuest* guest) { |
| 5100 CHECK(!browser_plugin_guest_); | 5104 CHECK(!browser_plugin_guest_); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5267 dialog_manager_ = dialog_manager; | 5271 dialog_manager_ = dialog_manager; |
| 5268 } | 5272 } |
| 5269 | 5273 |
| 5270 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5274 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
| 5271 auto it = binding_sets_.find(interface_name); | 5275 auto it = binding_sets_.find(interface_name); |
| 5272 if (it != binding_sets_.end()) | 5276 if (it != binding_sets_.end()) |
| 5273 binding_sets_.erase(it); | 5277 binding_sets_.erase(it); |
| 5274 } | 5278 } |
| 5275 | 5279 |
| 5276 } // namespace content | 5280 } // namespace content |
| OLD | NEW |