Chromium Code Reviews| Index: chrome/browser/search/instant_service.cc |
| diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc |
| index 441a997298fd5267a96eedbe300f08585f263965..1201d371ced475005f0d88a718155c696e992e6a 100644 |
| --- a/chrome/browser/search/instant_service.cc |
| +++ b/chrome/browser/search/instant_service.cc |
| @@ -16,9 +16,11 @@ |
| #include "chrome/browser/search/suggestions/suggestions_source.h" |
| #include "chrome/browser/search_engines/template_url_service_factory.h" |
| #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| +#if defined(ENABLE_THEMES) |
| #include "chrome/browser/themes/theme_properties.h" |
| #include "chrome/browser/themes/theme_service.h" |
| #include "chrome/browser/themes/theme_service_factory.h" |
| +#endif // defined(ENABLE_THEMES) |
|
Nico
2015/04/15 16:29:49
style nit: Move this down (like the !defined(OS_AN
pcc1
2015/04/15 21:05:23
Done.
|
| #include "chrome/browser/thumbnails/thumbnail_list_source.h" |
| #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
| #include "chrome/browser/ui/webui/fallback_icon_source.h" |
| @@ -47,22 +49,6 @@ |
| #include "chrome/browser/search/local_ntp_source.h" |
| #endif |
| -namespace { |
| - |
| -const int kSectionBorderAlphaTransparency = 80; |
| - |
| -// Converts SkColor to RGBAColor |
| -RGBAColor SkColorToRGBAColor(const SkColor& sKColor) { |
| - RGBAColor color; |
| - color.r = SkColorGetR(sKColor); |
| - color.g = SkColorGetG(sKColor); |
| - color.b = SkColorGetB(sKColor); |
| - color.a = SkColorGetA(sKColor); |
| - return color; |
| -} |
| - |
| -} // namespace |
| - |
| InstantService::InstantService(Profile* profile) |
| : profile_(profile), |
| template_url_service_(TemplateURLServiceFactory::GetForProfile(profile_)), |
| @@ -204,12 +190,14 @@ void InstantService::UndoAllMostVisitedDeletions() { |
| } |
| void InstantService::UpdateThemeInfo() { |
| +#if defined(ENABLE_THEMES) |
| // Update theme background info. |
| // Initialize |theme_info| if necessary. |
| if (!theme_info_) |
| OnThemeChanged(ThemeServiceFactory::GetForProfile(profile_)); |
| else |
| OnThemeChanged(NULL); |
| +#endif // defined(ENABLE_THEMES) |
| } |
| void InstantService::UpdateMostVisitedItemsInfo() { |
| @@ -300,6 +288,24 @@ void InstantService::NotifyAboutMostVisitedItems() { |
| MostVisitedItemsChanged(most_visited_items_)); |
| } |
| +#if defined(ENABLE_THEMES) |
| + |
| +namespace { |
| + |
| +const int kSectionBorderAlphaTransparency = 80; |
| + |
| +// Converts SkColor to RGBAColor |
| +RGBAColor SkColorToRGBAColor(const SkColor& sKColor) { |
| + RGBAColor color; |
| + color.r = SkColorGetR(sKColor); |
| + color.g = SkColorGetG(sKColor); |
| + color.b = SkColorGetB(sKColor); |
| + color.a = SkColorGetA(sKColor); |
| + return color; |
| +} |
| + |
| +} // namespace |
| + |
| void InstantService::OnThemeChanged(ThemeService* theme_service) { |
| if (!theme_service) { |
| DCHECK(theme_info_.get()); |
| @@ -407,6 +413,7 @@ void InstantService::OnThemeChanged(ThemeService* theme_service) { |
| FOR_EACH_OBSERVER(InstantServiceObserver, observers_, |
| ThemeInfoChanged(*theme_info_)); |
| } |
| +#endif // defined(ENABLE_THEMES) |
| void InstantService::OnTemplateURLServiceChanged() { |
| // Check whether the default search provider was changed. |