| 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/gtk_util.h" | 5 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 6 | 6 |
| 7 #include <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cstdarg> | 10 #include <cstdarg> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "content/public/browser/render_view_host.h" | 31 #include "content/public/browser/render_view_host.h" |
| 32 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 33 #include "content/public/common/renderer_preferences.h" | 33 #include "content/public/common/renderer_preferences.h" |
| 34 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
| 35 #include "grit/theme_resources.h" | 35 #include "grit/theme_resources.h" |
| 36 #include "grit/theme_resources_standard.h" | 36 #include "grit/theme_resources_standard.h" |
| 37 #include "ui/base/events.h" | 37 #include "ui/base/events.h" |
| 38 #include "ui/base/gtk/gtk_compat.h" | 38 #include "ui/base/gtk/gtk_compat.h" |
| 39 #include "ui/base/gtk/gtk_hig_constants.h" | 39 #include "ui/base/gtk/gtk_hig_constants.h" |
| 40 #include "ui/base/gtk/gtk_screen_util.h" | 40 #include "ui/base/gtk/gtk_screen_util.h" |
| 41 #include "ui/base/gtk/menu_label_accelerator_util.h" |
| 41 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
| 42 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
| 43 #include "ui/base/text/text_elider.h" | 44 #include "ui/base/text/text_elider.h" |
| 44 #include "ui/base/x/x11_util.h" | 45 #include "ui/base/x/x11_util.h" |
| 45 #include "ui/gfx/image/cairo_cached_surface.h" | 46 #include "ui/gfx/image/cairo_cached_surface.h" |
| 46 #include "ui/gfx/image/image.h" | 47 #include "ui/gfx/image/image.h" |
| 47 #include "ui/gfx/linux_util.h" | |
| 48 | 48 |
| 49 // These conflict with base/tracked_objects.h, so need to come last. | 49 // These conflict with base/tracked_objects.h, so need to come last. |
| 50 #include <gdk/gdkx.h> // NOLINT | 50 #include <gdk/gdkx.h> // NOLINT |
| 51 #include <gtk/gtk.h> // NOLINT | 51 #include <gtk/gtk.h> // NOLINT |
| 52 | 52 |
| 53 using content::RenderWidgetHost; | 53 using content::RenderWidgetHost; |
| 54 using content::WebContents; | 54 using content::WebContents; |
| 55 | 55 |
| 56 namespace { | 56 namespace { |
| 57 | 57 |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 gtk_image_new_from_stock(stock_id, | 655 gtk_image_new_from_stock(stock_id, |
| 656 GTK_ICON_SIZE_BUTTON)); | 656 GTK_ICON_SIZE_BUTTON)); |
| 657 gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, | 657 gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, |
| 658 response_id); | 658 response_id); |
| 659 return button; | 659 return button; |
| 660 } | 660 } |
| 661 | 661 |
| 662 GtkWidget* BuildDialogButton(GtkWidget* dialog, int ids_id, | 662 GtkWidget* BuildDialogButton(GtkWidget* dialog, int ids_id, |
| 663 const gchar* stock_id) { | 663 const gchar* stock_id) { |
| 664 GtkWidget* button = gtk_button_new_with_mnemonic( | 664 GtkWidget* button = gtk_button_new_with_mnemonic( |
| 665 gfx::ConvertAcceleratorsFromWindowsStyle( | 665 ui::ConvertAcceleratorsFromWindowsStyle( |
| 666 l10n_util::GetStringUTF8(ids_id)).c_str()); | 666 l10n_util::GetStringUTF8(ids_id)).c_str()); |
| 667 gtk_button_set_image(GTK_BUTTON(button), | 667 gtk_button_set_image(GTK_BUTTON(button), |
| 668 gtk_image_new_from_stock(stock_id, | 668 gtk_image_new_from_stock(stock_id, |
| 669 GTK_ICON_SIZE_BUTTON)); | 669 GTK_ICON_SIZE_BUTTON)); |
| 670 return button; | 670 return button; |
| 671 } | 671 } |
| 672 | 672 |
| 673 GtkWidget* CreateEntryImageHBox(GtkWidget* entry, GtkWidget* image) { | 673 GtkWidget* CreateEntryImageHBox(GtkWidget* entry, GtkWidget* image) { |
| 674 GtkWidget* hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); | 674 GtkWidget* hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); |
| 675 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0); | 675 gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 | 1157 |
| 1158 void DoCopy(BrowserWindow* window) { | 1158 void DoCopy(BrowserWindow* window) { |
| 1159 DoCutCopyPaste(window, &RenderWidgetHost::Copy, "copy-clipboard"); | 1159 DoCutCopyPaste(window, &RenderWidgetHost::Copy, "copy-clipboard"); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 void DoPaste(BrowserWindow* window) { | 1162 void DoPaste(BrowserWindow* window) { |
| 1163 DoCutCopyPaste(window, &RenderWidgetHost::Paste, "paste-clipboard"); | 1163 DoCutCopyPaste(window, &RenderWidgetHost::Paste, "paste-clipboard"); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 } // namespace gtk_util | 1166 } // namespace gtk_util |
| OLD | NEW |