OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/views/style/platform_style.h" | 5 #include "ui/views/style/platform_style.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ui/base/material_design/material_design_controller.h" | 9 #include "ui/base/material_design/material_design_controller.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
11 #include "ui/gfx/shadow_value.h" | 11 #include "ui/gfx/shadow_value.h" |
12 #include "ui/native_theme/native_theme.h" | 12 #include "ui/native_theme/native_theme.h" |
13 #include "ui/resources/grit/ui_resources.h" | 13 #include "ui/resources/grit/ui_resources.h" |
14 #include "ui/views/background.h" | 14 #include "ui/views/background.h" |
15 #include "ui/views/controls/button/label_button.h" | 15 #include "ui/views/controls/button/label_button.h" |
16 #include "ui/views/controls/button/label_button_border.h" | 16 #include "ui/views/controls/button/label_button_border.h" |
17 #include "ui/views/controls/focusable_border.h" | 17 #include "ui/views/controls/focusable_border.h" |
18 #include "ui/views/controls/scrollbar/native_scroll_bar.h" | 18 #include "ui/views/controls/scrollbar/scroll_bar_views.h" |
19 | 19 |
20 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 20 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
21 #define DESKTOP_LINUX | 21 #define DESKTOP_LINUX |
22 #endif | 22 #endif |
23 | 23 |
24 namespace views { | 24 namespace views { |
25 namespace { | 25 namespace { |
26 | 26 |
27 #if !defined(DESKTOP_LINUX) && !defined(OS_MACOSX) | 27 #if !defined(DESKTOP_LINUX) && !defined(OS_MACOSX) |
28 // Default text and shadow colors for STYLE_BUTTON. | 28 // Default text and shadow colors for STYLE_BUTTON. |
(...skipping 19 matching lines...) Expand all Loading... |
48 | 48 |
49 // static | 49 // static |
50 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled, | 50 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled, |
51 Combobox::Style style) { | 51 Combobox::Style style) { |
52 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 52 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
53 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); | 53 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); |
54 } | 54 } |
55 | 55 |
56 // static | 56 // static |
57 std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { | 57 std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { |
58 return base::MakeUnique<NativeScrollBar>(is_horizontal); | 58 return base::MakeUnique<ScrollBarViews>(is_horizontal); |
59 } | 59 } |
60 | 60 |
61 // static | 61 // static |
62 SkColor PlatformStyle::TextColorForButton( | 62 SkColor PlatformStyle::TextColorForButton( |
63 const ButtonColorByState& color_by_state, | 63 const ButtonColorByState& color_by_state, |
64 const LabelButton& button) { | 64 const LabelButton& button) { |
65 return color_by_state[button.state()]; | 65 return color_by_state[button.state()]; |
66 } | 66 } |
67 | 67 |
68 // static | 68 // static |
(...skipping 18 matching lines...) Expand all Loading... |
87 | 87 |
88 #if !defined(DESKTOP_LINUX) | 88 #if !defined(DESKTOP_LINUX) |
89 // static | 89 // static |
90 std::unique_ptr<Border> PlatformStyle::CreateThemedLabelButtonBorder( | 90 std::unique_ptr<Border> PlatformStyle::CreateThemedLabelButtonBorder( |
91 LabelButton* button) { | 91 LabelButton* button) { |
92 return button->CreateDefaultBorder(); | 92 return button->CreateDefaultBorder(); |
93 } | 93 } |
94 #endif | 94 #endif |
95 | 95 |
96 } // namespace views | 96 } // namespace views |
OLD | NEW |