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 #include "chrome/browser/gtk/collected_cookies_gtk.h" | 5 #include "chrome/browser/gtk/collected_cookies_gtk.h" |
6 | 6 |
7 #include "app/gtk_util.h" | 7 #include "app/gtk_util.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "chrome/browser/cookies_tree_model.h" | 9 #include "chrome/browser/cookies_tree_model.h" |
10 #include "chrome/browser/gtk/gtk_util.h" | 10 #include "chrome/browser/gtk/gtk_util.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 ContentSetting setting) { | 259 ContentSetting setting) { |
260 GtkTreeModel* model; | 260 GtkTreeModel* model; |
261 GList* paths = | 261 GList* paths = |
262 gtk_tree_selection_get_selected_rows(selection, &model); | 262 gtk_tree_selection_get_selected_rows(selection, &model); |
263 for (GList* item = paths; item; item = item->next) { | 263 for (GList* item = paths; item; item = item->next) { |
264 GtkTreeIter iter; | 264 GtkTreeIter iter; |
265 gtk_tree_model_get_iter( | 265 gtk_tree_model_get_iter( |
266 model, &iter, reinterpret_cast<GtkTreePath*>(item->data)); | 266 model, &iter, reinterpret_cast<GtkTreePath*>(item->data)); |
267 CookieTreeOriginNode* node = static_cast<CookieTreeOriginNode*>( | 267 CookieTreeOriginNode* node = static_cast<CookieTreeOriginNode*>( |
268 adapter->GetNode(&iter)); | 268 adapter->GetNode(&iter)); |
269 if (!node->CanCreateContentException()) { | 269 if (node->CanCreateContentException()) { |
270 node->CreateContentException( | 270 node->CreateContentException( |
271 tab_contents_->profile()->GetHostContentSettingsMap(), setting); | 271 tab_contents_->profile()->GetHostContentSettingsMap(), setting); |
272 } | 272 } |
273 } | 273 } |
274 g_list_foreach(paths, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL); | 274 g_list_foreach(paths, reinterpret_cast<GFunc>(gtk_tree_path_free), NULL); |
275 g_list_free(paths); | 275 g_list_free(paths); |
276 } | 276 } |
277 | 277 |
278 void CollectedCookiesGtk::OnBlockAllowedButtonClicked(GtkWidget* button) { | 278 void CollectedCookiesGtk::OnBlockAllowedButtonClicked(GtkWidget* button) { |
279 AddExceptions(allowed_selection_, allowed_cookies_tree_adapter_.get(), | 279 AddExceptions(allowed_selection_, allowed_cookies_tree_adapter_.get(), |
(...skipping 17 matching lines...) Expand all Loading... |
297 g_signal_handlers_block_by_func( | 297 g_signal_handlers_block_by_func( |
298 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 298 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
299 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); | 299 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); |
300 g_signal_handlers_unblock_by_func( | 300 g_signal_handlers_unblock_by_func( |
301 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 301 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
302 } | 302 } |
303 | 303 |
304 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { | 304 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { |
305 EnableControls(); | 305 EnableControls(); |
306 } | 306 } |
OLD | NEW |