| 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/webui/options/cookies_view_handler.h" | 5 #include "chrome/browser/ui/webui/options/cookies_view_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 13 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
| 14 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
| 14 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 15 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
| 15 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 16 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
| 16 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" | 17 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
| 17 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" | 18 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" |
| 18 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 20 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" | 21 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" |
| 21 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" | |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" | 23 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" |
| 24 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
| 25 #include "content/public/browser/render_process_host.h" | 25 #include "content/public/browser/render_process_host.h" |
| 26 #include "content/public/browser/site_instance.h" | 26 #include "content/public/browser/site_instance.h" |
| 27 #include "content/public/browser/storage_partition.h" | 27 #include "content/public/browser/storage_partition.h" |
| 28 #include "content/public/browser/web_ui.h" | 28 #include "content/public/browser/web_ui.h" |
| 29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 31 | 31 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 { "search_cookies", IDS_COOKIES_SEARCH_COOKIES }, | 82 { "search_cookies", IDS_COOKIES_SEARCH_COOKIES }, |
| 83 { "remove_cookie", IDS_COOKIES_REMOVE_LABEL }, | 83 { "remove_cookie", IDS_COOKIES_REMOVE_LABEL }, |
| 84 { "remove_all_cookie", IDS_COOKIES_REMOVE_ALL_LABEL }, | 84 { "remove_all_cookie", IDS_COOKIES_REMOVE_ALL_LABEL }, |
| 85 { "remove_all_shown_cookie", IDS_COOKIES_REMOVE_ALL_SHOWN_LABEL }, | 85 { "remove_all_shown_cookie", IDS_COOKIES_REMOVE_ALL_SHOWN_LABEL }, |
| 86 { "cookie_file_system", IDS_COOKIES_FILE_SYSTEM }, | 86 { "cookie_file_system", IDS_COOKIES_FILE_SYSTEM }, |
| 87 { "label_file_system_origin", IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL }, | 87 { "label_file_system_origin", IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL }, |
| 88 { "label_file_system_temporary_usage", | 88 { "label_file_system_temporary_usage", |
| 89 IDS_COOKIES_FILE_SYSTEM_TEMPORARY_USAGE_LABEL }, | 89 IDS_COOKIES_FILE_SYSTEM_TEMPORARY_USAGE_LABEL }, |
| 90 { "label_file_system_persistent_usage", | 90 { "label_file_system_persistent_usage", |
| 91 IDS_COOKIES_FILE_SYSTEM_PERSISTENT_USAGE_LABEL }, | 91 IDS_COOKIES_FILE_SYSTEM_PERSISTENT_USAGE_LABEL }, |
| 92 { "cookie_server_bound_cert", IDS_COOKIES_SERVER_BOUND_CERT }, | 92 { "cookie_channel_id", IDS_COOKIES_CHANNEL_ID }, |
| 93 { "label_server_bound_cert_server_id", | 93 { "label_channel_id_server_id", |
| 94 IDS_COOKIES_SERVER_BOUND_CERT_ORIGIN_LABEL }, | 94 IDS_COOKIES_CHANNEL_ID_ORIGIN_LABEL }, |
| 95 { "label_server_bound_cert_type", | 95 { "label_channel_id_type", |
| 96 IDS_COOKIES_SERVER_BOUND_CERT_TYPE_LABEL }, | 96 IDS_COOKIES_CHANNEL_ID_TYPE_LABEL }, |
| 97 { "label_server_bound_cert_created", | 97 { "label_channel_id_created", |
| 98 IDS_COOKIES_SERVER_BOUND_CERT_CREATED_LABEL }, | 98 IDS_COOKIES_CHANNEL_ID_CREATED_LABEL }, |
| 99 { "label_server_bound_cert_expires", | 99 { "label_channel_id_expires", |
| 100 IDS_COOKIES_SERVER_BOUND_CERT_EXPIRES_LABEL }, | 100 IDS_COOKIES_CHANNEL_ID_EXPIRES_LABEL }, |
| 101 { "label_protected_by_apps", | 101 { "label_protected_by_apps", |
| 102 IDS_GEOLOCATION_SET_BY_HOVER }, // TODO(bauerb): Use a better string | 102 IDS_GEOLOCATION_SET_BY_HOVER }, // TODO(bauerb): Use a better string |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 RegisterStrings(localized_strings, resources, arraysize(resources)); | 105 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 106 RegisterTitle(localized_strings, "cookiesViewPage", | 106 RegisterTitle(localized_strings, "cookiesViewPage", |
| 107 IDS_COOKIES_WEBSITE_PERMISSIONS_WINDOW_TITLE); | 107 IDS_COOKIES_WEBSITE_PERMISSIONS_WINDOW_TITLE); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void CookiesViewHandler::RegisterMessages() { | 110 void CookiesViewHandler::RegisterMessages() { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 storage_partition->GetFileSystemContext(); | 191 storage_partition->GetFileSystemContext(); |
| 192 LocalDataContainer* container = new LocalDataContainer( | 192 LocalDataContainer* container = new LocalDataContainer( |
| 193 new BrowsingDataCookieHelper(profile->GetRequestContext()), | 193 new BrowsingDataCookieHelper(profile->GetRequestContext()), |
| 194 new BrowsingDataDatabaseHelper(profile), | 194 new BrowsingDataDatabaseHelper(profile), |
| 195 new BrowsingDataLocalStorageHelper(profile), | 195 new BrowsingDataLocalStorageHelper(profile), |
| 196 NULL, | 196 NULL, |
| 197 new BrowsingDataAppCacheHelper(profile), | 197 new BrowsingDataAppCacheHelper(profile), |
| 198 new BrowsingDataIndexedDBHelper(indexed_db_context), | 198 new BrowsingDataIndexedDBHelper(indexed_db_context), |
| 199 BrowsingDataFileSystemHelper::Create(file_system_context), | 199 BrowsingDataFileSystemHelper::Create(file_system_context), |
| 200 BrowsingDataQuotaHelper::Create(profile), | 200 BrowsingDataQuotaHelper::Create(profile), |
| 201 BrowsingDataServerBoundCertHelper::Create(profile), | 201 BrowsingDataChannelIDHelper::Create(profile), |
| 202 BrowsingDataFlashLSOHelper::Create(profile)); | 202 BrowsingDataFlashLSOHelper::Create(profile)); |
| 203 cookies_tree_model_.reset( | 203 cookies_tree_model_.reset( |
| 204 new CookiesTreeModel(container, | 204 new CookiesTreeModel(container, |
| 205 profile->GetExtensionSpecialStoragePolicy(), | 205 profile->GetExtensionSpecialStoragePolicy(), |
| 206 false)); | 206 false)); |
| 207 cookies_tree_model_->AddCookiesTreeObserver(this); | 207 cookies_tree_model_->AddCookiesTreeObserver(this); |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 void CookiesViewHandler::UpdateSearchResults(const base::ListValue* args) { | 211 void CookiesViewHandler::UpdateSearchResults(const base::ListValue* args) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 web_ui()->CallJavascriptFunction("CookiesView.loadChildren", args); | 263 web_ui()->CallJavascriptFunction("CookiesView.loadChildren", args); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void CookiesViewHandler::ReloadCookies(const base::ListValue* args) { | 266 void CookiesViewHandler::ReloadCookies(const base::ListValue* args) { |
| 267 cookies_tree_model_.reset(); | 267 cookies_tree_model_.reset(); |
| 268 | 268 |
| 269 EnsureCookiesTreeModelCreated(); | 269 EnsureCookiesTreeModelCreated(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace options | 272 } // namespace options |
| OLD | NEW |