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

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: fix that unittest 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
« no previous file with comments | « chrome/browser/ui/search/search_ui.h ('k') | chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..db1f5f65164c83483bb3e42398e7e30c9960c76a 100644
--- a/chrome/browser/ui/search/search_ui.cc
+++ b/chrome/browser/ui/search/search_ui.cc
@@ -6,28 +6,32 @@
#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) {
+ if (ThemeServiceFactory::GetForProfile(profile)->UsingDefaultTheme()) {
+ return ui::MaterialDesignController::IsModeMaterial()
+ ? SK_ColorWHITE
+ : SkColorSetARGB(0xFF, 0xF1, 0xF1, 0xF1);
+ }
- return ui::MaterialDesignController::IsModeMaterial()
- ? SK_ColorWHITE
- : SkColorSetARGB(0xFF, 0xF1, 0xF1, 0xF1);
+ return ThemeService::GetThemeProviderForProfile(profile)
+ .GetColor(ThemeProperties::COLOR_TOOLBAR);
}
-SkColor GetDetachedBookmarkBarSeparatorColor(ThemeService* theme_service) {
- if (theme_service->UsingDefaultTheme()) {
+SkColor GetDetachedBookmarkBarSeparatorColor(Profile* profile) {
+ if (ThemeServiceFactory::GetForProfile(profile)->UsingDefaultTheme()) {
return ThemeProperties::GetDefaultColor(
ThemeProperties::COLOR_TOOLBAR_SEPARATOR);
}
// Use 50% of bookmark text color as separator color.
- return SkColorSetA(
- theme_service->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT), 128);
+ return SkColorSetA(ThemeService::GetThemeProviderForProfile(profile)
+ .GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT),
+ 128);
}
} // namespace chrome
« no previous file with comments | « chrome/browser/ui/search/search_ui.h ('k') | chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698