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..d7462b0406cd79470b4a58fa0f0691d23ebd9552 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,9 @@ bool NavEntryIsInstantNTP(const content::WebContents* contents, |
| return IsInstantExtendedAPIEnabled() && |
| IsRenderedInInstantProcess(contents, profile) && |
| (IsInstantURL(entry->GetVirtualURL(), profile) || |
| - entry->GetVirtualURL() == GURL(chrome::kChromeSearchLocalNtpUrl)) && |
| + entry->GetVirtualURL() == GURL(chrome::kChromeSearchLocalNtpUrl) || |
|
samarth
2013/04/16 16:55:10
How about just entry->GetVirtualURL() == GetLocalI
jeremycho
2013/04/16 20:39:09
Done.
|
| + entry->GetVirtualURL() == |
| + GURL(chrome::kChromeSearchLocalGoogleNtpUrl)) && |
| GetSearchTermsImpl(contents, entry).empty(); |
| } |
| @@ -466,6 +469,22 @@ GURL GetInstantURL(Profile* profile, int start_margin) { |
| return instant_url; |
| } |
| +GURL GetLocalInstantURL(Profile* profile) { |
| + const TemplateURL* default_provider = |
| + TemplateURLServiceFactory::GetForProfile(profile)-> |
| + GetDefaultSearchProvider(); |
| + |
| + if (!default_provider) |
|
samarth
2013/04/16 16:55:10
I think you still want to use chrome::kChromeSearc
jeremycho
2013/04/16 20:39:09
Done.
|
| + return GURL(); |
| + |
| + 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(); |
| } |