| 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 "ui/gfx/native_theme_base.h" | 5 #include "ui/base/native_theme/native_theme_base.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "grit/gfx_resources.h" | 10 #include "grit/gfx_resources.h" |
| 11 #include "third_party/skia/include/effects/SkGradientShader.h" | 11 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/gfx/color_utils.h" | 13 #include "ui/gfx/color_utils.h" |
| 14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/size.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 44 if (adjusted.l > 1.0) | 44 if (adjusted.l > 1.0) |
| 45 adjusted.l = 1.0; | 45 adjusted.l = 1.0; |
| 46 if (adjusted.l < 0.0) | 46 if (adjusted.l < 0.0) |
| 47 adjusted.l = 0.0; | 47 adjusted.l = 0.0; |
| 48 | 48 |
| 49 return color_utils::HSLToSkColor(adjusted, alpha); | 49 return color_utils::HSLToSkColor(adjusted, alpha); |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 namespace gfx { | 54 namespace ui { |
| 55 | 55 |
| 56 gfx::Size NativeThemeBase::GetPartSize(Part part, | 56 gfx::Size NativeThemeBase::GetPartSize(Part part, |
| 57 State state, | 57 State state, |
| 58 const ExtraParams& extra) const { | 58 const ExtraParams& extra) const { |
| 59 switch (part) { | 59 switch (part) { |
| 60 // Please keep these in the order of NativeTheme::Part. | 60 // Please keep these in the order of NativeTheme::Part. |
| 61 case kCheckbox: | 61 case kCheckbox: |
| 62 return gfx::Size(kCheckboxAndRadioWidth, kCheckboxAndRadioHeight); | 62 return gfx::Size(kCheckboxAndRadioWidth, kCheckboxAndRadioHeight); |
| 63 case kInnerSpinButton: | 63 case kInnerSpinButton: |
| 64 return gfx::Size(scrollbar_width_, 0); | 64 return gfx::Size(scrollbar_width_, 0); |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 // default GTK themes. | 963 // default GTK themes. |
| 964 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); | 964 SkScalar min_diff = Clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f); |
| 965 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); | 965 SkScalar diff = Clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f); |
| 966 | 966 |
| 967 if (hsv1[2] + hsv2[2] > 1.0) | 967 if (hsv1[2] + hsv2[2] > 1.0) |
| 968 diff = -diff; | 968 diff = -diff; |
| 969 | 969 |
| 970 return SaturateAndBrighten(hsv2, -0.2f, diff); | 970 return SaturateAndBrighten(hsv2, -0.2f, diff); |
| 971 } | 971 } |
| 972 | 972 |
| 973 } // namespace gfx | 973 } // namespace ui |
| OLD | NEW |