Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 2921753002: NOT YET READY: Making chrome.windows.create establish an actual "opener" relationship.
Patch Set: Adding setSelfAsOpener parameter. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 } 717 }
718 718
719 void NavigatorImpl::RequestOpenURL( 719 void NavigatorImpl::RequestOpenURL(
720 RenderFrameHostImpl* render_frame_host, 720 RenderFrameHostImpl* render_frame_host,
721 const GURL& url, 721 const GURL& url,
722 bool uses_post, 722 bool uses_post,
723 const scoped_refptr<ResourceRequestBodyImpl>& body, 723 const scoped_refptr<ResourceRequestBodyImpl>& body,
724 const std::string& extra_headers, 724 const std::string& extra_headers,
725 const Referrer& referrer, 725 const Referrer& referrer,
726 WindowOpenDisposition disposition, 726 WindowOpenDisposition disposition,
727 bool force_new_process_for_new_contents,
728 bool should_replace_current_entry, 727 bool should_replace_current_entry,
729 bool user_gesture) { 728 bool user_gesture) {
730 // Note: This can be called for subframes (even when OOPIFs are not possible) 729 // Note: This can be called for subframes (even when OOPIFs are not possible)
731 // if the disposition calls for a different window. 730 // if the disposition calls for a different window.
732 731
733 // Only the current RenderFrameHost should be sending an OpenURL request. 732 // Only the current RenderFrameHost should be sending an OpenURL request.
734 // Pending RenderFrameHost should know where it is navigating and pending 733 // Pending RenderFrameHost should know where it is navigating and pending
735 // deletion RenderFrameHost shouldn't be trying to navigate. 734 // deletion RenderFrameHost shouldn't be trying to navigate.
736 if (render_frame_host != 735 if (render_frame_host !=
737 render_frame_host->frame_tree_node()->current_frame_host()) { 736 render_frame_host->frame_tree_node()->current_frame_host()) {
(...skipping 22 matching lines...) Expand all
760 // (possibly of a new or different WebContents) otherwise. 759 // (possibly of a new or different WebContents) otherwise.
761 if (disposition == WindowOpenDisposition::CURRENT_TAB && 760 if (disposition == WindowOpenDisposition::CURRENT_TAB &&
762 render_frame_host->GetParent()) { 761 render_frame_host->GetParent()) {
763 frame_tree_node_id = 762 frame_tree_node_id =
764 render_frame_host->frame_tree_node()->frame_tree_node_id(); 763 render_frame_host->frame_tree_node()->frame_tree_node_id();
765 } 764 }
766 765
767 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition, 766 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition,
768 ui::PAGE_TRANSITION_LINK, 767 ui::PAGE_TRANSITION_LINK,
769 true /* is_renderer_initiated */); 768 true /* is_renderer_initiated */);
770 params.force_new_process_for_new_contents =
771 force_new_process_for_new_contents;
772 params.uses_post = uses_post; 769 params.uses_post = uses_post;
773 params.post_data = body; 770 params.post_data = body;
774 params.extra_headers = extra_headers; 771 params.extra_headers = extra_headers;
775 if (redirect_chain.size() > 0) 772 if (redirect_chain.size() > 0)
776 params.redirect_chain = redirect_chain; 773 params.redirect_chain = redirect_chain;
777 params.should_replace_current_entry = should_replace_current_entry; 774 params.should_replace_current_entry = should_replace_current_entry;
778 params.user_gesture = user_gesture; 775 params.user_gesture = user_gesture;
779 776
780 // RequestOpenURL is used only for local frames, so we can get here only if 777 // RequestOpenURL is used only for local frames, so we can get here only if
781 // the navigation is initiated by a frame in the same SiteInstance as this 778 // the navigation is initiated by a frame in the same SiteInstance as this
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 if (navigation_handle) 1295 if (navigation_handle)
1299 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1296 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1300 1297
1301 controller_->SetPendingEntry(std::move(entry)); 1298 controller_->SetPendingEntry(std::move(entry));
1302 if (delegate_) 1299 if (delegate_)
1303 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1300 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1304 } 1301 }
1305 } 1302 }
1306 1303
1307 } // namespace content 1304 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698