| 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/native_theme/native_theme_gtk.h" | 5 #include "ui/native_theme/native_theme_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "ui/gfx/skia_utils_gtk.h" | 11 #include "ui/gfx/skia_utils_gtk.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); | 15 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); |
| 16 | 16 |
| 17 // Theme colors returned by GetSystemColor(). | 17 // Theme colors returned by GetSystemColor(). |
| 18 | 18 |
| 19 // FocusableBorder: | 19 // FocusableBorder: |
| 20 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); | 20 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); |
| 21 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); | 21 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); |
| 22 | 22 |
| 23 // MenuItem |
| 24 const SkColor kHoverMenuItemBackgroundColor = SkColorSetRGB(204, 204, 204); |
| 25 |
| 23 // TextButton: | 26 // TextButton: |
| 24 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde); | 27 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xde, 0xde, 0xde); |
| 25 const SkColor kTextButtonEnabledColor = SkColorSetRGB(6, 45, 117); | 28 const SkColor kTextButtonEnabledColor = SkColorSetRGB(6, 45, 117); |
| 26 const SkColor kTextButtonDisabledColor = SkColorSetRGB(161, 161, 146); | 29 const SkColor kTextButtonDisabledColor = SkColorSetRGB(161, 161, 146); |
| 27 const SkColor kTextButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); | 30 const SkColor kTextButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); |
| 28 const SkColor kTextButtonHoverColor = kTextButtonEnabledColor; | 31 const SkColor kTextButtonHoverColor = kTextButtonEnabledColor; |
| 29 | 32 |
| 30 } // namespace | 33 } // namespace |
| 31 | 34 |
| 32 namespace ui { | 35 namespace ui { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 52 // chromium-os bug 23461). Need to figure out the right thing and do it. | 55 // chromium-os bug 23461). Need to figure out the right thing and do it. |
| 53 return gfx::GdkColorToSkColor( | 56 return gfx::GdkColorToSkColor( |
| 54 gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]); | 57 gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]); |
| 55 | 58 |
| 56 // FocusableBorder: | 59 // FocusableBorder: |
| 57 case kColorId_FocusedBorderColor: | 60 case kColorId_FocusedBorderColor: |
| 58 return kFocusedBorderColor; | 61 return kFocusedBorderColor; |
| 59 case kColorId_UnfocusedBorderColor: | 62 case kColorId_UnfocusedBorderColor: |
| 60 return kUnfocusedBorderColor; | 63 return kUnfocusedBorderColor; |
| 61 | 64 |
| 65 // MenuItem |
| 66 case kColorId_HoverMenuItemBackgroundColor: |
| 67 return kHoverMenuItemBackgroundColor; |
| 68 |
| 62 // TextButton: | 69 // TextButton: |
| 63 case kColorId_TextButtonBackgroundColor: | 70 case kColorId_TextButtonBackgroundColor: |
| 64 return kTextButtonBackgroundColor; | 71 return kTextButtonBackgroundColor; |
| 65 case kColorId_TextButtonEnabledColor: | 72 case kColorId_TextButtonEnabledColor: |
| 66 return kTextButtonEnabledColor; | 73 return kTextButtonEnabledColor; |
| 67 case kColorId_TextButtonDisabledColor: | 74 case kColorId_TextButtonDisabledColor: |
| 68 return kTextButtonDisabledColor; | 75 return kTextButtonDisabledColor; |
| 69 case kColorId_TextButtonHighlightColor: | 76 case kColorId_TextButtonHighlightColor: |
| 70 return kTextButtonHighlightColor; | 77 return kTextButtonHighlightColor; |
| 71 case kColorId_TextButtonHoverColor: | 78 case kColorId_TextButtonHoverColor: |
| 72 return kTextButtonHoverColor; | 79 return kTextButtonHoverColor; |
| 73 | 80 |
| 74 default: | 81 default: |
| 75 NOTREACHED() << "Invalid color_id: " << color_id; | 82 NOTREACHED() << "Invalid color_id: " << color_id; |
| 76 break; | 83 break; |
| 77 } | 84 } |
| 78 return kInvalidColorIdColor; | 85 return kInvalidColorIdColor; |
| 79 } | 86 } |
| 80 | 87 |
| 81 NativeThemeGtk::NativeThemeGtk() { | 88 NativeThemeGtk::NativeThemeGtk() { |
| 82 } | 89 } |
| 83 | 90 |
| 84 NativeThemeGtk::~NativeThemeGtk() { | 91 NativeThemeGtk::~NativeThemeGtk() { |
| 85 } | 92 } |
| 86 | 93 |
| 87 } // namespace ui | 94 } // namespace ui |
| OLD | NEW |