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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_), | 492 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_), |
493 kTaskManagerResponseKill, FALSE); | 493 kTaskManagerResponseKill, FALSE); |
494 | 494 |
495 GtkWidget* link = gtk_chrome_link_button_new( | 495 GtkWidget* link = gtk_chrome_link_button_new( |
496 l10n_util::GetStringUTF8(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK).c_str()); | 496 l10n_util::GetStringUTF8(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK).c_str()); |
497 gtk_dialog_add_action_widget(GTK_DIALOG(dialog_), link, | 497 gtk_dialog_add_action_widget(GTK_DIALOG(dialog_), link, |
498 kTaskManagerAboutMemoryLink); | 498 kTaskManagerAboutMemoryLink); |
499 | 499 |
500 // Setting the link widget to secondary positions the button on the left side | 500 // Setting the link widget to secondary positions the button on the left side |
501 // of the action area (vice versa for RTL layout). | 501 // of the action area (vice versa for RTL layout). |
502 gtk_button_box_set_child_secondary( | 502 GtkWidget* action_area = gtk_dialog_get_action_area(GTK_DIALOG(dialog_)); |
503 GTK_BUTTON_BOX(GTK_DIALOG(dialog_)->action_area), link, TRUE); | 503 gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(action_area), link, TRUE); |
504 | 504 |
505 ConnectAccelerators(); | 505 ConnectAccelerators(); |
506 | 506 |
507 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), | 507 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); |
508 ui::kContentAreaSpacing); | 508 gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing); |
509 | 509 |
510 destroy_handler_id_ = g_signal_connect(dialog_, "destroy", | 510 destroy_handler_id_ = g_signal_connect(dialog_, "destroy", |
511 G_CALLBACK(OnDestroyThunk), this); | 511 G_CALLBACK(OnDestroyThunk), this); |
512 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); | 512 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
513 // GTK does menu on mouse-up while views does menu on mouse-down, | 513 // GTK does menu on mouse-up while views does menu on mouse-down, |
514 // so connect to different handlers. | 514 // so connect to different handlers. |
515 #if defined(TOOLKIT_VIEWS) | 515 #if defined(TOOLKIT_VIEWS) |
516 g_signal_connect(dialog_, "button-release-event", | 516 g_signal_connect(dialog_, "button-release-event", |
517 G_CALLBACK(OnButtonEventThunk), this); | 517 G_CALLBACK(OnButtonEventThunk), this); |
518 #else | 518 #else |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 guint keyval, | 1037 guint keyval, |
1038 GdkModifierType modifier) { | 1038 GdkModifierType modifier) { |
1039 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { | 1039 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { |
1040 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget | 1040 // The GTK_RESPONSE_DELETE_EVENT response must be sent before the widget |
1041 // is destroyed. The deleted object will receive gtk signals otherwise. | 1041 // is destroyed. The deleted object will receive gtk signals otherwise. |
1042 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); | 1042 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); |
1043 } | 1043 } |
1044 | 1044 |
1045 return TRUE; | 1045 return TRUE; |
1046 } | 1046 } |
OLD | NEW |