| 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/task_manager_gtk.h" | 5 #include "chrome/browser/ui/gtk/task_manager_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 22 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 23 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 23 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 24 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 24 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 25 #include "chrome/browser/ui/gtk/gtk_tree.h" | 25 #include "chrome/browser/ui/gtk/gtk_tree.h" |
| 26 #include "chrome/browser/ui/gtk/gtk_util.h" | 26 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "grit/chromium_strings.h" | 29 #include "grit/chromium_strings.h" |
| 30 #include "grit/ui_resources.h" | 30 #include "grit/ui_resources.h" |
| 31 #include "third_party/skia/include/core/SkBitmap.h" | 31 #include "third_party/skia/include/core/SkBitmap.h" |
| 32 #include "ui/base/gtk/gtk_hig_constants.h" | |
| 33 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 34 #include "ui/base/models/simple_menu_model.h" | 33 #include "ui/base/models/simple_menu_model.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 36 #include "ui/gfx/gtk_util.h" | 35 #include "ui/gfx/gtk_util.h" |
| 37 | 36 |
| 38 #if defined(TOOLKIT_VIEWS) | 37 #if defined(TOOLKIT_VIEWS) |
| 39 #include "views/controls/menu/menu_2.h" | 38 #include "views/controls/menu/menu_2.h" |
| 40 #else | 39 #else |
| 41 #include "chrome/browser/ui/gtk/menu_gtk.h" | 40 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 42 #endif | 41 #endif |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 kTaskManagerAboutMemoryLink); | 491 kTaskManagerAboutMemoryLink); |
| 493 | 492 |
| 494 // Setting the link widget to secondary positions the button on the left side | 493 // Setting the link widget to secondary positions the button on the left side |
| 495 // of the action area (vice versa for RTL layout). | 494 // of the action area (vice versa for RTL layout). |
| 496 gtk_button_box_set_child_secondary( | 495 gtk_button_box_set_child_secondary( |
| 497 GTK_BUTTON_BOX(GTK_DIALOG(dialog_)->action_area), link, TRUE); | 496 GTK_BUTTON_BOX(GTK_DIALOG(dialog_)->action_area), link, TRUE); |
| 498 | 497 |
| 499 ConnectAccelerators(); | 498 ConnectAccelerators(); |
| 500 | 499 |
| 501 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), | 500 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), |
| 502 ui::kContentAreaSpacing); | 501 gtk_util::kContentAreaSpacing); |
| 503 | 502 |
| 504 destroy_handler_id_ = g_signal_connect(dialog_, "destroy", | 503 destroy_handler_id_ = g_signal_connect(dialog_, "destroy", |
| 505 G_CALLBACK(OnDestroyThunk), this); | 504 G_CALLBACK(OnDestroyThunk), this); |
| 506 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); | 505 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
| 507 // GTK does menu on mouse-up while views does menu on mouse-down, | 506 // GTK does menu on mouse-up while views does menu on mouse-down, |
| 508 // so connect to different handlers. | 507 // so connect to different handlers. |
| 509 #if defined(TOOLKIT_VIEWS) | 508 #if defined(TOOLKIT_VIEWS) |
| 510 g_signal_connect(dialog_, "button-release-event", | 509 g_signal_connect(dialog_, "button-release-event", |
| 511 G_CALLBACK(OnButtonEventThunk), this); | 510 G_CALLBACK(OnButtonEventThunk), this); |
| 512 #else | 511 #else |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 guint keyval, | 1012 guint keyval, |
| 1014 GdkModifierType modifier) { | 1013 GdkModifierType modifier) { |
| 1015 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { | 1014 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { |
| 1016 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget | 1015 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget |
| 1017 // is destroyed. The deleted object will receive gtk signals otherwise. | 1016 // is destroyed. The deleted object will receive gtk signals otherwise. |
| 1018 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); | 1017 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); |
| 1019 } | 1018 } |
| 1020 | 1019 |
| 1021 return TRUE; | 1020 return TRUE; |
| 1022 } | 1021 } |
| OLD | NEW |