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/api/infobars/infobar_service.h" | 8 #include "chrome/browser/api/infobars/infobar_service.h" |
9 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_->CloseWebContentsModalDialog(); | 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 InfoBarService* infobar_service = | 463 CollectedCookiesInfoBarDelegate::Create( |
464 InfoBarService::FromWebContents(web_contents_); | 464 InfoBarService::FromWebContents(web_contents_)); |
465 infobar_service->AddInfoBar( | |
466 new CollectedCookiesInfoBarDelegate(infobar_service)); | |
467 } | 465 } |
468 window_->CloseWebContentsModalDialog(); | 466 window_->CloseWebContentsModalDialog(); |
469 } | 467 } |
470 | 468 |
471 void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, | 469 void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, |
472 gtk_tree::TreeAdapter* adapter, | 470 gtk_tree::TreeAdapter* adapter, |
473 ContentSetting setting) { | 471 ContentSetting setting) { |
474 GtkTreeModel* model; | 472 GtkTreeModel* model; |
475 GList* paths = | 473 GList* paths = |
476 gtk_tree_selection_get_selected_rows(selection, &model); | 474 gtk_tree_selection_get_selected_rows(selection, &model); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 538 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
541 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); | 539 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); |
542 g_signal_handlers_unblock_by_func( | 540 g_signal_handlers_unblock_by_func( |
543 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 541 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
544 } | 542 } |
545 | 543 |
546 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { | 544 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { |
547 EnableControls(); | 545 EnableControls(); |
548 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); | 546 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); |
549 } | 547 } |
OLD | NEW |