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

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: respond to comments 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..3da13122603ef13e4971ad7d2e50dac1c96ee648 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);
Peter Kasting 2015/12/09 01:31:59 Nit: Could inline into next line (2 places)
Evan Stade 2015/12/09 01:57:06 Done.
+ if (!service->UsingDefaultTheme()) {
+ return ThemeService::GetThemeProviderForProfile(profile)
+ .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