Chromium Code Reviews| Index: chrome/browser/search/search.cc |
| diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc |
| index 4f5f715f3b39abd5a7d7214464a0aa5db9dce3f8..08831bf4e3b3e7378c1dcad857199d51f51e7993 100644 |
| --- a/chrome/browser/search/search.cc |
| +++ b/chrome/browser/search/search.cc |
| @@ -13,6 +13,7 @@ |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/search/instant_service.h" |
| #include "chrome/browser/search/instant_service_factory.h" |
| +#include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| #include "chrome/browser/search_engines/template_url_service.h" |
| #include "chrome/browser/search_engines/template_url_service_factory.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -335,7 +336,7 @@ bool NavEntryIsInstantNTP(const content::WebContents* contents, |
| return IsInstantExtendedAPIEnabled() && |
| IsRenderedInInstantProcess(contents, profile) && |
| (IsInstantURL(entry->GetVirtualURL(), profile) || |
| - entry->GetVirtualURL() == GURL(chrome::kChromeSearchLocalNtpUrl)) && |
| + entry->GetVirtualURL() == GetLocalInstantURL(profile)) && |
| GetSearchTermsImpl(contents, entry).empty(); |
| } |
| @@ -466,6 +467,19 @@ GURL GetInstantURL(Profile* profile, int start_margin) { |
| return instant_url; |
| } |
| +GURL GetLocalInstantURL(Profile* profile) { |
| + const TemplateURL* default_provider = |
| + TemplateURLServiceFactory::GetForProfile(profile)-> |
| + GetDefaultSearchProvider(); |
|
sreeram
2013/04/19 17:05:00
GetDefaultSearchProviderTemplateURL()
jeremycho
2013/04/19 19:55:07
Done.
|
| + |
| + if (default_provider && |
| + (TemplateURLPrepopulateData::GetEngineType(default_provider->url()) == |
| + SEARCH_ENGINE_GOOGLE)) { |
| + return GURL(chrome::kChromeSearchLocalGoogleNtpUrl); |
| + } |
| + return GURL(chrome::kChromeSearchLocalNtpUrl); |
| +} |
| + |
| bool IsInstantEnabled(Profile* profile) { |
| return GetInstantURL(profile, kDisableStartMargin).is_valid(); |
| } |