OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native_theme_gtk2.h" | 5 #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_menu_subclasses.h" | 9 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_menu_subclasses.h" |
10 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" | 10 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 NativeTheme::kColorId_FocusedMenuItemBackgroundColor); | 164 NativeTheme::kColorId_FocusedMenuItemBackgroundColor); |
165 paint.setColor(color); | 165 paint.setColor(color); |
166 break; | 166 break; |
167 default: | 167 default: |
168 NOTREACHED() << "Invalid state " << state; | 168 NOTREACHED() << "Invalid state " << state; |
169 break; | 169 break; |
170 } | 170 } |
171 canvas->drawRect(gfx::RectToSkRect(rect), paint); | 171 canvas->drawRect(gfx::RectToSkRect(rect), paint); |
172 } | 172 } |
173 | 173 |
| 174 void NativeThemeGtk2::NotifyNativeThemeObservers() { |
| 175 NotifyObservers(); |
| 176 } |
| 177 |
174 GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const { | 178 GdkColor NativeThemeGtk2::GetSystemGdkColor(ColorId color_id) const { |
175 switch (color_id) { | 179 switch (color_id) { |
176 // Windows | 180 // Windows |
177 case kColorId_WindowBackground: | 181 case kColorId_WindowBackground: |
178 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; | 182 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; |
179 | 183 |
180 // Dialogs | 184 // Dialogs |
181 case kColorId_DialogBackground: | 185 case kColorId_DialogBackground: |
182 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; | 186 return GetWindowStyle()->bg[GTK_STATE_NORMAL]; |
183 | 187 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 fake_menu_.Own(gtk_custom_menu_new()); | 392 fake_menu_.Own(gtk_custom_menu_new()); |
389 | 393 |
390 fake_menu_item_ = gtk_custom_menu_item_new(); | 394 fake_menu_item_ = gtk_custom_menu_item_new(); |
391 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); | 395 gtk_menu_shell_append(GTK_MENU_SHELL(fake_menu_.get()), fake_menu_item_); |
392 } | 396 } |
393 | 397 |
394 return gtk_rc_get_style(fake_menu_item_); | 398 return gtk_rc_get_style(fake_menu_item_); |
395 } | 399 } |
396 | 400 |
397 } // namespace libgtk2ui | 401 } // namespace libgtk2ui |
OLD | NEW |