Index: chrome/browser/ui/toolbar/toolbar_model.cc |
diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc |
index c7a164686d0c41e4488dbc116da6034ec47c45cb..11793f3f74d77a28976a441e3cc8117e677928f3 100644 |
--- a/chrome/browser/ui/toolbar/toolbar_model.cc |
+++ b/chrome/browser/ui/toolbar/toolbar_model.cc |
@@ -6,9 +6,10 @@ |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/autocomplete/autocomplete_input.h" |
-#include "chrome/browser/google/google_util.h" |
#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/search_engines/template_url_service.h" |
+#include "chrome/browser/search_engines/template_url_service_factory.h" |
#include "chrome/browser/ssl/ssl_error_info.h" |
#include "chrome/browser/ui/search/search.h" |
#include "chrome/browser/ui/toolbar/toolbar_model_delegate.h" |
@@ -198,14 +199,21 @@ NavigationController* ToolbarModel::GetNavigationController() const { |
string16 ToolbarModel::TryToExtractSearchTermsFromURL(const GURL& url) const { |
Profile* profile = GetProfile(); |
- if (profile && |
- chrome::search::IsInstantExtendedAPIEnabled(profile) && |
- google_util::IsInstantExtendedAPIGoogleSearchUrl(url.spec())) { |
- // TODO(dominich): http://crbug.com/135106 - Replace this with whatever the |
- // final solution is as per http://crbug.com/139176. |
- return google_util::GetSearchTermsFromGoogleSearchURL(url.spec()); |
- } |
- return string16(); |
+ |
+ if (!profile || !chrome::search::IsInstantExtendedAPIEnabled(profile)) |
dominich
2012/09/14 21:34:04
One more thought (from a discussion with dcblack):
beaudoin
2012/09/22 06:55:45
From the discussion it looks like we should only r
|
+ return string16(); |
+ |
+ TemplateURLService* template_url_service = |
+ TemplateURLServiceFactory::GetForProfile(profile); |
+ |
+ if (!template_url_service) |
+ return string16(); |
+ |
+ TemplateURL *template_url = template_url_service->GetDefaultSearchProvider(); |
+ if (!template_url) |
+ return string16(); |
+ |
+ return template_url->ExtractSearchTermsFromURL(url); |
dominich
2012/09/13 18:30:30
is this checking for espv=1 in the query component
beaudoin
2012/09/22 06:55:45
Done.
|
} |
Profile* ToolbarModel::GetProfile() const { |