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/libgtkui/gtk_ui.h" | 5 #include "chrome/browser/ui/libgtkui/gtk_ui.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
9 #include <X11/Xcursor/Xcursor.h> | 9 #include <X11/Xcursor/Xcursor.h> |
10 #include <set> | 10 #include <set> |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/ui/libgtkui/gtk_util.h" | 29 #include "chrome/browser/ui/libgtkui/gtk_util.h" |
30 #include "chrome/browser/ui/libgtkui/native_theme_gtk.h" | 30 #include "chrome/browser/ui/libgtkui/native_theme_gtk.h" |
31 #include "chrome/browser/ui/libgtkui/print_dialog_gtk.h" | 31 #include "chrome/browser/ui/libgtkui/print_dialog_gtk.h" |
32 #include "chrome/browser/ui/libgtkui/printing_gtk_util.h" | 32 #include "chrome/browser/ui/libgtkui/printing_gtk_util.h" |
33 #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h" | 33 #include "chrome/browser/ui/libgtkui/select_file_dialog_impl.h" |
34 #include "chrome/browser/ui/libgtkui/skia_utils_gtk.h" | 34 #include "chrome/browser/ui/libgtkui/skia_utils_gtk.h" |
35 #include "chrome/browser/ui/libgtkui/unity_service.h" | 35 #include "chrome/browser/ui/libgtkui/unity_service.h" |
36 #include "chrome/browser/ui/libgtkui/x11_input_method_context_impl_gtk.h" | 36 #include "chrome/browser/ui/libgtkui/x11_input_method_context_impl_gtk.h" |
37 #include "chrome/grit/theme_resources.h" | 37 #include "chrome/grit/theme_resources.h" |
38 #include "components/grit/components_scaled_resources.h" | 38 #include "components/grit/components_scaled_resources.h" |
| 39 #include "printing/features/features.h" |
39 #include "third_party/skia/include/core/SkBitmap.h" | 40 #include "third_party/skia/include/core/SkBitmap.h" |
40 #include "third_party/skia/include/core/SkCanvas.h" | 41 #include "third_party/skia/include/core/SkCanvas.h" |
41 #include "third_party/skia/include/core/SkColor.h" | 42 #include "third_party/skia/include/core/SkColor.h" |
42 #include "third_party/skia/include/core/SkShader.h" | 43 #include "third_party/skia/include/core/SkShader.h" |
43 #include "ui/base/resource/resource_bundle.h" | 44 #include "ui/base/resource/resource_bundle.h" |
44 #include "ui/display/display.h" | 45 #include "ui/display/display.h" |
45 #include "ui/gfx/canvas.h" | 46 #include "ui/gfx/canvas.h" |
46 #include "ui/gfx/geometry/rect.h" | 47 #include "ui/gfx/geometry/rect.h" |
47 #include "ui/gfx/geometry/size.h" | 48 #include "ui/gfx/geometry/size.h" |
48 #include "ui/gfx/image/image.h" | 49 #include "ui/gfx/image/image.h" |
49 #include "ui/gfx/image/image_skia_source.h" | 50 #include "ui/gfx/image/image_skia_source.h" |
50 #include "ui/gfx/skbitmap_operations.h" | 51 #include "ui/gfx/skbitmap_operations.h" |
51 #include "ui/gfx/skia_util.h" | 52 #include "ui/gfx/skia_util.h" |
52 #include "ui/gfx/x/x11_types.h" | 53 #include "ui/gfx/x/x11_types.h" |
53 #include "ui/native_theme/native_theme.h" | 54 #include "ui/native_theme/native_theme.h" |
54 #include "ui/resources/grit/ui_resources.h" | 55 #include "ui/resources/grit/ui_resources.h" |
55 #include "ui/views/controls/button/blue_button.h" | 56 #include "ui/views/controls/button/blue_button.h" |
56 #include "ui/views/controls/button/label_button.h" | 57 #include "ui/views/controls/button/label_button.h" |
57 #include "ui/views/controls/button/label_button_border.h" | 58 #include "ui/views/controls/button/label_button_border.h" |
58 #include "ui/views/linux_ui/window_button_order_observer.h" | 59 #include "ui/views/linux_ui/window_button_order_observer.h" |
59 #include "ui/views/resources/grit/views_resources.h" | 60 #include "ui/views/resources/grit/views_resources.h" |
60 | 61 |
61 #if defined(ENABLE_BASIC_PRINTING) | 62 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
62 #include "printing/printing_context_linux.h" | 63 #include "printing/printing_context_linux.h" |
63 #endif | 64 #endif |
64 #if defined(USE_GCONF) | 65 #if defined(USE_GCONF) |
65 #include "chrome/browser/ui/libgtkui/gconf_listener.h" | 66 #include "chrome/browser/ui/libgtkui/gconf_listener.h" |
66 #endif | 67 #endif |
67 | 68 |
68 // A minimized port of GtkThemeService into something that can provide colors | 69 // A minimized port of GtkThemeService into something that can provide colors |
69 // and images for aura. | 70 // and images for aura. |
70 // | 71 // |
71 // TODO(erg): There's still a lot that needs ported or done for the first time: | 72 // TODO(erg): There's still a lot that needs ported or done for the first time: |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 GtkSettings* settings = gtk_settings_get_default(); | 427 GtkSettings* settings = gtk_settings_get_default(); |
427 g_signal_connect_after(settings, "notify::gtk-theme-name", | 428 g_signal_connect_after(settings, "notify::gtk-theme-name", |
428 G_CALLBACK(OnThemeChanged), this); | 429 G_CALLBACK(OnThemeChanged), this); |
429 g_signal_connect_after(settings, "notify::gtk-icon-theme-name", | 430 g_signal_connect_after(settings, "notify::gtk-icon-theme-name", |
430 G_CALLBACK(OnThemeChanged), this); | 431 G_CALLBACK(OnThemeChanged), this); |
431 | 432 |
432 LoadGtkValues(); | 433 LoadGtkValues(); |
433 | 434 |
434 LoadCursorTheme(); | 435 LoadCursorTheme(); |
435 | 436 |
436 #if defined(ENABLE_BASIC_PRINTING) | 437 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
437 printing::PrintingContextLinux::SetCreatePrintDialogFunction( | 438 printing::PrintingContextLinux::SetCreatePrintDialogFunction( |
438 &PrintDialogGtk2::CreatePrintDialog); | 439 &PrintDialogGtk2::CreatePrintDialog); |
439 printing::PrintingContextLinux::SetPdfPaperSizeFunction( | 440 printing::PrintingContextLinux::SetPdfPaperSizeFunction( |
440 &GetPdfPaperSizeDeviceUnitsGtk); | 441 &GetPdfPaperSizeDeviceUnitsGtk); |
441 #endif | 442 #endif |
442 | 443 |
443 #if defined(USE_GCONF) | 444 #if defined(USE_GCONF) |
444 // We must build this after GTK gets initialized. | 445 // We must build this after GTK gets initialized. |
445 gconf_listener_.reset(new GConfListener(this)); | 446 gconf_listener_.reset(new GConfListener(this)); |
446 #endif // defined(USE_GCONF) | 447 #endif // defined(USE_GCONF) |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 // Blacklist scaling factors <130% (crbug.com/484400) and round | 1066 // Blacklist scaling factors <130% (crbug.com/484400) and round |
1066 // to 1 decimal to prevent rendering problems (crbug.com/485183). | 1067 // to 1 decimal to prevent rendering problems (crbug.com/485183). |
1067 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; | 1068 return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; |
1068 } | 1069 } |
1069 | 1070 |
1070 } // namespace libgtkui | 1071 } // namespace libgtkui |
1071 | 1072 |
1072 views::LinuxUI* BuildGtk2UI() { | 1073 views::LinuxUI* BuildGtk2UI() { |
1073 return new libgtkui::Gtk2UI; | 1074 return new libgtkui::Gtk2UI; |
1074 } | 1075 } |
OLD | NEW |