Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4358)

Unified Diff: chrome/browser/ui/gtk/collected_cookies_gtk.cc

Issue 128343002: [Gtk] Hook up the "Remove" button in the collected cookies dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/collected_cookies_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/collected_cookies_gtk.cc
diff --git a/chrome/browser/ui/gtk/collected_cookies_gtk.cc b/chrome/browser/ui/gtk/collected_cookies_gtk.cc
index 8648d459cd4ca9a7a5f81469f6594bb5fb3a4471..e7a161b26054369a7a344c7462bdc1d9bd4d1b94 100644
--- a/chrome/browser/ui/gtk/collected_cookies_gtk.cc
+++ b/chrome/browser/ui/gtk/collected_cookies_gtk.cc
@@ -266,6 +266,12 @@ GtkWidget* CollectedCookiesGtk::CreateAllowedPane() {
G_CALLBACK(OnBlockAllowedButtonClickedThunk), this);
gtk_container_add(GTK_CONTAINER(button_box), block_allowed_cookie_button_);
+ delete_allowed_cookie_button_ = gtk_button_new_with_label(
+ l10n_util::GetStringUTF8(IDS_COOKIES_REMOVE_LABEL).c_str());
+ g_signal_connect(delete_allowed_cookie_button_, "clicked",
+ G_CALLBACK(OnDeleteAllowedButtonClickedThunk), this);
+ gtk_container_add(GTK_CONTAINER(button_box), delete_allowed_cookie_button_);
+
// Wrap the vbox inside an hbox so that we can specify padding along the
// horizontal axis.
GtkWidget* box = gtk_hbox_new(FALSE, 0);
@@ -437,6 +443,9 @@ void CollectedCookiesGtk::EnableControls() {
allowed_cookies_tree_adapter_.get());
gtk_widget_set_sensitive(block_allowed_cookie_button_,
enable_for_allowed_cookies);
+ gtk_widget_set_sensitive(
+ delete_allowed_cookie_button_,
+ gtk_tree_selection_count_selected_rows(allowed_selection_) > 0);
bool enable_for_blocked_cookies =
SelectionContainsHostNode(blocked_selection_,
@@ -509,6 +518,20 @@ void CollectedCookiesGtk::OnBlockAllowedButtonClicked(GtkWidget* button) {
CONTENT_SETTING_BLOCK);
}
+void CollectedCookiesGtk::OnDeleteAllowedButtonClicked(GtkWidget* button) {
+ GtkTreeModel* model;
+ GList* paths = gtk_tree_selection_get_selected_rows(
+ allowed_selection_, &model);
+ for (GList* item = paths; item; item = item->next) {
+ GtkTreeIter iter;
+ gtk_tree_model_get_iter(
+ model, &iter, reinterpret_cast<GtkTreePath*>(item->data));
+ CookieTreeNode* node = static_cast<CookieTreeNode*>(
+ allowed_cookies_tree_adapter_->GetNode(&iter));
+ allowed_cookies_tree_model_->DeleteCookieNode(node);
+ }
+}
+
void CollectedCookiesGtk::OnAllowBlockedButtonClicked(GtkWidget* button) {
AddExceptions(blocked_selection_, blocked_cookies_tree_adapter_.get(),
CONTENT_SETTING_ALLOW);
« no previous file with comments | « chrome/browser/ui/gtk/collected_cookies_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698