OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/custom_button.h" | 5 #include "chrome/browser/ui/gtk/custom_button.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | |
8 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
9 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" | 8 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" |
10 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" | 9 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" |
11 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" | 10 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
12 #include "chrome/browser/ui/gtk/gtk_util.h" | 11 #include "chrome/browser/ui/gtk/gtk_util.h" |
13 #include "chrome/common/notification_service.h" | 12 #include "chrome/common/notification_service.h" |
14 #include "gfx/gtk_util.h" | 13 #include "gfx/gtk_util.h" |
15 #include "gfx/skbitmap_operations.h" | 14 #include "gfx/skbitmap_operations.h" |
16 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
17 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 #include "ui/base/resource/resource_bundle.h" |
18 | 18 |
19 CustomDrawButtonBase::CustomDrawButtonBase(GtkThemeProvider* theme_provider, | 19 CustomDrawButtonBase::CustomDrawButtonBase(GtkThemeProvider* theme_provider, |
20 int normal_id, | 20 int normal_id, |
21 int pressed_id, | 21 int pressed_id, |
22 int hover_id, | 22 int hover_id, |
23 int disabled_id) | 23 int disabled_id) |
24 : background_image_(NULL), | 24 : background_image_(NULL), |
25 paint_override_(-1), | 25 paint_override_(-1), |
26 normal_id_(normal_id), | 26 normal_id_(normal_id), |
27 pressed_id_(pressed_id), | 27 pressed_id_(pressed_id), |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 gtk_widget_set_app_paintable(widget(), TRUE); | 336 gtk_widget_set_app_paintable(widget(), TRUE); |
337 } | 337 } |
338 | 338 |
339 gtk_chrome_button_set_use_gtk_rendering( | 339 gtk_chrome_button_set_use_gtk_rendering( |
340 GTK_CHROME_BUTTON(widget()), UseGtkTheme()); | 340 GTK_CHROME_BUTTON(widget()), UseGtkTheme()); |
341 } | 341 } |
342 | 342 |
343 bool CustomDrawButton::UseGtkTheme() { | 343 bool CustomDrawButton::UseGtkTheme() { |
344 return theme_provider_ && theme_provider_->UseGtkTheme(); | 344 return theme_provider_ && theme_provider_->UseGtkTheme(); |
345 } | 345 } |
OLD | NEW |