| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 } // namespace | 76 } // namespace |
| 77 | 77 |
| 78 CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, | 78 CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, |
| 79 TabContents* tab_contents) | 79 TabContents* tab_contents) |
| 80 : tab_contents_(tab_contents), | 80 : tab_contents_(tab_contents), |
| 81 status_changed_(false) { | 81 status_changed_(false) { |
| 82 TabSpecificContentSettings* content_settings = | 82 TabSpecificContentSettings* content_settings = |
| 83 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)-> | 83 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)-> |
| 84 content_settings(); | 84 content_settings(); |
| 85 registrar_.Add(this, NotificationType::COLLECTED_COOKIES_SHOWN, | 85 registrar_.Add(this, chrome::COLLECTED_COOKIES_SHOWN, |
| 86 Source<TabSpecificContentSettings>(content_settings)); | 86 Source<TabSpecificContentSettings>(content_settings)); |
| 87 | 87 |
| 88 Init(); | 88 Init(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void CollectedCookiesGtk::Init() { | 91 void CollectedCookiesGtk::Init() { |
| 92 dialog_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); | 92 dialog_ = gtk_vbox_new(FALSE, gtk_util::kContentAreaSpacing); |
| 93 gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); | 93 gtk_box_set_spacing(GTK_BOX(dialog_), gtk_util::kContentAreaSpacing); |
| 94 | 94 |
| 95 GtkWidget* label = gtk_label_new( | 95 GtkWidget* label = gtk_label_new( |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 413 |
| 414 bool enable_for_blocked_cookies = | 414 bool enable_for_blocked_cookies = |
| 415 SelectionContainsOriginNode(blocked_selection_, | 415 SelectionContainsOriginNode(blocked_selection_, |
| 416 blocked_cookies_tree_adapter_.get()); | 416 blocked_cookies_tree_adapter_.get()); |
| 417 gtk_widget_set_sensitive(allow_blocked_cookie_button_, | 417 gtk_widget_set_sensitive(allow_blocked_cookie_button_, |
| 418 enable_for_blocked_cookies); | 418 enable_for_blocked_cookies); |
| 419 gtk_widget_set_sensitive(for_session_blocked_cookie_button_, | 419 gtk_widget_set_sensitive(for_session_blocked_cookie_button_, |
| 420 enable_for_blocked_cookies); | 420 enable_for_blocked_cookies); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void CollectedCookiesGtk::Observe(NotificationType type, | 423 void CollectedCookiesGtk::Observe(int type, |
| 424 const NotificationSource& source, | 424 const NotificationSource& source, |
| 425 const NotificationDetails& details) { | 425 const NotificationDetails& details) { |
| 426 DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN); | 426 DCHECK(type == chrome::COLLECTED_COOKIES_SHOWN); |
| 427 window_->CloseConstrainedWindow(); | 427 window_->CloseConstrainedWindow(); |
| 428 } | 428 } |
| 429 | 429 |
| 430 void CollectedCookiesGtk::OnClose(GtkWidget* close_button) { | 430 void CollectedCookiesGtk::OnClose(GtkWidget* close_button) { |
| 431 if (status_changed_) { | 431 if (status_changed_) { |
| 432 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->AddInfoBar( | 432 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->AddInfoBar( |
| 433 new CollectedCookiesInfoBarDelegate(tab_contents_)); | 433 new CollectedCookiesInfoBarDelegate(tab_contents_)); |
| 434 } | 434 } |
| 435 window_->CloseConstrainedWindow(); | 435 window_->CloseConstrainedWindow(); |
| 436 } | 436 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 505 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
| 506 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); | 506 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); |
| 507 g_signal_handlers_unblock_by_func( | 507 g_signal_handlers_unblock_by_func( |
| 508 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 508 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
| 509 } | 509 } |
| 510 | 510 |
| 511 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { | 511 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { |
| 512 EnableControls(); | 512 EnableControls(); |
| 513 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); | 513 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); |
| 514 } | 514 } |
| OLD | NEW |