OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/search_engines/search_terms_data.h" | 5 #include "chrome/browser/search_engines/search_terms_data.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 std::string UIThreadSearchTermsData::NTPIsThemedParam() const { | 173 std::string UIThreadSearchTermsData::NTPIsThemedParam() const { |
174 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || | 174 DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) || |
175 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 175 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
176 #if defined(ENABLE_THEMES) | 176 #if defined(ENABLE_THEMES) |
177 if (!chrome::IsInstantExtendedAPIEnabled()) | 177 if (!chrome::IsInstantExtendedAPIEnabled()) |
178 return std::string(); | 178 return std::string(); |
179 | 179 |
180 // TODO(dhollowa): Determine fraction of custom themes that don't affect the | 180 // TODO(dhollowa): Determine fraction of custom themes that don't affect the |
181 // NTP background and/or color. | 181 // NTP background and/or color. |
182 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); | 182 ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile_); |
183 // NTP is considered themed if the theme is not default and not native (GTK+). | 183 // NTP is considered themed if the theme is not default. |
184 if (theme_service && !theme_service->UsingDefaultTheme() && | 184 if (theme_service && !theme_service->UsingDefaultTheme()) |
185 !theme_service->UsingNativeTheme()) | |
186 return "es_th=1&"; | 185 return "es_th=1&"; |
187 #endif // defined(ENABLE_THEMES) | 186 #endif // defined(ENABLE_THEMES) |
188 | 187 |
189 return std::string(); | 188 return std::string(); |
190 } | 189 } |
191 | 190 |
192 // static | 191 // static |
193 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { | 192 void UIThreadSearchTermsData::SetGoogleBaseURL(const std::string& base_url) { |
194 delete google_base_url_; | 193 delete google_base_url_; |
195 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); | 194 google_base_url_ = base_url.empty() ? NULL : new std::string(base_url); |
196 } | 195 } |
OLD | NEW |