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

Unified Diff: chrome/browser/ui/search/search_ui.cc

Issue 1492423003: Rejigger ThemeService: move exposure of ThemeProvider interface to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a test Created 5 years 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/ui/search/search_ui.cc
diff --git a/chrome/browser/ui/search/search_ui.cc b/chrome/browser/ui/search/search_ui.cc
index 887339a443902d2595fae7dcc0b92eaade2a69ff..d1289caf88e1791eee8ac27aa6cdfe315d4d5baf 100644
--- a/chrome/browser/ui/search/search_ui.cc
+++ b/chrome/browser/ui/search/search_ui.cc
@@ -6,28 +6,35 @@
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/themes/theme_service.h"
+#include "chrome/browser/themes/theme_service_factory.h"
#include "ui/base/resource/material_design/material_design_controller.h"
namespace chrome {
-SkColor GetDetachedBookmarkBarBackgroundColor(ThemeService* theme_service) {
- if (!theme_service->UsingDefaultTheme())
- return theme_service->GetColor(ThemeProperties::COLOR_TOOLBAR);
+SkColor GetDetachedBookmarkBarBackgroundColor(Profile* profile) {
+ ThemeService* service = ThemeServiceFactory::GetForProfile(profile);
+ const ui::ThemeProvider& provider =
+ ThemeService::GetThemeProviderForProfile(profile);
+ if (!service->UsingDefaultTheme())
pkotwicz 2015/12/04 23:16:50 Nit: You only need to fetch the ThemeProvider if t
Evan Stade 2015/12/09 00:57:11 Done.
+ return provider.GetColor(ThemeProperties::COLOR_TOOLBAR);
return ui::MaterialDesignController::IsModeMaterial()
? SK_ColorWHITE
: SkColorSetARGB(0xFF, 0xF1, 0xF1, 0xF1);
}
-SkColor GetDetachedBookmarkBarSeparatorColor(ThemeService* theme_service) {
- if (theme_service->UsingDefaultTheme()) {
+SkColor GetDetachedBookmarkBarSeparatorColor(Profile* profile) {
+ ThemeService* service = ThemeServiceFactory::GetForProfile(profile);
+ if (service->UsingDefaultTheme()) {
return ThemeProperties::GetDefaultColor(
ThemeProperties::COLOR_TOOLBAR_SEPARATOR);
}
+ const ui::ThemeProvider& provider =
+ ThemeService::GetThemeProviderForProfile(profile);
// Use 50% of bookmark text color as separator color.
- return SkColorSetA(
- theme_service->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT), 128);
+ return SkColorSetA(provider.GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT),
+ 128);
}
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698