OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/android/logo_service.h" | 5 #include "chrome/browser/android/logo_service.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "chrome/browser/android/chrome_feature_list.h" | |
11 #include "chrome/browser/image_decoder.h" | 12 #include "chrome/browser/image_decoder.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/search_engines/template_url_service_factory.h" | 14 #include "chrome/browser/search_engines/template_url_service_factory.h" |
14 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 15 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
15 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 16 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
16 #include "components/search_engines/template_url_service.h" | 17 #include "components/search_engines/template_url_service.h" |
17 #include "components/search_provider_logos/google_logo_api.h" | 18 #include "components/search_provider_logos/google_logo_api.h" |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
20 | 21 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 | 116 |
116 if (!logo_tracker_) { | 117 if (!logo_tracker_) { |
117 logo_tracker_.reset(new LogoTracker( | 118 logo_tracker_.reset(new LogoTracker( |
118 profile_->GetPath().Append(kCachedLogoDirectory), | 119 profile_->GetPath().Append(kCachedLogoDirectory), |
119 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 120 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
120 BrowserThread::GetBlockingPool(), profile_->GetRequestContext(), | 121 BrowserThread::GetBlockingPool(), profile_->GetRequestContext(), |
121 std::unique_ptr<search_provider_logos::LogoDelegate>( | 122 std::unique_ptr<search_provider_logos::LogoDelegate>( |
122 new ChromeLogoDelegate()))); | 123 new ChromeLogoDelegate()))); |
123 } | 124 } |
124 | 125 |
126 bool gray_background = | |
gone
2017/03/20 18:01:36
use_gray_background? sounds like the background i
Theresa
2017/03/20 21:58:57
Done.
| |
127 !base::FeatureList::IsEnabled(chrome::android::kChromeHomeFeature); | |
125 logo_tracker_->SetServerAPI( | 128 logo_tracker_->SetServerAPI( |
126 GetGoogleDoodleURL(profile_), | 129 GetGoogleDoodleURL(profile_), |
127 base::Bind(&search_provider_logos::GoogleParseLogoResponse), | 130 base::Bind(&search_provider_logos::GoogleParseLogoResponse), |
128 base::Bind(&search_provider_logos::GoogleAppendQueryparamsToLogoURL), | 131 base::Bind(&search_provider_logos::GoogleAppendQueryparamsToLogoURL), |
129 true, /* wants_cta */ | 132 true, /* wants_cta */ |
130 true /* transparent */); | 133 gray_background); |
131 logo_tracker_->GetLogo(observer); | 134 logo_tracker_->GetLogo(observer); |
132 } | 135 } |
133 | 136 |
134 // LogoServiceFactory --------------------------------------------------------- | 137 // LogoServiceFactory --------------------------------------------------------- |
135 | 138 |
136 // static | 139 // static |
137 LogoService* LogoServiceFactory::GetForProfile(Profile* profile) { | 140 LogoService* LogoServiceFactory::GetForProfile(Profile* profile) { |
138 return static_cast<LogoService*>( | 141 return static_cast<LogoService*>( |
139 GetInstance()->GetServiceForBrowserContext(profile, true)); | 142 GetInstance()->GetServiceForBrowserContext(profile, true)); |
140 } | 143 } |
(...skipping 10 matching lines...) Expand all Loading... | |
151 } | 154 } |
152 | 155 |
153 LogoServiceFactory::~LogoServiceFactory() {} | 156 LogoServiceFactory::~LogoServiceFactory() {} |
154 | 157 |
155 KeyedService* LogoServiceFactory::BuildServiceInstanceFor( | 158 KeyedService* LogoServiceFactory::BuildServiceInstanceFor( |
156 content::BrowserContext* context) const { | 159 content::BrowserContext* context) const { |
157 Profile* profile = static_cast<Profile*>(context); | 160 Profile* profile = static_cast<Profile*>(context); |
158 DCHECK(!profile->IsOffTheRecord()); | 161 DCHECK(!profile->IsOffTheRecord()); |
159 return new LogoService(profile); | 162 return new LogoService(profile); |
160 } | 163 } |
OLD | NEW |