Chromium Code Reviews
Help | Chromium Project | Sign in
(2)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 11293157: Add a new ContentRendererClient::HandleNavigation callback in RenderViewImpl::decidePolicyForNaviga… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 1 year, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 2656 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer, 2667 Send(new ViewHostMsg_DownloadUrl(routing_id_, request.url(), referrer,
2668 suggested_name)); 2668 suggested_name));
2669 } else { 2669 } else {
2670 OpenURL(frame, request.url(), referrer, policy); 2670 OpenURL(frame, request.url(), referrer, policy);
2671 } 2671 }
2672 } 2672 }
2673 2673
2674 WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( 2674 WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation(
2675 WebFrame* frame, const WebURLRequest& request, WebNavigationType type, 2675 WebFrame* frame, const WebURLRequest& request, WebNavigationType type,
2676 const WebNode&, WebNavigationPolicy default_policy, bool is_redirect) { 2676 const WebNode&, WebNavigationPolicy default_policy, bool is_redirect) {
2677 if (request.url() != GURL(kSwappedOutURL)) {
2678 if (GetContentClient()->renderer()->HandleNavigation(frame, request, type,
Charlie Reis 2012/11/08 19:24:51 nit: Combine these with &&
Marshall 2012/11/08 19:32:36 Done.
2679 default_policy,
2680 is_redirect)) {
2681 return WebKit::WebNavigationPolicyIgnore;
2682 }
2683 }
2684
2677 Referrer referrer( 2685 Referrer referrer(
2678 GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))), 2686 GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
2679 GetReferrerPolicyFromRequest(frame, request)); 2687 GetReferrerPolicyFromRequest(frame, request));
2680 2688
2681 if (is_swapped_out_) { 2689 if (is_swapped_out_) {
2682 if (request.url() != GURL(kSwappedOutURL)) { 2690 if (request.url() != GURL(kSwappedOutURL)) {
2683 // Targeted links may try to navigate a swapped out frame. Allow the 2691 // Targeted links may try to navigate a swapped out frame. Allow the
2684 // browser process to navigate the tab instead. Note that it is also 2692 // browser process to navigate the tab instead. Note that it is also
2685 // possible for non-targeted navigations (from this view) to arrive 2693 // possible for non-targeted navigations (from this view) to arrive
2686 // here just after we are swapped out. It's ok to send them to the 2694 // here just after we are swapped out. It's ok to send them to the
(...skipping 3656 matching lines...) Expand 10 before | Expand all | Expand 10 after
6343 } 6351 }
6344 #endif 6352 #endif
6345 6353
6346 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6354 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6347 TransportDIB::Handle dib_handle) { 6355 TransportDIB::Handle dib_handle) {
6348 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6356 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6349 RenderProcess::current()->ReleaseTransportDIB(dib); 6357 RenderProcess::current()->ReleaseTransportDIB(dib);
6350 } 6358 }
6351 6359
6352 } // namespace content 6360 } // namespace content
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6