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 "chrome/browser/ui/libgtk2ui/gtk2_util.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 void ClearAuraTransientParent(GtkWidget* dialog) { | 129 void ClearAuraTransientParent(GtkWidget* dialog) { |
130 g_object_set_data(G_OBJECT(dialog), kAuraTransientParent, NULL); | 130 g_object_set_data(G_OBJECT(dialog), kAuraTransientParent, NULL); |
131 } | 131 } |
132 | 132 |
133 GtkStateType GetGtkState(ui::NativeTheme::State state) { | 133 GtkStateType GetGtkState(ui::NativeTheme::State state) { |
134 switch (state) { | 134 switch (state) { |
135 case ui::NativeTheme::kDisabled: return GTK_STATE_INSENSITIVE; | 135 case ui::NativeTheme::kDisabled: return GTK_STATE_INSENSITIVE; |
136 case ui::NativeTheme::kHovered: return GTK_STATE_PRELIGHT; | 136 case ui::NativeTheme::kHovered: return GTK_STATE_PRELIGHT; |
137 case ui::NativeTheme::kNormal: return GTK_STATE_NORMAL; | 137 case ui::NativeTheme::kNormal: return GTK_STATE_NORMAL; |
138 case ui::NativeTheme::kPressed: return GTK_STATE_ACTIVE; | 138 case ui::NativeTheme::kPressed: return GTK_STATE_ACTIVE; |
139 case ui::NativeTheme::kMaxState: NOTREACHED() << "Unknown state: " << state; | 139 default: NOTREACHED(); return GTK_STATE_NORMAL; |
sky
2014/07/10 16:05:39
I like the old version better as if a new state is
Peter Kasting
2014/07/10 18:23:15
That's correct, but you do still get a runtime err
sky
2014/07/10 19:33:09
I way prefer the compile time error than a runtime
Peter Kasting
2014/07/10 21:44:25
Done.
| |
140 } | 140 } |
141 return GTK_STATE_NORMAL; | |
142 } | 141 } |
143 | 142 |
144 } // namespace libgtk2ui | 143 } // namespace libgtk2ui |
OLD | NEW |