| 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 |
| 68 // GTK Callbacks | 72 // GTK Callbacks |
| 69 CHROMEGTK_CALLBACK_2(ContentExceptionsWindowGtk, void, | 73 CHROMEGTK_CALLBACK_2(ContentExceptionsWindowGtk, void, |
| 70 OnTreeViewRowActivate, GtkTreePath*, GtkTreeViewColumn*); | 74 OnTreeViewRowActivate, GtkTreePath*, GtkTreeViewColumn*); |
| 71 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, OnWindowDestroy); | 75 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, OnWindowDestroy); |
| 72 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, | 76 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, |
| 73 OnTreeSelectionChanged); | 77 OnTreeSelectionChanged); |
| 74 | 78 |
| 75 // The list presented in |treeview_|; a gobject instead of a C++ object. | 79 // The list presented in |treeview_|. Separate from |list_store_|, the list |
| 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. |
| 76 GtkListStore* list_store_; | 85 GtkListStore* list_store_; |
| 77 | 86 |
| 78 // The C++, views-ish, cross-platform model class that actually contains the | 87 // The C++, views-ish, cross-platform model class that actually contains the |
| 79 // gold standard data. | 88 // gold standard data. |
| 80 scoped_ptr<ContentExceptionsTableModel> model_; | 89 scoped_ptr<ContentExceptionsTableModel> model_; |
| 81 | 90 |
| 82 // The adapter that ferries data back and forth between |model_| and | 91 // The adapter that ferries data back and forth between |model_| and |
| 83 // |list_store_| whenever either of them change. | 92 // |list_store_| whenever either of them change. |
| 84 scoped_ptr<gtk_tree::TableAdapter> model_adapter_; | 93 scoped_ptr<gtk_tree::TableAdapter> model_adapter_; |
| 85 | 94 |
| 86 // The exception window. | 95 // The exception window. |
| 87 GtkWidget* dialog_; | 96 GtkWidget* dialog_; |
| 88 | 97 |
| 89 // The treeview that presents the site/action pairs. | 98 // The treeview that presents the site/action pairs. |
| 90 GtkWidget* treeview_; | 99 GtkWidget* treeview_; |
| 91 | 100 |
| 92 // The current user selection from |treeview_|. | 101 // The current user selection from |treeview_|. |
| 93 GtkTreeSelection* treeview_selection_; | 102 GtkTreeSelection* treeview_selection_; |
| 94 | 103 |
| 95 // Buttons. | 104 // Buttons. |
| 96 GtkWidget* edit_button_; | 105 GtkWidget* edit_button_; |
| 97 GtkWidget* remove_button_; | 106 GtkWidget* remove_button_; |
| 98 GtkWidget* remove_all_button_; | 107 GtkWidget* remove_all_button_; |
| 108 |
| 109 friend class ContentExceptionsWindowGtkUnittest; |
| 99 }; | 110 }; |
| 100 | 111 |
| 101 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ | 112 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ |
| OLD | NEW |