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

Unified Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 74133003: linux-aura: Restore middle-click on new-tab button behaviour. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-nit Created 7 years, 1 month 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
Index: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index b495ddedcf775edb04bcb3e78bb49921fc6e6638..f0c4050deae8cc799e89988e53308005a64bf467 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -7,6 +7,9 @@
#include "base/auto_reset.h"
#include "base/command_line.h"
#include "base/prefs/pref_service.h"
+#include "chrome/browser/autocomplete/autocomplete_classifier.h"
+#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
+#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/tab_helper.h"
@@ -350,7 +353,18 @@ bool BrowserTabStripController::IsCompatibleWith(TabStrip* other) const {
}
void BrowserTabStripController::CreateNewTab() {
- model_->delegate()->AddBlankTabAt(-1, true);
+ model_->delegate()->AddURLTabAt(GURL(), -1, true);
+}
+
+void BrowserTabStripController::CreateNewTabWithLocation(
+ const base::string16& location) {
+ // Use autocomplete to clean up the text, going so far as to turn it into
+ // a search query if necessary.
+ AutocompleteMatch match;
+ AutocompleteClassifierFactory::GetForProfile(profile())->Classify(
+ location, false, false, &match, NULL);
+ if (match.destination_url.is_valid())
+ model_->delegate()->AddURLTabAt(match.destination_url, -1, true);
}
bool BrowserTabStripController::IsIncognito() {

Powered by Google App Engine
This is Rietveld 408576698