OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ |
6 #define CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Callbacks for the buttons. | 58 // Callbacks for the buttons. |
59 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Add); | 59 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Add); |
60 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Edit); | 60 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Edit); |
61 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Remove); | 61 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Remove); |
62 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, RemoveAll); | 62 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, RemoveAll); |
63 | 63 |
64 // Returns the title of the window (changes based on what ContentSettingsType | 64 // Returns the title of the window (changes based on what ContentSettingsType |
65 // was set to in the constructor). | 65 // was set to in the constructor). |
66 std::string GetWindowTitle() const; | 66 std::string GetWindowTitle() const; |
67 | 67 |
68 // Gets the selected indicies in the two list stores. Indicies are returned | |
69 // in <list_store_, sort_list_store_> order. | |
70 void GetSelectedModelIndices(std::set<std::pair<int, int> >* indices); | |
71 | |
72 // GTK Callbacks | 68 // GTK Callbacks |
73 CHROMEGTK_CALLBACK_2(ContentExceptionsWindowGtk, void, | 69 CHROMEGTK_CALLBACK_2(ContentExceptionsWindowGtk, void, |
74 OnTreeViewRowActivate, GtkTreePath*, GtkTreeViewColumn*); | 70 OnTreeViewRowActivate, GtkTreePath*, GtkTreeViewColumn*); |
75 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, OnWindowDestroy); | 71 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, OnWindowDestroy); |
76 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, | 72 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, |
77 OnTreeSelectionChanged); | 73 OnTreeSelectionChanged); |
78 | 74 |
79 // The list presented in |treeview_|. Separate from |list_store_|, the list | 75 // The list presented in |treeview_|; a gobject instead of a C++ object. |
80 // that backs |sort_model_|. This separation comes so the user can sort the | |
81 // data on screen without changing the underlying |list_store_|. | |
82 GtkTreeModel* sort_list_store_; | |
83 | |
84 // The backing to |sort_list_store_|. Doesn't change when sorted. | |
85 GtkListStore* list_store_; | 76 GtkListStore* list_store_; |
86 | 77 |
87 // The C++, views-ish, cross-platform model class that actually contains the | 78 // The C++, views-ish, cross-platform model class that actually contains the |
88 // gold standard data. | 79 // gold standard data. |
89 scoped_ptr<ContentExceptionsTableModel> model_; | 80 scoped_ptr<ContentExceptionsTableModel> model_; |
90 | 81 |
91 // The adapter that ferries data back and forth between |model_| and | 82 // The adapter that ferries data back and forth between |model_| and |
92 // |list_store_| whenever either of them change. | 83 // |list_store_| whenever either of them change. |
93 scoped_ptr<gtk_tree::TableAdapter> model_adapter_; | 84 scoped_ptr<gtk_tree::TableAdapter> model_adapter_; |
94 | 85 |
95 // The exception window. | 86 // The exception window. |
96 GtkWidget* dialog_; | 87 GtkWidget* dialog_; |
97 | 88 |
98 // The treeview that presents the site/action pairs. | 89 // The treeview that presents the site/action pairs. |
99 GtkWidget* treeview_; | 90 GtkWidget* treeview_; |
100 | 91 |
101 // The current user selection from |treeview_|. | 92 // The current user selection from |treeview_|. |
102 GtkTreeSelection* treeview_selection_; | 93 GtkTreeSelection* treeview_selection_; |
103 | 94 |
104 // Buttons. | 95 // Buttons. |
105 GtkWidget* edit_button_; | 96 GtkWidget* edit_button_; |
106 GtkWidget* remove_button_; | 97 GtkWidget* remove_button_; |
107 GtkWidget* remove_all_button_; | 98 GtkWidget* remove_all_button_; |
108 | |
109 friend class ContentExceptionsWindowGtkUnittest; | |
110 }; | 99 }; |
111 | 100 |
112 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ | 101 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ |
OLD | NEW |