| 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_appcache_helper.h" | 8 #include "chrome/browser/browsing_data_appcache_helper.h" |
| 9 #include "chrome/browser/browsing_data_cookie_helper.h" | 9 #include "chrome/browser/browsing_data_cookie_helper.h" |
| 10 #include "chrome/browser/browsing_data_database_helper.h" | 10 #include "chrome/browser/browsing_data_database_helper.h" |
| 11 #include "chrome/browser/browsing_data_file_system_helper.h" | 11 #include "chrome/browser/browsing_data_file_system_helper.h" |
| 12 #include "chrome/browser/browsing_data_indexed_db_helper.h" | 12 #include "chrome/browser/browsing_data_indexed_db_helper.h" |
| 13 #include "chrome/browser/browsing_data_local_storage_helper.h" | 13 #include "chrome/browser/browsing_data_local_storage_helper.h" |
| 14 #include "chrome/browser/browsing_data_server_bound_cert_helper.h" | 14 #include "chrome/browser/browsing_data_server_bound_cert_helper.h" |
| 15 #include "chrome/browser/content_settings/cookie_settings.h" | 15 #include "chrome/browser/content_settings/cookie_settings.h" |
| 16 #include "chrome/browser/content_settings/local_shared_objects_container.h" | 16 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
| 17 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 17 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 18 #include "chrome/browser/cookies_tree_model.h" | 18 #include "chrome/browser/cookies_tree_model.h" |
| 19 #include "chrome/browser/infobars/infobar_tab_helper.h" | 19 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 20 #include "chrome/browser/prefs/pref_service.h" | 20 #include "chrome/browser/prefs/pref_service.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/ui/browser_dialogs.h" |
| 22 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 23 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
| 23 #include "chrome/browser/ui/browser_dialogs.h" | |
| 24 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 24 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
| 25 #include "chrome/browser/ui/gtk/gtk_chrome_cookie_view.h" | 25 #include "chrome/browser/ui/gtk/gtk_chrome_cookie_view.h" |
| 26 #include "chrome/browser/ui/gtk/gtk_util.h" | 26 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 27 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 27 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
| 29 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
| 30 #include "content/public/browser/notification_source.h" | 30 #include "content/public/browser/notification_source.h" |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/browser/web_contents_view.h" | 32 #include "content/public/browser/web_contents_view.h" |
| 33 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 IDS_COLLECTED_COOKIES_SESSION_RULE_CREATED, domain_name); | 85 IDS_COLLECTED_COOKIES_SESSION_RULE_CREATED, domain_name); |
| 86 | 86 |
| 87 default: | 87 default: |
| 88 NOTREACHED(); | 88 NOTREACHED(); |
| 89 return std::string(); | 89 return std::string(); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace | 93 } // namespace |
| 94 | 94 |
| 95 namespace browser { | 95 namespace chrome { |
| 96 | 96 |
| 97 // Declared in browser_dialogs.h so others don't have to depend on our header. | 97 // Declared in browser_dialogs.h so others don't have to depend on our header. |
| 98 void ShowCollectedCookiesDialog(TabContents* tab_contents) { | 98 void ShowCollectedCookiesDialog(TabContents* tab_contents) { |
| 99 // Deletes itself on close. | 99 // Deletes itself on close. |
| 100 new CollectedCookiesGtk( | 100 new CollectedCookiesGtk( |
| 101 tab_contents->web_contents()->GetView()->GetTopLevelNativeWindow(), | 101 tab_contents->web_contents()->GetView()->GetTopLevelNativeWindow(), |
| 102 tab_contents); | 102 tab_contents); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace browser | 105 } // namespace chrome |
| 106 | 106 |
| 107 CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, | 107 CollectedCookiesGtk::CollectedCookiesGtk(GtkWindow* parent, |
| 108 TabContents* tab_contents) | 108 TabContents* tab_contents) |
| 109 : tab_contents_(tab_contents), | 109 : tab_contents_(tab_contents), |
| 110 status_changed_(false) { | 110 status_changed_(false) { |
| 111 registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, | 111 registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, |
| 112 content::Source<TabSpecificContentSettings>( | 112 content::Source<TabSpecificContentSettings>( |
| 113 tab_contents->content_settings())); | 113 tab_contents->content_settings())); |
| 114 | 114 |
| 115 Init(); | 115 Init(); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 553 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
| 554 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); | 554 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); |
| 555 g_signal_handlers_unblock_by_func( | 555 g_signal_handlers_unblock_by_func( |
| 556 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 556 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
| 557 } | 557 } |
| 558 | 558 |
| 559 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { | 559 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { |
| 560 EnableControls(); | 560 EnableControls(); |
| 561 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); | 561 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); |
| 562 } | 562 } |
| OLD | NEW |