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

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

Issue 2666193002: Switch RenderViewContextMenu to use RequestOpenURL (Closed)
Patch Set: Address Charlie's comments Created 3 years, 10 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 params.redirect_chain = redirect_chain; 790 params.redirect_chain = redirect_chain;
791 params.should_replace_current_entry = should_replace_current_entry; 791 params.should_replace_current_entry = should_replace_current_entry;
792 params.user_gesture = user_gesture; 792 params.user_gesture = user_gesture;
793 793
794 // RequestOpenURL is used only for local frames, so we can get here only if 794 // RequestOpenURL is used only for local frames, so we can get here only if
795 // the navigation is initiated by a frame in the same SiteInstance as this 795 // the navigation is initiated by a frame in the same SiteInstance as this
796 // frame. Note that navigations on RenderFrameProxies do not use 796 // frame. Note that navigations on RenderFrameProxies do not use
797 // RequestOpenURL and go through RequestTransferURL instead. 797 // RequestOpenURL and go through RequestTransferURL instead.
798 params.source_site_instance = current_site_instance; 798 params.source_site_instance = current_site_instance;
799 799
800 params.source_render_frame_id = render_frame_host->GetRoutingID();
801 params.source_render_process_id = render_frame_host->GetProcess()->GetID();
802
800 if (render_frame_host->web_ui()) { 803 if (render_frame_host->web_ui()) {
801 // Note that we hide the referrer for Web UI pages. We don't really want 804 // Note that we hide the referrer for Web UI pages. We don't really want
802 // web sites to see a referrer of "chrome://blah" (and some chrome: URLs 805 // web sites to see a referrer of "chrome://blah" (and some chrome: URLs
803 // might have search terms or other stuff we don't want to send to the 806 // might have search terms or other stuff we don't want to send to the
804 // site), so we send no referrer. 807 // site), so we send no referrer.
805 params.referrer = Referrer(); 808 params.referrer = Referrer();
806 809
807 // Navigations in Web UI pages count as browser-initiated navigations. 810 // Navigations in Web UI pages count as browser-initiated navigations.
808 params.is_renderer_initiated = false; 811 params.is_renderer_initiated = false;
809 } 812 }
810 813
811 GetContentClient()->browser()->OverrideNavigationParams( 814 GetContentClient()->browser()->OverrideNavigationParams(
812 current_site_instance, &params.transition, &params.is_renderer_initiated, 815 current_site_instance, &params.transition, &params.is_renderer_initiated,
813 &params.referrer); 816 &params.referrer);
814 817
815 if (delegate_) 818 if (delegate_)
816 delegate_->RequestOpenURL(render_frame_host, params); 819 delegate_->OpenURL(params);
817 } 820 }
818 821
819 void NavigatorImpl::RequestTransferURL( 822 void NavigatorImpl::RequestTransferURL(
820 RenderFrameHostImpl* render_frame_host, 823 RenderFrameHostImpl* render_frame_host,
821 const GURL& url, 824 const GURL& url,
822 SiteInstance* source_site_instance, 825 SiteInstance* source_site_instance,
823 const std::vector<GURL>& redirect_chain, 826 const std::vector<GURL>& redirect_chain,
824 const Referrer& referrer, 827 const Referrer& referrer,
825 ui::PageTransition page_transition, 828 ui::PageTransition page_transition,
826 const GlobalRequestID& transferred_global_request_id, 829 const GlobalRequestID& transferred_global_request_id,
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 if (navigation_handle) 1308 if (navigation_handle)
1306 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1309 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1307 1310
1308 controller_->SetPendingEntry(std::move(entry)); 1311 controller_->SetPendingEntry(std::move(entry));
1309 if (delegate_) 1312 if (delegate_)
1310 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1313 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1311 } 1314 }
1312 } 1315 }
1313 1316
1314 } // namespace content 1317 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698