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

Unified Diff: chrome/browser/search/search.cc

Issue 13905008: Merge local_omnibox_popup into local_ntp. Render the Google logo and fakebox if Google is the sear… (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Fix reload. Re-enable test. Created 7 years, 8 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698