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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 3061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3072 WebContents* new_contents = NULL; | 3072 WebContents* new_contents = NULL; |
3073 GURL dest_url(url); | 3073 GURL dest_url(url); |
3074 if (!GetContentClient()->browser()->ShouldAllowOpenURL( | 3074 if (!GetContentClient()->browser()->ShouldAllowOpenURL( |
3075 GetSiteInstance(), url)) | 3075 GetSiteInstance(), url)) |
3076 dest_url = GURL(kAboutBlankURL); | 3076 dest_url = GURL(kAboutBlankURL); |
3077 | 3077 |
3078 // Look up the FrameTreeNode ID corresponding to source_frame_id. | 3078 // Look up the FrameTreeNode ID corresponding to source_frame_id. |
3079 int64 frame_tree_node_id = -1; | 3079 int64 frame_tree_node_id = -1; |
3080 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && | 3080 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) && |
3081 source_frame_id != -1) { | 3081 source_frame_id != -1) { |
3082 FrameTreeNode* source_node = frame_tree_.FindByFrameID(source_frame_id); | 3082 FrameTreeNode* source_node = frame_tree_.FindByRoutingID( |
| 3083 source_frame_id, old_request_id.child_id); |
3083 if (source_node) | 3084 if (source_node) |
3084 frame_tree_node_id = source_node->frame_tree_node_id(); | 3085 frame_tree_node_id = source_node->frame_tree_node_id(); |
3085 } | 3086 } |
3086 OpenURLParams params(dest_url, referrer, source_frame_id, | 3087 OpenURLParams params(dest_url, referrer, source_frame_id, |
3087 frame_tree_node_id, disposition, | 3088 frame_tree_node_id, disposition, |
3088 page_transition, true /* is_renderer_initiated */); | 3089 page_transition, true /* is_renderer_initiated */); |
3089 if (redirect_chain.size() > 0) | 3090 if (redirect_chain.size() > 0) |
3090 params.redirect_chain = redirect_chain; | 3091 params.redirect_chain = redirect_chain; |
3091 params.transferred_global_request_id = old_request_id; | 3092 params.transferred_global_request_id = old_request_id; |
3092 params.should_replace_current_entry = should_replace_current_entry; | 3093 params.should_replace_current_entry = should_replace_current_entry; |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3630 gfx::Size size; | 3631 gfx::Size size; |
3631 if (delegate_) | 3632 if (delegate_) |
3632 size = delegate_->GetSizeForNewRenderView(this); | 3633 size = delegate_->GetSizeForNewRenderView(this); |
3633 if (size.IsEmpty()) | 3634 if (size.IsEmpty()) |
3634 size = view_->GetContainerSize(); | 3635 size = view_->GetContainerSize(); |
3635 return size; | 3636 return size; |
3636 } | 3637 } |
3637 | 3638 |
3638 void WebContentsImpl::OnFrameRemoved( | 3639 void WebContentsImpl::OnFrameRemoved( |
3639 RenderViewHostImpl* render_view_host, | 3640 RenderViewHostImpl* render_view_host, |
3640 int64 frame_id) { | 3641 int frame_routing_id) { |
3641 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3642 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3642 FrameDetached(render_view_host, frame_id)); | 3643 FrameDetached(render_view_host, frame_routing_id)); |
3643 } | 3644 } |
3644 | 3645 |
3645 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3646 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3646 if (!delegate_) | 3647 if (!delegate_) |
3647 return; | 3648 return; |
3648 const gfx::Size new_size = GetPreferredSize(); | 3649 const gfx::Size new_size = GetPreferredSize(); |
3649 if (new_size != old_size) | 3650 if (new_size != old_size) |
3650 delegate_->UpdatePreferredSize(this, new_size); | 3651 delegate_->UpdatePreferredSize(this, new_size); |
3651 } | 3652 } |
3652 | 3653 |
3653 } // namespace content | 3654 } // namespace content |
OLD | NEW |