| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/gtk/collected_cookies_gtk.h" | 5 #include "chrome/browser/ui/gtk/collected_cookies_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
| 9 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 gtk_widget_set_sensitive(allow_blocked_cookie_button_, | 448 gtk_widget_set_sensitive(allow_blocked_cookie_button_, |
| 449 enable_for_blocked_cookies); | 449 enable_for_blocked_cookies); |
| 450 gtk_widget_set_sensitive(for_session_blocked_cookie_button_, | 450 gtk_widget_set_sensitive(for_session_blocked_cookie_button_, |
| 451 enable_for_blocked_cookies); | 451 enable_for_blocked_cookies); |
| 452 } | 452 } |
| 453 | 453 |
| 454 void CollectedCookiesGtk::Observe(int type, | 454 void CollectedCookiesGtk::Observe(int type, |
| 455 const content::NotificationSource& source, | 455 const content::NotificationSource& source, |
| 456 const content::NotificationDetails& details) { | 456 const content::NotificationDetails& details) { |
| 457 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); | 457 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); |
| 458 window_->CloseConstrainedWindow(); | 458 window_->CloseWebContentsModalDialog(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 void CollectedCookiesGtk::OnClose(GtkWidget* close_button) { | 461 void CollectedCookiesGtk::OnClose(GtkWidget* close_button) { |
| 462 if (status_changed_) { | 462 if (status_changed_) { |
| 463 InfoBarTabHelper* infobar_helper = | 463 InfoBarTabHelper* infobar_helper = |
| 464 InfoBarTabHelper::FromWebContents(web_contents_); | 464 InfoBarTabHelper::FromWebContents(web_contents_); |
| 465 infobar_helper->AddInfoBar( | 465 infobar_helper->AddInfoBar( |
| 466 new CollectedCookiesInfoBarDelegate(infobar_helper)); | 466 new CollectedCookiesInfoBarDelegate(infobar_helper)); |
| 467 } | 467 } |
| 468 window_->CloseConstrainedWindow(); | 468 window_->CloseWebContentsModalDialog(); |
| 469 } | 469 } |
| 470 | 470 |
| 471 void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, | 471 void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, |
| 472 gtk_tree::TreeAdapter* adapter, | 472 gtk_tree::TreeAdapter* adapter, |
| 473 ContentSetting setting) { | 473 ContentSetting setting) { |
| 474 GtkTreeModel* model; | 474 GtkTreeModel* model; |
| 475 GList* paths = | 475 GList* paths = |
| 476 gtk_tree_selection_get_selected_rows(selection, &model); | 476 gtk_tree_selection_get_selected_rows(selection, &model); |
| 477 string16 last_domain_name; | 477 string16 last_domain_name; |
| 478 bool multiple_domains_added = false; | 478 bool multiple_domains_added = false; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 540 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
| 541 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); | 541 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); |
| 542 g_signal_handlers_unblock_by_func( | 542 g_signal_handlers_unblock_by_func( |
| 543 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 543 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
| 544 } | 544 } |
| 545 | 545 |
| 546 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { | 546 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { |
| 547 EnableControls(); | 547 EnableControls(); |
| 548 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); | 548 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); |
| 549 } | 549 } |
| OLD | NEW |