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

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

Issue 2666193002: Switch RenderViewContextMenu to use RequestOpenURL (Closed)
Patch Set: cleanup 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 params.redirect_chain = redirect_chain; 810 params.redirect_chain = redirect_chain;
811 params.should_replace_current_entry = should_replace_current_entry; 811 params.should_replace_current_entry = should_replace_current_entry;
812 params.user_gesture = user_gesture; 812 params.user_gesture = user_gesture;
813 813
814 // RequestOpenURL is used only for local frames, so we can get here only if 814 // RequestOpenURL is used only for local frames, so we can get here only if
815 // the navigation is initiated by a frame in the same SiteInstance as this 815 // the navigation is initiated by a frame in the same SiteInstance as this
816 // frame. Note that navigations on RenderFrameProxies do not use 816 // frame. Note that navigations on RenderFrameProxies do not use
817 // RequestOpenURL and go through RequestTransferURL instead. 817 // RequestOpenURL and go through RequestTransferURL instead.
818 params.source_site_instance = current_site_instance; 818 params.source_site_instance = current_site_instance;
819 819
820 params.frame_id = render_frame_host->GetRoutingID();
821 params.process_id = render_frame_host->GetProcess()->GetID();
822
820 if (render_frame_host->web_ui()) { 823 if (render_frame_host->web_ui()) {
821 // Note that we hide the referrer for Web UI pages. We don't really want 824 // Note that we hide the referrer for Web UI pages. We don't really want
822 // web sites to see a referrer of "chrome://blah" (and some chrome: URLs 825 // web sites to see a referrer of "chrome://blah" (and some chrome: URLs
823 // might have search terms or other stuff we don't want to send to the 826 // might have search terms or other stuff we don't want to send to the
824 // site), so we send no referrer. 827 // site), so we send no referrer.
825 params.referrer = Referrer(); 828 params.referrer = Referrer();
826 829
827 // Navigations in Web UI pages count as browser-initiated navigations. 830 // Navigations in Web UI pages count as browser-initiated navigations.
828 params.is_renderer_initiated = false; 831 params.is_renderer_initiated = false;
829 } 832 }
830 833
831 GetContentClient()->browser()->OverrideNavigationParams( 834 GetContentClient()->browser()->OverrideNavigationParams(
832 current_site_instance, &params.transition, &params.is_renderer_initiated, 835 current_site_instance, &params.transition, &params.is_renderer_initiated,
833 &params.referrer); 836 &params.referrer);
834 837
835 if (delegate_) 838 if (delegate_)
836 delegate_->RequestOpenURL(render_frame_host, params); 839 delegate_->OpenURL(params);
837 } 840 }
838 841
839 void NavigatorImpl::RequestTransferURL( 842 void NavigatorImpl::RequestTransferURL(
840 RenderFrameHostImpl* render_frame_host, 843 RenderFrameHostImpl* render_frame_host,
841 const GURL& url, 844 const GURL& url,
842 SiteInstance* source_site_instance, 845 SiteInstance* source_site_instance,
843 const std::vector<GURL>& redirect_chain, 846 const std::vector<GURL>& redirect_chain,
844 const Referrer& referrer, 847 const Referrer& referrer,
845 ui::PageTransition page_transition, 848 ui::PageTransition page_transition,
846 const GlobalRequestID& transferred_global_request_id, 849 const GlobalRequestID& transferred_global_request_id,
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 if (navigation_handle) 1328 if (navigation_handle)
1326 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1329 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1327 1330
1328 controller_->SetPendingEntry(std::move(entry)); 1331 controller_->SetPendingEntry(std::move(entry));
1329 if (delegate_) 1332 if (delegate_)
1330 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1333 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1331 } 1334 }
1332 } 1335 }
1333 1336
1334 } // namespace content 1337 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698