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

Unified Diff: webkit/glue/webframeloaderclient_impl.cc

Issue 155522: Middle clicks on all fragment links open in new tab. (Closed)
Patch Set: make code more compact Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webframeloaderclient_impl.cc
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc
index fcdb6a03e6d2091bce162f112404e1fd018e3cdb..a685fbb05779e73f35c469333b2156172675394d 100644
--- a/webkit/glue/webframeloaderclient_impl.cc
+++ b/webkit/glue/webframeloaderclient_impl.cc
@@ -916,10 +916,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(
WindowOpenDisposition disposition = CURRENT_TAB;
ActionSpecifiesDisposition(action, &disposition);
- // Give the delegate a chance to change the disposition. When we do not
- // have a provisional data source here, it means that we are scrolling to
- // an anchor in the page. We don't need to ask the WebViewDelegate about
- // such navigations.
+ // Give the delegate a chance to change the disposition.
const WebDataSourceImpl* ds = webframe_->GetProvisionalDataSourceImpl();
if (ds) {
GURL url = ds->request().url();
@@ -935,28 +932,24 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(
disposition = d->DispositionForNavigationAction(
wv, webframe_, ds->request(), webnav_type, disposition, is_redirect);
}
+ }
+ if (disposition == CURRENT_TAB) {
+ policy_action = PolicyUse;
+ } else if (disposition == SAVE_TO_DISK) {
+ policy_action = PolicyDownload;
+ } else {
if (disposition != IGNORE_ACTION) {
- if (disposition == CURRENT_TAB) {
- policy_action = PolicyUse;
- } else if (disposition == SAVE_TO_DISK) {
- policy_action = PolicyDownload;
- } else {
- GURL referrer = webkit_glue::StringToGURL(
- request.httpHeaderField("Referer"));
-
- d->OpenURL(webframe_->GetWebViewImpl(),
- webkit_glue::KURLToGURL(request.url()),
- referrer,
- disposition);
- policy_action = PolicyIgnore;
- }
- } else {
- policy_action = PolicyIgnore;
+ GURL referrer = webkit_glue::StringToGURL(
+ request.httpHeaderField("Referer"));
+
+ d->OpenURL(webframe_->GetWebViewImpl(),
+ webkit_glue::KURLToGURL(request.url()),
+ referrer,
+ disposition);
}
+ policy_action = PolicyIgnore;
}
- } else {
- policy_action = PolicyIgnore;
}
(webframe_->frame()->loader()->*function)(policy_action);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698