summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/options
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 19:16:41 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 19:16:41 +0000
commitfab9b8ad7a08d97008073ed4d611677d000317f6 (patch)
tree775e6c1f07de95a005ab306bdf6a6e2014a13f98 /chrome/browser/gtk/options
parent7603d7f7d625bd27aa98fbdd28b8cff83344f66f (diff)
downloadchromium_src-fab9b8ad7a08d97008073ed4d611677d000317f6.zip
chromium_src-fab9b8ad7a08d97008073ed4d611677d000317f6.tar.gz
chromium_src-fab9b8ad7a08d97008073ed4d611677d000317f6.tar.bz2
GTK: Allow double clicking on an exception to open the edit dialog.
BUG=38349 TEST=none Review URL: http://codereview.chromium.org/1320001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42652 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/options')
-rw-r--r--chrome/browser/gtk/options/content_exceptions_window_gtk.cc30
-rw-r--r--chrome/browser/gtk/options/content_exceptions_window_gtk.h9
2 files changed, 22 insertions, 17 deletions
diff --git a/chrome/browser/gtk/options/content_exceptions_window_gtk.cc b/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
index cd20544..b43bc73 100644
--- a/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
+++ b/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
@@ -66,6 +66,8 @@ ContentExceptionsWindowGtk::ContentExceptionsWindowGtk(
// Set up the properties of the treeview
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview_), TRUE);
+ g_signal_connect(treeview_, "row-activated",
+ G_CALLBACK(OnTreeViewRowActivateThunk), this);
GtkTreeViewColumn* hostname_column = gtk_tree_view_column_new_with_attributes(
l10n_util::GetStringUTF8(IDS_EXCEPTIONS_HOSTNAME_HEADER).c_str(),
@@ -85,7 +87,7 @@ ContentExceptionsWindowGtk::ContentExceptionsWindowGtk(
GTK_TREE_VIEW(treeview_));
gtk_tree_selection_set_mode(treeview_selection_, GTK_SELECTION_MULTIPLE);
g_signal_connect(treeview_selection_, "changed",
- G_CALLBACK(OnSelectionChanged), this);
+ G_CALLBACK(OnTreeSelectionChangedThunk), this);
// Bind |list_store_| to our C++ model.
model_.reset(new ContentExceptionsTableModel(map, type));
@@ -155,7 +157,7 @@ ContentExceptionsWindowGtk::ContentExceptionsWindowGtk(
gtk_widget_show_all(dialog_);
g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this);
+ g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this);
}
void ContentExceptionsWindowGtk::SetColumnValues(int row, GtkTreeIter* iter) {
@@ -251,17 +253,19 @@ std::string ContentExceptionsWindowGtk::GetWindowTitle() const {
return std::string();
}
-// static
-void ContentExceptionsWindowGtk::OnWindowDestroy(
- GtkWidget* widget,
- ContentExceptionsWindowGtk* window) {
- instances[window->model_->content_type()] = NULL;
- MessageLoop::current()->DeleteSoon(FROM_HERE, window);
+void ContentExceptionsWindowGtk::OnTreeViewRowActivate(
+ GtkWidget* sender,
+ GtkTreePath* path,
+ GtkTreeViewColumn* column) {
+ Edit(sender);
}
-// static
-void ContentExceptionsWindowGtk::OnSelectionChanged(
- GtkTreeSelection* selection,
- ContentExceptionsWindowGtk* window) {
- window->UpdateButtonState();
+void ContentExceptionsWindowGtk::OnWindowDestroy(GtkWidget* widget) {
+ instances[model_->content_type()] = NULL;
+ MessageLoop::current()->DeleteSoon(FROM_HERE, this);
+}
+
+void ContentExceptionsWindowGtk::OnTreeSelectionChanged(
+ GtkWidget* selection) {
+ UpdateButtonState();
}
diff --git a/chrome/browser/gtk/options/content_exceptions_window_gtk.h b/chrome/browser/gtk/options/content_exceptions_window_gtk.h
index 1037baa..5607fef 100644
--- a/chrome/browser/gtk/options/content_exceptions_window_gtk.h
+++ b/chrome/browser/gtk/options/content_exceptions_window_gtk.h
@@ -65,10 +65,11 @@ class ContentExceptionsWindowGtk : public gtk_tree::TableAdapter::Delegate,
std::string GetWindowTitle() const;
// GTK Callbacks
- static void OnWindowDestroy(GtkWidget* widget,
- ContentExceptionsWindowGtk* window);
- static void OnSelectionChanged(GtkTreeSelection* selection,
- ContentExceptionsWindowGtk* window);
+ CHROMEGTK_CALLBACK_2(ContentExceptionsWindowGtk, void,
+ OnTreeViewRowActivate, GtkTreePath*, GtkTreeViewColumn*);
+ CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void, OnWindowDestroy);
+ CHROMEGTK_CALLBACK_0(ContentExceptionsWindowGtk, void,
+ OnTreeSelectionChanged);
// The list presented in |treeview_|; a gobject instead of a C++ object.
GtkListStore* list_store_;