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/options2/cookies_view_handler.h" | 5 #include "chrome/browser/ui/webui/options2/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/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
14 #include "chrome/common/extensions/extension_set.h" | 14 #include "chrome/common/extensions/extension_set.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_cookie_helper.h" | 16 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
17 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 17 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
18 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" | 18 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
19 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" | |
19 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" | 20 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
20 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 21 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
21 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" | 22 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" |
22 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" | 23 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" |
23 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" | 26 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" |
26 #include "content/public/browser/web_ui.h" | 27 #include "content/public/browser/web_ui.h" |
27 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
28 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL }, | 67 IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL }, |
67 { "label_cookie_last_accessed", IDS_COOKIES_LAST_ACCESSED_LABEL }, | 68 { "label_cookie_last_accessed", IDS_COOKIES_LAST_ACCESSED_LABEL }, |
68 { "cookie_domain", IDS_COOKIES_DOMAIN_COLUMN_HEADER }, | 69 { "cookie_domain", IDS_COOKIES_DOMAIN_COLUMN_HEADER }, |
69 { "cookie_local_data", IDS_COOKIES_DATA_COLUMN_HEADER }, | 70 { "cookie_local_data", IDS_COOKIES_DATA_COLUMN_HEADER }, |
70 { "cookie_singular", IDS_COOKIES_SINGLE_COOKIE }, | 71 { "cookie_singular", IDS_COOKIES_SINGLE_COOKIE }, |
71 { "cookie_plural", IDS_COOKIES_PLURAL_COOKIES }, | 72 { "cookie_plural", IDS_COOKIES_PLURAL_COOKIES }, |
72 { "cookie_database_storage", IDS_COOKIES_DATABASE_STORAGE }, | 73 { "cookie_database_storage", IDS_COOKIES_DATABASE_STORAGE }, |
73 { "cookie_indexed_db", IDS_COOKIES_INDEXED_DB }, | 74 { "cookie_indexed_db", IDS_COOKIES_INDEXED_DB }, |
74 { "cookie_local_storage", IDS_COOKIES_LOCAL_STORAGE }, | 75 { "cookie_local_storage", IDS_COOKIES_LOCAL_STORAGE }, |
75 { "cookie_app_cache", IDS_COOKIES_APPLICATION_CACHE }, | 76 { "cookie_app_cache", IDS_COOKIES_APPLICATION_CACHE }, |
77 { "cookie_flash_lso", IDS_COOKIES_FLASH_LSO }, | |
76 { "search_cookies", IDS_COOKIES_SEARCH_COOKIES }, | 78 { "search_cookies", IDS_COOKIES_SEARCH_COOKIES }, |
77 { "remove_cookie", IDS_COOKIES_REMOVE_LABEL }, | 79 { "remove_cookie", IDS_COOKIES_REMOVE_LABEL }, |
78 { "remove_all_cookie", IDS_COOKIES_REMOVE_ALL_LABEL }, | 80 { "remove_all_cookie", IDS_COOKIES_REMOVE_ALL_LABEL }, |
79 { "cookie_file_system", IDS_COOKIES_FILE_SYSTEM }, | 81 { "cookie_file_system", IDS_COOKIES_FILE_SYSTEM }, |
80 { "label_file_system_origin", IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL }, | 82 { "label_file_system_origin", IDS_COOKIES_LOCAL_STORAGE_ORIGIN_LABEL }, |
81 { "label_file_system_temporary_usage", | 83 { "label_file_system_temporary_usage", |
82 IDS_COOKIES_FILE_SYSTEM_TEMPORARY_USAGE_LABEL }, | 84 IDS_COOKIES_FILE_SYSTEM_TEMPORARY_USAGE_LABEL }, |
83 { "label_file_system_persistent_usage", | 85 { "label_file_system_persistent_usage", |
84 IDS_COOKIES_FILE_SYSTEM_PERSISTENT_USAGE_LABEL }, | 86 IDS_COOKIES_FILE_SYSTEM_PERSISTENT_USAGE_LABEL }, |
85 { "cookie_server_bound_cert", IDS_COOKIES_SERVER_BOUND_CERT }, | 87 { "cookie_server_bound_cert", IDS_COOKIES_SERVER_BOUND_CERT }, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 apps_map[std::string()] = new LocalDataContainer( | 188 apps_map[std::string()] = new LocalDataContainer( |
187 "Site Data", std::string(), | 189 "Site Data", std::string(), |
188 new BrowsingDataCookieHelper(profile->GetRequestContext()), | 190 new BrowsingDataCookieHelper(profile->GetRequestContext()), |
189 new BrowsingDataDatabaseHelper(profile), | 191 new BrowsingDataDatabaseHelper(profile), |
190 new BrowsingDataLocalStorageHelper(profile), | 192 new BrowsingDataLocalStorageHelper(profile), |
191 NULL, | 193 NULL, |
192 new BrowsingDataAppCacheHelper(profile), | 194 new BrowsingDataAppCacheHelper(profile), |
193 BrowsingDataIndexedDBHelper::Create(profile), | 195 BrowsingDataIndexedDBHelper::Create(profile), |
194 BrowsingDataFileSystemHelper::Create(profile), | 196 BrowsingDataFileSystemHelper::Create(profile), |
195 BrowsingDataQuotaHelper::Create(profile), | 197 BrowsingDataQuotaHelper::Create(profile), |
196 BrowsingDataServerBoundCertHelper::Create(profile)); | 198 BrowsingDataServerBoundCertHelper::Create(profile), |
199 BrowsingDataFlashLSOHelper::Create(profile)); | |
197 cookies_tree_model_.reset( | 200 cookies_tree_model_.reset( |
198 new CookiesTreeModel(apps_map, | 201 new CookiesTreeModel(apps_map, |
199 profile->GetExtensionSpecialStoragePolicy(), | 202 profile->GetExtensionSpecialStoragePolicy(), |
200 false)); | 203 false)); |
201 cookies_tree_model_->AddCookiesTreeObserver(this); | 204 cookies_tree_model_->AddCookiesTreeObserver(this); |
202 } | 205 } |
203 | 206 |
204 if (app_context_ && !app_cookies_tree_model_.get()) { | 207 if (app_context_ && !app_cookies_tree_model_.get()) { |
205 Profile* profile = Profile::FromWebUI(web_ui()); | 208 Profile* profile = Profile::FromWebUI(web_ui()); |
206 ContainerMap apps_map; | 209 ContainerMap apps_map; |
207 const ExtensionService* service = profile->GetExtensionService(); | 210 const ExtensionService* service = profile->GetExtensionService(); |
208 if (service) { | 211 if (service) { |
209 const ExtensionSet* extensions = service->extensions(); | 212 const ExtensionSet* extensions = service->extensions(); |
210 for (ExtensionSet::const_iterator it = extensions->begin(); | 213 for (ExtensionSet::const_iterator it = extensions->begin(); |
211 it != extensions->end(); ++it) { | 214 it != extensions->end(); ++it) { |
212 if ((*it)->is_storage_isolated()) { | 215 if ((*it)->is_storage_isolated()) { |
213 net::URLRequestContextGetter* context_getter = | 216 net::URLRequestContextGetter* context_getter = |
214 profile->GetRequestContextForIsolatedApp((*it)->id()); | 217 profile->GetRequestContextForIsolatedApp((*it)->id()); |
215 // TODO(nasko): When new types of storage are isolated, add the | 218 // TODO(nasko): When new types of storage are isolated, add the |
216 // appropriate browsing data helper objects to the constructor. | 219 // appropriate browsing data helper objects to the constructor. |
217 // For now, just cookies are isolated, so other parameters are NULL. | 220 // For now, just cookies are isolated, so other parameters are NULL. |
218 apps_map[(*it)->id()] = new LocalDataContainer( | 221 apps_map[(*it)->id()] = new LocalDataContainer( |
219 (*it)->name(), (*it)->id(), | 222 (*it)->name(), (*it)->id(), |
220 new BrowsingDataCookieHelper(context_getter), | 223 new BrowsingDataCookieHelper(context_getter), |
221 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); | 224 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); |
James Hawkins
2012/07/30 03:04:39
Super sad face.
markusheintz_
2012/07/30 14:02:15
The cookies tree mode and browsing data helper cod
Bernhard Bauer
2012/07/31 00:20:03
Markus, we should add doing something like having
markusheintz_
2012/07/31 15:09:13
Yes, I'll file a bug.
| |
222 } | 225 } |
223 } | 226 } |
224 app_cookies_tree_model_.reset( | 227 app_cookies_tree_model_.reset( |
225 new CookiesTreeModel(apps_map, | 228 new CookiesTreeModel(apps_map, |
226 profile->GetExtensionSpecialStoragePolicy(), | 229 profile->GetExtensionSpecialStoragePolicy(), |
227 false)); | 230 false)); |
228 app_cookies_tree_model_->AddCookiesTreeObserver(this); | 231 app_cookies_tree_model_->AddCookiesTreeObserver(this); |
229 } | 232 } |
230 } | 233 } |
231 } | 234 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 std::string CookiesViewHandler::GetCallback( | 305 std::string CookiesViewHandler::GetCallback( |
303 std::string method, CookiesTreeModel* model) { | 306 std::string method, CookiesTreeModel* model) { |
304 std::string callback("CookiesView"); | 307 std::string callback("CookiesView"); |
305 | 308 |
306 if (model == app_cookies_tree_model_) | 309 if (model == app_cookies_tree_model_) |
307 callback.append("App"); | 310 callback.append("App"); |
308 return callback.append(".").append(method); | 311 return callback.append(".").append(method); |
309 } | 312 } |
310 | 313 |
311 } // namespace options2 | 314 } // namespace options2 |
OLD | NEW |