| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 15 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
| 16 #include "chrome/browser/browsing_data/browsing_data_cache_storage_helper.h" | 16 #include "chrome/browser/browsing_data/browsing_data_cache_storage_helper.h" |
| 17 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" | 17 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
| 18 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 18 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" | 20 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
| 21 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" | 21 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" |
| 22 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" | 22 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
| 23 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 23 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
| 24 #include "chrome/browser/browsing_data/browsing_data_media_license_helper.h" |
| 24 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" | 25 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" |
| 25 #include "chrome/browser/browsing_data/browsing_data_service_worker_helper.h" | 26 #include "chrome/browser/browsing_data/browsing_data_service_worker_helper.h" |
| 26 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
| 27 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" | 28 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" |
| 28 #include "chrome/grit/generated_resources.h" | 29 #include "chrome/grit/generated_resources.h" |
| 29 #include "content/public/browser/browser_context.h" | 30 #include "content/public/browser/browser_context.h" |
| 30 #include "content/public/browser/render_process_host.h" | 31 #include "content/public/browser/render_process_host.h" |
| 31 #include "content/public/browser/site_instance.h" | 32 #include "content/public/browser/site_instance.h" |
| 32 #include "content/public/browser/storage_partition.h" | 33 #include "content/public/browser/storage_partition.h" |
| 33 #include "content/public/browser/web_ui.h" | 34 #include "content/public/browser/web_ui.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 IDS_COOKIES_FILE_SYSTEM_TEMPORARY_USAGE_LABEL}, | 104 IDS_COOKIES_FILE_SYSTEM_TEMPORARY_USAGE_LABEL}, |
| 104 {"label_file_system_persistent_usage", | 105 {"label_file_system_persistent_usage", |
| 105 IDS_COOKIES_FILE_SYSTEM_PERSISTENT_USAGE_LABEL}, | 106 IDS_COOKIES_FILE_SYSTEM_PERSISTENT_USAGE_LABEL}, |
| 106 {"cookie_channel_id", IDS_COOKIES_CHANNEL_ID}, | 107 {"cookie_channel_id", IDS_COOKIES_CHANNEL_ID}, |
| 107 {"label_channel_id_server_id", IDS_COOKIES_CHANNEL_ID_ORIGIN_LABEL}, | 108 {"label_channel_id_server_id", IDS_COOKIES_CHANNEL_ID_ORIGIN_LABEL}, |
| 108 {"label_channel_id_type", IDS_COOKIES_CHANNEL_ID_TYPE_LABEL}, | 109 {"label_channel_id_type", IDS_COOKIES_CHANNEL_ID_TYPE_LABEL}, |
| 109 {"label_channel_id_created", IDS_COOKIES_CHANNEL_ID_CREATED_LABEL}, | 110 {"label_channel_id_created", IDS_COOKIES_CHANNEL_ID_CREATED_LABEL}, |
| 110 {"label_channel_id_expires", IDS_COOKIES_CHANNEL_ID_EXPIRES_LABEL}, | 111 {"label_channel_id_expires", IDS_COOKIES_CHANNEL_ID_EXPIRES_LABEL}, |
| 111 {"label_protected_by_apps", | 112 {"label_protected_by_apps", |
| 112 IDS_GEOLOCATION_SET_BY_HOVER}, // TODO(bauerb): Use a better string | 113 IDS_GEOLOCATION_SET_BY_HOVER}, // TODO(bauerb): Use a better string |
| 114 {"cookie_media_license", IDS_COOKIES_MEDIA_LICENSE}, |
| 115 {"label_media_license_origin", IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL}, |
| 116 {"label_media_license_size", |
| 117 IDS_COOKIES_LOCAL_STORAGE_SIZE_ON_DISK_LABEL}, |
| 118 {"label_media_license_last_modified", |
| 119 IDS_COOKIES_LOCAL_STORAGE_LAST_MODIFIED_LABEL}, |
| 113 }; | 120 }; |
| 114 | 121 |
| 115 RegisterStrings(localized_strings, resources, arraysize(resources)); | 122 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 116 RegisterTitle(localized_strings, "cookiesViewPage", | 123 RegisterTitle(localized_strings, "cookiesViewPage", |
| 117 IDS_COOKIES_WEBSITE_PERMISSIONS_WINDOW_TITLE); | 124 IDS_COOKIES_WEBSITE_PERMISSIONS_WINDOW_TITLE); |
| 118 } | 125 } |
| 119 | 126 |
| 120 void CookiesViewHandler::RegisterMessages() { | 127 void CookiesViewHandler::RegisterMessages() { |
| 121 web_ui()->RegisterMessageCallback("updateCookieSearchResults", | 128 web_ui()->RegisterMessageCallback("updateCookieSearchResults", |
| 122 base::Bind(&CookiesViewHandler::UpdateSearchResults, | 129 base::Bind(&CookiesViewHandler::UpdateSearchResults, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 new BrowsingDataCookieHelper(profile->GetRequestContext()), | 215 new BrowsingDataCookieHelper(profile->GetRequestContext()), |
| 209 new BrowsingDataDatabaseHelper(profile), | 216 new BrowsingDataDatabaseHelper(profile), |
| 210 new BrowsingDataLocalStorageHelper(profile), NULL, | 217 new BrowsingDataLocalStorageHelper(profile), NULL, |
| 211 new BrowsingDataAppCacheHelper(profile), | 218 new BrowsingDataAppCacheHelper(profile), |
| 212 new BrowsingDataIndexedDBHelper(indexed_db_context), | 219 new BrowsingDataIndexedDBHelper(indexed_db_context), |
| 213 BrowsingDataFileSystemHelper::Create(file_system_context), | 220 BrowsingDataFileSystemHelper::Create(file_system_context), |
| 214 BrowsingDataQuotaHelper::Create(profile), | 221 BrowsingDataQuotaHelper::Create(profile), |
| 215 BrowsingDataChannelIDHelper::Create(profile->GetRequestContext()), | 222 BrowsingDataChannelIDHelper::Create(profile->GetRequestContext()), |
| 216 new BrowsingDataServiceWorkerHelper(service_worker_context), | 223 new BrowsingDataServiceWorkerHelper(service_worker_context), |
| 217 new BrowsingDataCacheStorageHelper(cache_storage_context), | 224 new BrowsingDataCacheStorageHelper(cache_storage_context), |
| 218 BrowsingDataFlashLSOHelper::Create(profile)); | 225 BrowsingDataFlashLSOHelper::Create(profile), |
| 226 BrowsingDataMediaLicenseHelper::Create(file_system_context)); |
| 219 cookies_tree_model_.reset(new CookiesTreeModel( | 227 cookies_tree_model_.reset(new CookiesTreeModel( |
| 220 container, profile->GetExtensionSpecialStoragePolicy())); | 228 container, profile->GetExtensionSpecialStoragePolicy())); |
| 221 cookies_tree_model_->AddCookiesTreeObserver(this); | 229 cookies_tree_model_->AddCookiesTreeObserver(this); |
| 222 } | 230 } |
| 223 } | 231 } |
| 224 | 232 |
| 225 void CookiesViewHandler::UpdateSearchResults(const base::ListValue* args) { | 233 void CookiesViewHandler::UpdateSearchResults(const base::ListValue* args) { |
| 226 base::string16 query; | 234 base::string16 query; |
| 227 if (!args->GetString(0, &query)) | 235 if (!args->GetString(0, &query)) |
| 228 return; | 236 return; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 web_ui()->CallJavascriptFunctionUnsafe("CookiesView.loadChildren", args); | 286 web_ui()->CallJavascriptFunctionUnsafe("CookiesView.loadChildren", args); |
| 279 } | 287 } |
| 280 | 288 |
| 281 void CookiesViewHandler::ReloadCookies(const base::ListValue* args) { | 289 void CookiesViewHandler::ReloadCookies(const base::ListValue* args) { |
| 282 cookies_tree_model_.reset(); | 290 cookies_tree_model_.reset(); |
| 283 | 291 |
| 284 EnsureCookiesTreeModelCreated(); | 292 EnsureCookiesTreeModelCreated(); |
| 285 } | 293 } |
| 286 | 294 |
| 287 } // namespace options | 295 } // namespace options |
| OLD | NEW |