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

Unified Diff: chrome/browser/views/frame/browser_root_view.cc

Issue 347020: BrowserRootView: rewritten the GetPasteAndGoUrl function.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 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: chrome/browser/views/frame/browser_root_view.cc
===================================================================
--- chrome/browser/views/frame/browser_root_view.cc (revision 30347)
+++ chrome/browser/views/frame/browser_root_view.cc (working copy)
@@ -6,9 +6,9 @@
#include "app/drag_drop_types.h"
#include "app/os_exchange_data.h"
-#include "chrome/browser/autocomplete/autocomplete_edit.h"
-#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
#include "chrome/browser/location_bar.h"
+#include "chrome/browser/profile.h"
+#include "chrome/browser/search_versus_navigate_classifier.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/frame/browser_frame.h"
#include "chrome/browser/views/tabs/tab_strip_wrapper.h"
@@ -137,20 +137,21 @@
if (!data.HasString())
return false;
- LocationBar* location_bar = browser_view_->GetLocationBar();
- if (!location_bar)
+ std::wstring text;
+ if (!data.GetString(&text) || text.empty())
return false;
- AutocompleteEditView* edit = location_bar->location_entry();
- if (!edit)
- return false;
+ Profile* profile = browser_view_->browser()->profile();
+ SearchVersusNavigateClassifier* classifier =
+ profile->GetSearchVersusNavigateClassifier();
- std::wstring text;
- if (!data.GetString(&text) || text.empty() ||
- !edit->model()->CanPasteAndGo(text)) {
+ GURL destination_url;
+ classifier->Classify(text, std::wstring(), NULL, &destination_url, NULL, NULL,
+ NULL);
+
+ if (!destination_url.is_valid())
return false;
- }
if (url)
- *url = edit->model()->paste_and_go_url();
+ *url = destination_url;
return true;
}
« 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