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

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

Issue 991353003: Cleanup: Put more Themes code behind defined(ENABLE_THEMES). Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/instant_service.cc
diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc
index e785e0c04a061e5c565cc9d9f2119ad21c4a0399..4cf9e78ad8f668c767ca15d3fa3794b5c356c0d5 100644
--- a/chrome/browser/search/instant_service.cc
+++ b/chrome/browser/search/instant_service.cc
@@ -14,15 +14,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"
-#include "chrome/browser/themes/theme_properties.h"
-#include "chrome/browser/themes/theme_service.h"
-#include "chrome/browser/themes/theme_service_factory.h"
#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"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/ntp/thumbnail_source.h"
-#include "chrome/browser/ui/webui/theme_source.h"
#include "chrome/common/render_messages.h"
#include "components/history/core/browser/top_sites.h"
#include "components/search_engines/template_url_service.h"
@@ -31,7 +27,6 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/url_data_source.h"
-#include "grit/theme_resources.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/image/image_skia.h"
@@ -41,8 +36,17 @@
#include "chrome/browser/search/local_ntp_source.h"
#endif
+#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"
+#include "chrome/browser/ui/webui/theme_source.h"
+#include "grit/theme_resources.h"
pkotwicz 2015/03/11 01:02:58 Nit: theme_resources.h should not be in the ifdef.
+#endif
+
namespace {
+#if defined(ENABLE_THEMES)
const int kSectionBorderAlphaTransparency = 80;
// Converts SkColor to RGBAColor
@@ -54,6 +58,7 @@ RGBAColor SkColorToRGBAColor(const SkColor& sKColor) {
color.a = SkColorGetA(sKColor);
return color;
}
+#endif
} // namespace
@@ -189,12 +194,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
}
void InstantService::UpdateMostVisitedItemsInfo() {
@@ -285,6 +292,7 @@ void InstantService::NotifyAboutMostVisitedItems() {
MostVisitedItemsChanged(most_visited_items_));
}
+#if defined(ENABLE_THEMES)
void InstantService::OnThemeChanged(ThemeService* theme_service) {
if (!theme_service) {
DCHECK(theme_info_.get());
@@ -392,6 +400,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.
« no previous file with comments | « chrome/browser/search/instant_service.h ('k') | chrome/browser/search_engines/ui_thread_search_terms_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698