| 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/gtk/custom_button.h" | 5 #include "chrome/browser/ui/gtk/custom_button.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" | 10 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" |
| 11 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 11 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 12 #include "chrome/browser/ui/gtk/gtk_util.h" | 12 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "content/public/browser/notification_source.h" | 14 #include "content/public/browser/notification_source.h" |
| 15 #include "grit/theme_resources_standard.h" | 15 #include "grit/ui_resources_standard.h" |
| 16 #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" | 17 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/gfx/gtk_util.h" | 18 #include "ui/gfx/gtk_util.h" |
| 19 #include "ui/gfx/image/cairo_cached_surface.h" | 19 #include "ui/gfx/image/cairo_cached_surface.h" |
| 20 #include "ui/gfx/skbitmap_operations.h" | 20 #include "ui/gfx/skbitmap_operations.h" |
| 21 | 21 |
| 22 CustomDrawButtonBase::CustomDrawButtonBase(GtkThemeService* theme_provider, | 22 CustomDrawButtonBase::CustomDrawButtonBase(GtkThemeService* theme_provider, |
| 23 int normal_id, | 23 int normal_id, |
| 24 int pressed_id, | 24 int pressed_id, |
| 25 int hover_id, | 25 int hover_id, |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 | 370 |
| 371 gtk_chrome_button_set_use_gtk_rendering( | 371 gtk_chrome_button_set_use_gtk_rendering( |
| 372 GTK_CHROME_BUTTON(widget()), UseGtkTheme()); | 372 GTK_CHROME_BUTTON(widget()), UseGtkTheme()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 bool CustomDrawButton::UseGtkTheme() { | 375 bool CustomDrawButton::UseGtkTheme() { |
| 376 return !forcing_chrome_theme_ && theme_service_ && | 376 return !forcing_chrome_theme_ && theme_service_ && |
| 377 theme_service_->UsingNativeTheme(); | 377 theme_service_->UsingNativeTheme(); |
| 378 } | 378 } |
| OLD | NEW |