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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/search/search_ui.h" 5 #include "chrome/browser/ui/search/search_ui.h"
6 6
7 #include "chrome/browser/themes/theme_properties.h" 7 #include "chrome/browser/themes/theme_properties.h"
8 #include "chrome/browser/themes/theme_service.h" 8 #include "chrome/browser/themes/theme_service.h"
9 #include "chrome/browser/themes/theme_service_factory.h"
9 #include "ui/base/resource/material_design/material_design_controller.h" 10 #include "ui/base/resource/material_design/material_design_controller.h"
10 11
11 namespace chrome { 12 namespace chrome {
12 13
13 SkColor GetDetachedBookmarkBarBackgroundColor(ThemeService* theme_service) { 14 SkColor GetDetachedBookmarkBarBackgroundColor(Profile* profile) {
14 if (!theme_service->UsingDefaultTheme()) 15 ThemeService* service = ThemeServiceFactory::GetForProfile(profile);
15 return theme_service->GetColor(ThemeProperties::COLOR_TOOLBAR); 16 const ui::ThemeProvider& provider =
17 ThemeService::GetThemeProviderForProfile(profile);
18 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.
19 return provider.GetColor(ThemeProperties::COLOR_TOOLBAR);
16 20
17 return ui::MaterialDesignController::IsModeMaterial() 21 return ui::MaterialDesignController::IsModeMaterial()
18 ? SK_ColorWHITE 22 ? SK_ColorWHITE
19 : SkColorSetARGB(0xFF, 0xF1, 0xF1, 0xF1); 23 : SkColorSetARGB(0xFF, 0xF1, 0xF1, 0xF1);
20 } 24 }
21 25
22 SkColor GetDetachedBookmarkBarSeparatorColor(ThemeService* theme_service) { 26 SkColor GetDetachedBookmarkBarSeparatorColor(Profile* profile) {
23 if (theme_service->UsingDefaultTheme()) { 27 ThemeService* service = ThemeServiceFactory::GetForProfile(profile);
28 if (service->UsingDefaultTheme()) {
24 return ThemeProperties::GetDefaultColor( 29 return ThemeProperties::GetDefaultColor(
25 ThemeProperties::COLOR_TOOLBAR_SEPARATOR); 30 ThemeProperties::COLOR_TOOLBAR_SEPARATOR);
26 } 31 }
27 32
33 const ui::ThemeProvider& provider =
34 ThemeService::GetThemeProviderForProfile(profile);
28 // Use 50% of bookmark text color as separator color. 35 // Use 50% of bookmark text color as separator color.
29 return SkColorSetA( 36 return SkColorSetA(provider.GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT),
30 theme_service->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT), 128); 37 128);
31 } 38 }
32 39
33 } // namespace chrome 40 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698