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

Side by Side Diff: chrome/browser/instant/instant_controller.cc

Issue 11644009: Added support for passing WindowOpenDisposition into BrowserInstantController::OpenURL() from the o… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/instant/instant_controller.h" 5 #include "chrome/browser/instant/instant_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 #else 936 #else
937 if (IsViewInContents(GetViewGainingFocus(view_gaining_focus), 937 if (IsViewInContents(GetViewGainingFocus(view_gaining_focus),
938 loader_->contents())) 938 loader_->contents()))
939 CommitIfPossible(INSTANT_COMMIT_FOCUS_LOST); 939 CommitIfPossible(INSTANT_COMMIT_FOCUS_LOST);
940 else 940 else
941 HideLoader(); 941 HideLoader();
942 #endif 942 #endif
943 } 943 }
944 944
945 void InstantController::NavigateToURL(const GURL& url, 945 void InstantController::NavigateToURL(const GURL& url,
946 content::PageTransition transition) { 946 content::PageTransition transition,
947 WindowOpenDisposition disposition) {
947 if (!extended_enabled_) 948 if (!extended_enabled_)
948 return; 949 return;
949 if (loader_) 950 if (loader_)
950 HideLoader(); 951 HideLoader();
951 browser_->OpenURLInCurrentTab(url, transition); 952 browser_->OpenURL(url, transition, disposition);
952 } 953 }
953 954
954 bool InstantController::ResetLoader(const TemplateURL* template_url, 955 bool InstantController::ResetLoader(const TemplateURL* template_url,
955 const content::WebContents* active_tab, 956 const content::WebContents* active_tab,
956 bool fallback_to_local) { 957 bool fallback_to_local) {
957 std::string instant_url; 958 std::string instant_url;
958 if (!GetInstantURL(template_url, &instant_url)) { 959 if (!GetInstantURL(template_url, &instant_url)) {
959 if (!fallback_to_local || !extended_enabled_) 960 if (!fallback_to_local || !extended_enabled_)
960 return false; 961 return false;
961 962
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 std::map<std::string, int>::const_iterator iter = 1237 std::map<std::string, int>::const_iterator iter =
1237 blacklisted_urls_.find(*instant_url); 1238 blacklisted_urls_.find(*instant_url);
1238 if (iter != blacklisted_urls_.end() && 1239 if (iter != blacklisted_urls_.end() &&
1239 iter->second > kMaxInstantSupportFailures) { 1240 iter->second > kMaxInstantSupportFailures) {
1240 RecordEventHistogram(INSTANT_CONTROLLER_EVENT_URL_BLOCKED_BY_BLACKLIST); 1241 RecordEventHistogram(INSTANT_CONTROLLER_EVENT_URL_BLOCKED_BY_BLACKLIST);
1241 return false; 1242 return false;
1242 } 1243 }
1243 1244
1244 return true; 1245 return true;
1245 } 1246 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698