| OLD | NEW |
| 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 if (ThemeServiceFactory::GetForProfile(profile)->UsingDefaultTheme()) { |
| 15 return theme_service->GetColor(ThemeProperties::COLOR_TOOLBAR); | 16 return ui::MaterialDesignController::IsModeMaterial() |
| 17 ? SK_ColorWHITE |
| 18 : SkColorSetARGB(0xFF, 0xF1, 0xF1, 0xF1); |
| 19 } |
| 16 | 20 |
| 17 return ui::MaterialDesignController::IsModeMaterial() | 21 return ThemeService::GetThemeProviderForProfile(profile) |
| 18 ? SK_ColorWHITE | 22 .GetColor(ThemeProperties::COLOR_TOOLBAR); |
| 19 : SkColorSetARGB(0xFF, 0xF1, 0xF1, 0xF1); | |
| 20 } | 23 } |
| 21 | 24 |
| 22 SkColor GetDetachedBookmarkBarSeparatorColor(ThemeService* theme_service) { | 25 SkColor GetDetachedBookmarkBarSeparatorColor(Profile* profile) { |
| 23 if (theme_service->UsingDefaultTheme()) { | 26 if (ThemeServiceFactory::GetForProfile(profile)->UsingDefaultTheme()) { |
| 24 return ThemeProperties::GetDefaultColor( | 27 return ThemeProperties::GetDefaultColor( |
| 25 ThemeProperties::COLOR_TOOLBAR_SEPARATOR); | 28 ThemeProperties::COLOR_TOOLBAR_SEPARATOR); |
| 26 } | 29 } |
| 27 | 30 |
| 28 // Use 50% of bookmark text color as separator color. | 31 // Use 50% of bookmark text color as separator color. |
| 29 return SkColorSetA( | 32 return SkColorSetA(ThemeService::GetThemeProviderForProfile(profile) |
| 30 theme_service->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT), 128); | 33 .GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT), |
| 34 128); |
| 31 } | 35 } |
| 32 | 36 |
| 33 } // namespace chrome | 37 } // namespace chrome |
| OLD | NEW |