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

Side by Side Diff: chromecast/port/ui/native_theme/native_theme_cast.cc

Issue 223143003: Initial checkin of chromecast content embedder (cast_shell) and related build scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an additional function in gl_surface_cast.cc Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 "chromecast/port/ui/native_theme/native_theme_cast.h"
6 6
7 #include <gtk/gtk.h>
8
9 #include "base/basictypes.h"
10 #include "base/logging.h" 7 #include "base/logging.h"
11 #include "ui/gfx/skia_utils_gtk.h"
12 8
13 namespace { 9 namespace {
14 10
15 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); 11 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128);
16 12
17 // Theme colors returned by GetSystemColor(). 13 // Theme colors returned by GetSystemColor().
18 14
19 // FocusableBorder: 15 // FocusableBorder:
20 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); 16 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE);
21 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); 17 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9);
(...skipping 13 matching lines...) Expand all
35 const SkColor kButtonDisabledColor = SkColorSetRGB(161, 161, 146); 31 const SkColor kButtonDisabledColor = SkColorSetRGB(161, 161, 146);
36 const SkColor kButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255); 32 const SkColor kButtonHighlightColor = SkColorSetARGB(200, 255, 255, 255);
37 const SkColor kButtonHoverColor = kButtonEnabledColor; 33 const SkColor kButtonHoverColor = kButtonEnabledColor;
38 34
39 } // namespace 35 } // namespace
40 36
41 namespace ui { 37 namespace ui {
42 38
43 // static 39 // static
44 NativeTheme* NativeTheme::instance() { 40 NativeTheme* NativeTheme::instance() {
45 return NativeThemeGtk::instance(); 41 return NativeThemeCast::instance();
46 } 42 }
47 43
48 // static 44 NativeThemeCast* NativeThemeCast::instance() {
49 NativeThemeGtk* NativeThemeGtk::instance() { 45 CR_DEFINE_STATIC_LOCAL(NativeThemeCast, s_native_theme, ());
50 CR_DEFINE_STATIC_LOCAL(NativeThemeGtk, s_native_theme, ());
51 return &s_native_theme; 46 return &s_native_theme;
52 } 47 }
53 48
54 SkColor NativeThemeGtk::GetSystemColor(ColorId color_id) const { 49 SkColor NativeThemeCast::GetSystemColor(ColorId color_id) const {
55 switch (color_id) { 50 switch (color_id) {
56 case kColorId_DialogBackground: 51 case kColorId_DialogBackground:
57 // TODO(benrg): This code used to call gtk_widget_get_style() on the 52 return kButtonDisabledColor;
58 // widget being styled. After refactoring, that widget is not available
59 // and we have to call gtk_widget_get_default_style(). Unfortunately,
60 // it turns out that this breaks everything (chromium bug 105609,
61 // chromium-os bug 23461). Need to figure out the right thing and do it.
62 return gfx::GdkColorToSkColor(
63 gtk_widget_get_default_style()->bg[GTK_STATE_NORMAL]);
64 53
65 // FocusableBorder: 54 // FocusableBorder:
66 case kColorId_FocusedBorderColor: 55 case kColorId_FocusedBorderColor:
67 return kFocusedBorderColor; 56 return kFocusedBorderColor;
68 case kColorId_UnfocusedBorderColor: 57 case kColorId_UnfocusedBorderColor:
69 return kUnfocusedBorderColor; 58 return kUnfocusedBorderColor;
70 59
71 // MenuItem 60 // MenuItem
72 case kColorId_FocusedMenuItemBackgroundColor: 61 case kColorId_FocusedMenuItemBackgroundColor:
73 return kFocusedMenuItemBackgroundColor; 62 return kFocusedMenuItemBackgroundColor;
(...skipping 18 matching lines...) Expand all
92 case kColorId_ButtonHoverColor: 81 case kColorId_ButtonHoverColor:
93 return kButtonHoverColor; 82 return kButtonHoverColor;
94 83
95 default: 84 default:
96 NOTREACHED() << "Invalid color_id: " << color_id; 85 NOTREACHED() << "Invalid color_id: " << color_id;
97 break; 86 break;
98 } 87 }
99 return kInvalidColorIdColor; 88 return kInvalidColorIdColor;
100 } 89 }
101 90
102 NativeThemeGtk::NativeThemeGtk() { 91 NativeThemeCast::NativeThemeCast() {
103 } 92 }
104 93
105 NativeThemeGtk::~NativeThemeGtk() { 94 NativeThemeCast::~NativeThemeCast() {
106 } 95 }
107 96
108 } // namespace ui 97 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698