OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_GTK_TASK_MANAGER_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_TASK_MANAGER_GTK_H_ |
6 #define CHROME_BROWSER_GTK_TASK_MANAGER_GTK_H_ | 6 #define CHROME_BROWSER_GTK_TASK_MANAGER_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Sets the treeview row data. |row| is an index into the model and |iter| | 45 // Sets the treeview row data. |row| is an index into the model and |iter| |
46 // is the current position in the treeview. | 46 // is the current position in the treeview. |
47 void SetRowDataFromModel(int row, GtkTreeIter* iter); | 47 void SetRowDataFromModel(int row, GtkTreeIter* iter); |
48 | 48 |
49 // Queries the treeview for the selected rows, and kills those processes. | 49 // Queries the treeview for the selected rows, and kills those processes. |
50 void KillSelectedProcesses(); | 50 void KillSelectedProcesses(); |
51 | 51 |
52 // Opens the context menu used to select the task manager columns. | 52 // Opens the context menu used to select the task manager columns. |
53 void ShowContextMenu(); | 53 void ShowContextMenu(); |
54 | 54 |
| 55 // Activates the tab associated with the focused row. |
| 56 void ActivateFocusedTab(); |
| 57 |
55 // response signal handler that notifies us of dialog responses. | 58 // response signal handler that notifies us of dialog responses. |
56 static void OnResponse(GtkDialog* dialog, gint response_id, | 59 static void OnResponse(GtkDialog* dialog, gint response_id, |
57 TaskManagerGtk* task_manager); | 60 TaskManagerGtk* task_manager); |
58 | 61 |
59 // changed signal handler that is sent when the treeview selection changes. | 62 // changed signal handler that is sent when the treeview selection changes. |
60 static void OnSelectionChanged(GtkTreeSelection* selection, | 63 static void OnSelectionChanged(GtkTreeSelection* selection, |
61 TaskManagerGtk* task_manager); | 64 TaskManagerGtk* task_manager); |
62 | 65 |
| 66 // button-press-event handler that activates a process on double-click. |
| 67 static gboolean OnButtonPressEvent(GtkWidget* widget, GdkEventButton* event, |
| 68 TaskManagerGtk* task_manager); |
| 69 |
63 // button-release-event handler that opens the right-click context menu. | 70 // button-release-event handler that opens the right-click context menu. |
64 static gboolean OnButtonReleaseEvent(GtkWidget* widget, GdkEventButton* event, | 71 static gboolean OnButtonReleaseEvent(GtkWidget* widget, GdkEventButton* event, |
65 TaskManagerGtk* task_manager); | 72 TaskManagerGtk* task_manager); |
66 | 73 |
67 // The task manager. | 74 // The task manager. |
68 TaskManager* task_manager_; | 75 TaskManager* task_manager_; |
69 | 76 |
70 // Our model. | 77 // Our model. |
71 TaskManagerModel* model_; | 78 TaskManagerModel* model_; |
72 | 79 |
(...skipping 13 matching lines...) Expand all Loading... |
86 scoped_ptr<ContextMenuController> menu_controller_; | 93 scoped_ptr<ContextMenuController> menu_controller_; |
87 | 94 |
88 // An open task manager window. There can only be one open at a time. This | 95 // An open task manager window. There can only be one open at a time. This |
89 // is reset to NULL when the window is closed. | 96 // is reset to NULL when the window is closed. |
90 static TaskManagerGtk* instance_; | 97 static TaskManagerGtk* instance_; |
91 | 98 |
92 DISALLOW_COPY_AND_ASSIGN(TaskManagerGtk); | 99 DISALLOW_COPY_AND_ASSIGN(TaskManagerGtk); |
93 }; | 100 }; |
94 | 101 |
95 #endif // CHROME_BROWSER_GTK_TASK_MANAGER_GTK_H_ | 102 #endif // CHROME_BROWSER_GTK_TASK_MANAGER_GTK_H_ |
OLD | NEW |