Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Side by Side Diff: chrome/browser/ui/gtk/task_manager_gtk.cc

Issue 7582025: gtk: Add keyboard accelerator to kill a process/plug-in in Task Manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if (!gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(process_list_), &iter, 359 if (!gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(process_list_), &iter,
360 NULL, start)) { 360 NULL, start)) {
361 NOTREACHED() << "Can't get child " << start << 361 NOTREACHED() << "Can't get child " << start <<
362 " from GTK_TREE_MODEL(process_list_)"; 362 " from GTK_TREE_MODEL(process_list_)";
363 } 363 }
364 364
365 for (int i = start; i < start + length; i++) { 365 for (int i = start; i < start + length; i++) {
366 SetRowDataFromModel(i, &iter); 366 SetRowDataFromModel(i, &iter);
367 if (i != start + length - 1) { 367 if (i != start + length - 1) {
368 if (!gtk_tree_model_iter_next(GTK_TREE_MODEL(process_list_), &iter)) { 368 if (!gtk_tree_model_iter_next(GTK_TREE_MODEL(process_list_), &iter)) {
369 NOTREACHED() << "Can't get next GtkTreeIter object from process_list_ \ 369 NOTREACHED() << "Can't get next GtkTreeIter object from process_list_ "
370 iterator at position " << i; 370 "iterator at position " << i;
371 } 371 }
372 } 372 }
373 } 373 }
374 } 374 }
375 375
376 void TaskManagerGtk::OnItemsAdded(int start, int length) { 376 void TaskManagerGtk::OnItemsAdded(int start, int length) {
377 AutoReset<bool> autoreset(&ignore_selection_changed_, true); 377 AutoReset<bool> autoreset(&ignore_selection_changed_, true);
378 378
379 GtkTreeIter iter; 379 GtkTreeIter iter;
380 if (start == 0) { 380 if (start == 0) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 kTaskManagerPurgeMemory); 469 kTaskManagerPurgeMemory);
470 } 470 }
471 471
472 if (browser_defaults::kShowCancelButtonInTaskManager) { 472 if (browser_defaults::kShowCancelButtonInTaskManager) {
473 gtk_dialog_add_button(GTK_DIALOG(dialog_), 473 gtk_dialog_add_button(GTK_DIALOG(dialog_),
474 l10n_util::GetStringUTF8(IDS_CLOSE).c_str(), 474 l10n_util::GetStringUTF8(IDS_CLOSE).c_str(),
475 GTK_RESPONSE_DELETE_EVENT); 475 GTK_RESPONSE_DELETE_EVENT);
476 } 476 }
477 477
478 gtk_dialog_add_button(GTK_DIALOG(dialog_), 478 gtk_dialog_add_button(GTK_DIALOG(dialog_),
479 l10n_util::GetStringUTF8(IDS_TASK_MANAGER_KILL).c_str(), 479 gfx::ConvertAcceleratorsFromWindowsStyle(
480 l10n_util::GetStringUTF8(IDS_TASK_MANAGER_KILL)).c_str(),
480 kTaskManagerResponseKill); 481 kTaskManagerResponseKill);
481 482
482 // The response button should not be sensitive when the dialog is first opened 483 // The response button should not be sensitive when the dialog is first opened
483 // because the selection is initially empty. 484 // because the selection is initially empty.
484 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_), 485 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_),
485 kTaskManagerResponseKill, FALSE); 486 kTaskManagerResponseKill, FALSE);
486 487
487 GtkWidget* link = gtk_chrome_link_button_new( 488 GtkWidget* link = gtk_chrome_link_button_new(
488 l10n_util::GetStringUTF8(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK).c_str()); 489 l10n_util::GetStringUTF8(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK).c_str());
489 gtk_dialog_add_action_widget(GTK_DIALOG(dialog_), link, 490 gtk_dialog_add_action_widget(GTK_DIALOG(dialog_), link,
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 guint keyval, 1012 guint keyval,
1012 GdkModifierType modifier) { 1013 GdkModifierType modifier) {
1013 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) { 1014 if (keyval == GDK_w && modifier == GDK_CONTROL_MASK) {
1014 // 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
1015 // is destroyed. The deleted object will receive gtk signals otherwise. 1016 // is destroyed. The deleted object will receive gtk signals otherwise.
1016 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT); 1017 gtk_dialog_response(GTK_DIALOG(dialog_), GTK_RESPONSE_DELETE_EVENT);
1017 } 1018 }
1018 1019
1019 return TRUE; 1020 return TRUE;
1020 } 1021 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698