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

Unified Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 907833002: Hide experimental app list Google logo and custom launcher page when search engine is not Google. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_app_list_bg_color
Patch Set: address comments, disable animation to hidden views Created 5 years, 10 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 | « chrome/browser/ui/app_list/start_page_service.h ('k') | ui/app_list/app_list_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/start_page_service.cc
diff --git a/chrome/browser/ui/app_list/start_page_service.cc b/chrome/browser/ui/app_list/start_page_service.cc
index c65a3e03a34990a4c1c607e69e34715d0100894b..b92895c50aaa648a3b9ed0acb9db42b9165a837d 100644
--- a/chrome/browser/ui/app_list/start_page_service.cc
+++ b/chrome/browser/ui/app_list/start_page_service.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/hotword_service.h"
#include "chrome/browser/search/hotword_service_factory.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
#include "chrome/browser/ui/app_list/speech_auth_helper.h"
#include "chrome/browser/ui/app_list/speech_recognizer.h"
@@ -30,6 +31,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "components/search_engines/template_url_prepopulate_data.h"
+#include "components/search_engines/template_url_service.h"
#include "components/ui/zoom/zoom_controller.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
@@ -268,6 +271,7 @@ StartPageService::StartPageService(Profile* profile)
speech_auth_helper_(new SpeechAuthHelper(profile, &clock_)),
network_available_(true),
microphone_available_(true),
+ search_engine_is_google_(true),
Matt Giuca 2015/02/17 08:07:45 nit: Maybe init this to false? (Doesn't really mat
calamity 2015/02/18 01:42:34 Done.
weak_factory_(this) {
// If experimental hotwording is enabled, then we're always "ready".
// Transitioning into the "hotword recognizing" state is handled by the
@@ -279,10 +283,20 @@ StartPageService::StartPageService(Profile* profile)
if (app_list::switches::IsExperimentalAppListEnabled())
LoadContents();
+ TemplateURLService* template_url_service =
+ TemplateURLServiceFactory::GetForProfile(profile_);
+ const TemplateURL* default_provider =
+ template_url_service->GetDefaultSearchProvider();
+ search_engine_is_google_ =
+ TemplateURLPrepopulateData::GetEngineType(
+ *default_provider, template_url_service->search_terms_data()) ==
+ SEARCH_ENGINE_GOOGLE;
+
network_change_observer_.reset(new NetworkChangeObserver(this));
}
-StartPageService::~StartPageService() {}
+StartPageService::~StartPageService() {
+}
void StartPageService::AddObserver(StartPageObserver* observer) {
observers_.AddObserver(observer);
@@ -559,6 +573,9 @@ void StartPageService::UnloadContents() {
}
void StartPageService::FetchDoodleJson() {
+ if (!search_engine_is_google_)
+ return;
+
GURL::Replacements replacements;
replacements.SetPathStr(kDoodleJsonPath);
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.h ('k') | ui/app_list/app_list_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698