Chromium Code Reviews| 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> |
| 11 | 11 |
| 12 #include "app/gtk_signal.h" | 12 #include "app/gtk_signal.h" |
| 13 #include "base/gtest_prod_util.h" | |
|
Evan Martin
2010/07/01 20:13:11
Unnecessary?
| |
| 13 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
| 14 #include "chrome/browser/content_exceptions_table_model.h" | 15 #include "chrome/browser/content_exceptions_table_model.h" |
| 15 #include "chrome/browser/gtk/gtk_tree.h" | 16 #include "chrome/browser/gtk/gtk_tree.h" |
| 16 #include "chrome/browser/gtk/options/content_exception_editor.h" | 17 #include "chrome/browser/gtk/options/content_exception_editor.h" |
| 17 #include "chrome/common/content_settings.h" | 18 #include "chrome/common/content_settings.h" |
| 18 #include "chrome/common/content_settings_types.h" | 19 #include "chrome/common/content_settings_types.h" |
| 19 | 20 |
| 20 class HostContentSettingsMap; | 21 class HostContentSettingsMap; |
| 21 | 22 |
| 22 // Dialog that lists each of the exceptions to the current content policy, and | 23 // Dialog that lists each of the exceptions to the current content policy, and |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 // Callbacks for the buttons. | 59 // Callbacks for the buttons. |
| 59 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Add); | 60 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Add); |
| 60 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Edit); | 61 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Edit); |
| 61 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Remove); | 62 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, Remove); |
| 62 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, RemoveAll); | 63 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, RemoveAll); |
| 63 | 64 |
| 64 // Returns the title of the window (changes based on what ContentSettingsType | 65 // Returns the title of the window (changes based on what ContentSettingsType |
| 65 // was set to in the constructor). | 66 // was set to in the constructor). |
| 66 std::string GetWindowTitle() const; | 67 std::string GetWindowTitle() const; |
| 67 | 68 |
| 69 // Gets the selected indicies in the two list stores. Indicies are returned | |
| 70 // in <list_store_, sort_list_store_> order. | |
| 71 void GetSelectedModelIndices(std::set<std::pair<int, int> >* indices); | |
| 72 | |
| 68 // GTK Callbacks | 73 // GTK Callbacks |
| 69 CHROMEGTK_CALLBACK_2(ContentExceptionsWindowGtk, void, | 74 CHROMEGTK_CALLBACK_2(ContentExceptionsWindowGtk, void, |
| 70 OnTreeViewRowActivate, GtkTreePath*, GtkTreeViewColumn*); | 75 OnTreeViewRowActivate, GtkTreePath*, GtkTreeViewColumn*); |
| 71 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, OnWindowDestroy); | 76 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, OnWindowDestroy); |
| 72 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, | 77 CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, |
| 73 OnTreeSelectionChanged); | 78 OnTreeSelectionChanged); |
| 74 | 79 |
| 75 // The list presented in |treeview_|; a gobject instead of a C++ object. | 80 // The list presented in |treeview_|. Separate from |list_store_|, the list |
| 81 // that backs |sort_model_|. This separation comes so the user can sort the | |
| 82 // data on screen without changing the underlying |list_store_|. | |
| 83 GtkTreeModel* sort_list_store_; | |
| 84 | |
| 85 // The backing to |sort_list_store_|. Doesn't change when sorted. | |
| 76 GtkListStore* list_store_; | 86 GtkListStore* list_store_; |
| 77 | 87 |
| 78 // The C++, views-ish, cross-platform model class that actually contains the | 88 // The C++, views-ish, cross-platform model class that actually contains the |
| 79 // gold standard data. | 89 // gold standard data. |
| 80 scoped_ptr<ContentExceptionsTableModel> model_; | 90 scoped_ptr<ContentExceptionsTableModel> model_; |
| 81 | 91 |
| 82 // The adapter that ferries data back and forth between |model_| and | 92 // The adapter that ferries data back and forth between |model_| and |
| 83 // |list_store_| whenever either of them change. | 93 // |list_store_| whenever either of them change. |
| 84 scoped_ptr<gtk_tree::TableAdapter> model_adapter_; | 94 scoped_ptr<gtk_tree::TableAdapter> model_adapter_; |
| 85 | 95 |
| 86 // The exception window. | 96 // The exception window. |
| 87 GtkWidget* dialog_; | 97 GtkWidget* dialog_; |
| 88 | 98 |
| 89 // The treeview that presents the site/action pairs. | 99 // The treeview that presents the site/action pairs. |
| 90 GtkWidget* treeview_; | 100 GtkWidget* treeview_; |
| 91 | 101 |
| 92 // The current user selection from |treeview_|. | 102 // The current user selection from |treeview_|. |
| 93 GtkTreeSelection* treeview_selection_; | 103 GtkTreeSelection* treeview_selection_; |
| 94 | 104 |
| 95 // Buttons. | 105 // Buttons. |
| 96 GtkWidget* edit_button_; | 106 GtkWidget* edit_button_; |
| 97 GtkWidget* remove_button_; | 107 GtkWidget* remove_button_; |
| 98 GtkWidget* remove_all_button_; | 108 GtkWidget* remove_all_button_; |
| 109 | |
| 110 friend class ContentExceptionsWindowGtkUnittest; | |
| 99 }; | 111 }; |
| 100 | 112 |
| 101 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ | 113 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_EXCEPTIONS_WINDOW_GTK_H_ |
| OLD | NEW |