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

Side by Side Diff: ui/base/native_theme/native_theme_base.cc

Issue 10310136: ui: Move NativeTheme files into ui/base/native_theme/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 8 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/native_theme/native_theme_base.h ('k') | ui/base/native_theme/native_theme_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
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
OLDNEW
« no previous file with comments | « ui/base/native_theme/native_theme_base.h ('k') | ui/base/native_theme/native_theme_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698