Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: chrome/browser/ui/webui/options/cookies_view_handler.cc

Issue 2359393002: Adds media license nodes to cookie tree model and cookies view. (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 new BrowsingDataCookieHelper(profile->GetRequestContext()), 216 new BrowsingDataCookieHelper(profile->GetRequestContext()),
210 new BrowsingDataDatabaseHelper(profile), 217 new BrowsingDataDatabaseHelper(profile),
211 new BrowsingDataLocalStorageHelper(profile), NULL, 218 new BrowsingDataLocalStorageHelper(profile), NULL,
212 new BrowsingDataAppCacheHelper(profile), 219 new BrowsingDataAppCacheHelper(profile),
213 new BrowsingDataIndexedDBHelper(indexed_db_context), 220 new BrowsingDataIndexedDBHelper(indexed_db_context),
214 BrowsingDataFileSystemHelper::Create(file_system_context), 221 BrowsingDataFileSystemHelper::Create(file_system_context),
215 BrowsingDataQuotaHelper::Create(profile), 222 BrowsingDataQuotaHelper::Create(profile),
216 BrowsingDataChannelIDHelper::Create(profile->GetRequestContext()), 223 BrowsingDataChannelIDHelper::Create(profile->GetRequestContext()),
217 new BrowsingDataServiceWorkerHelper(service_worker_context), 224 new BrowsingDataServiceWorkerHelper(service_worker_context),
218 new BrowsingDataCacheStorageHelper(cache_storage_context), 225 new BrowsingDataCacheStorageHelper(cache_storage_context),
219 BrowsingDataFlashLSOHelper::Create(profile)); 226 BrowsingDataFlashLSOHelper::Create(profile),
227 BrowsingDataMediaLicenseHelper::Create(file_system_context));
220 cookies_tree_model_.reset(new CookiesTreeModel( 228 cookies_tree_model_.reset(new CookiesTreeModel(
221 container, profile->GetExtensionSpecialStoragePolicy())); 229 container, profile->GetExtensionSpecialStoragePolicy()));
222 cookies_tree_model_->AddCookiesTreeObserver(this); 230 cookies_tree_model_->AddCookiesTreeObserver(this);
223 } 231 }
224 } 232 }
225 233
226 void CookiesViewHandler::UpdateSearchResults(const base::ListValue* args) { 234 void CookiesViewHandler::UpdateSearchResults(const base::ListValue* args) {
227 base::string16 query; 235 base::string16 query;
228 if (!args->GetString(0, &query)) 236 if (!args->GetString(0, &query))
229 return; 237 return;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 web_ui()->CallJavascriptFunctionUnsafe("CookiesView.loadChildren", args); 287 web_ui()->CallJavascriptFunctionUnsafe("CookiesView.loadChildren", args);
280 } 288 }
281 289
282 void CookiesViewHandler::ReloadCookies(const base::ListValue* args) { 290 void CookiesViewHandler::ReloadCookies(const base::ListValue* args) {
283 cookies_tree_model_.reset(); 291 cookies_tree_model_.reset();
284 292
285 EnsureCookiesTreeModelCreated(); 293 EnsureCookiesTreeModelCreated();
286 } 294 }
287 295
288 } // namespace options 296 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698