| 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/scroll_bar_views.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_CHROMEOS) |
| 21 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" |
| 22 #elif defined(OS_LINUX) |
| 21 #define DESKTOP_LINUX | 23 #define DESKTOP_LINUX |
| 22 #endif | 24 #endif |
| 23 | 25 |
| 24 namespace views { | 26 namespace views { |
| 25 namespace { | 27 namespace { |
| 26 | 28 |
| 27 #if !defined(DESKTOP_LINUX) && !defined(OS_MACOSX) | 29 #if !defined(DESKTOP_LINUX) && !defined(OS_MACOSX) |
| 28 // Default text and shadow colors for STYLE_BUTTON. | 30 // Default text and shadow colors for STYLE_BUTTON. |
| 29 const SkColor kStyleButtonTextColor = SK_ColorBLACK; | 31 const SkColor kStyleButtonTextColor = SK_ColorBLACK; |
| 30 const SkColor kStyleButtonShadowColor = SK_ColorWHITE; | 32 const SkColor kStyleButtonShadowColor = SK_ColorWHITE; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 | 51 |
| 50 // static | 52 // static |
| 51 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled, | 53 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled, |
| 52 Combobox::Style style) { | 54 Combobox::Style style) { |
| 53 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 55 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 54 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); | 56 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); |
| 55 } | 57 } |
| 56 | 58 |
| 57 // static | 59 // static |
| 58 std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { | 60 std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { |
| 61 #if defined(OS_CHROMEOS) |
| 62 return base::MakeUnique<OverlayScrollBar>(is_horizontal); |
| 63 #else |
| 59 return base::MakeUnique<ScrollBarViews>(is_horizontal); | 64 return base::MakeUnique<ScrollBarViews>(is_horizontal); |
| 65 #endif |
| 60 } | 66 } |
| 61 | 67 |
| 62 // static | 68 // static |
| 63 SkColor PlatformStyle::TextColorForButton( | 69 SkColor PlatformStyle::TextColorForButton( |
| 64 const ButtonColorByState& color_by_state, | 70 const ButtonColorByState& color_by_state, |
| 65 const LabelButton& button) { | 71 const LabelButton& button) { |
| 66 return color_by_state[button.state()]; | 72 return color_by_state[button.state()]; |
| 67 } | 73 } |
| 68 | 74 |
| 69 // static | 75 // static |
| (...skipping 18 matching lines...) Expand all Loading... |
| 88 | 94 |
| 89 #if !defined(DESKTOP_LINUX) | 95 #if !defined(DESKTOP_LINUX) |
| 90 // static | 96 // static |
| 91 std::unique_ptr<Border> PlatformStyle::CreateThemedLabelButtonBorder( | 97 std::unique_ptr<Border> PlatformStyle::CreateThemedLabelButtonBorder( |
| 92 LabelButton* button) { | 98 LabelButton* button) { |
| 93 return button->CreateDefaultBorder(); | 99 return button->CreateDefaultBorder(); |
| 94 } | 100 } |
| 95 #endif | 101 #endif |
| 96 | 102 |
| 97 } // namespace views | 103 } // namespace views |
| OLD | NEW |