Chromium Code Reviews| 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/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_flash_lso_helper.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" | 20 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" |
| 21 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 21 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
| 22 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" | 22 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h" |
| 23 #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" |
| 24 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" | 26 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" |
| 27 #include "content/public/browser/browser_context.h" | 27 #include "content/public/browser/browser_context.h" |
| 28 #include "content/public/browser/render_process_host.h" | |
| 29 #include "content/public/browser/site_instance.h" | |
| 28 #include "content/public/browser/storage_partition.h" | 30 #include "content/public/browser/storage_partition.h" |
| 29 #include "content/public/browser/web_ui.h" | 31 #include "content/public/browser/web_ui.h" |
| 30 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 32 | 34 |
| 33 namespace fileapi { | 35 namespace fileapi { |
| 34 class FileSystemContext; | 36 class FileSystemContext; |
| 35 } | 37 } |
| 36 | 38 |
| 37 namespace options { | 39 namespace options { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 new CookiesTreeModel(apps_map, | 218 new CookiesTreeModel(apps_map, |
| 217 profile->GetExtensionSpecialStoragePolicy(), | 219 profile->GetExtensionSpecialStoragePolicy(), |
| 218 false)); | 220 false)); |
| 219 cookies_tree_model_->AddCookiesTreeObserver(this); | 221 cookies_tree_model_->AddCookiesTreeObserver(this); |
| 220 } | 222 } |
| 221 | 223 |
| 222 if (app_context_ && !app_cookies_tree_model_.get()) { | 224 if (app_context_ && !app_cookies_tree_model_.get()) { |
| 223 Profile* profile = Profile::FromWebUI(web_ui()); | 225 Profile* profile = Profile::FromWebUI(web_ui()); |
| 224 ContainerMap apps_map; | 226 ContainerMap apps_map; |
| 225 const ExtensionService* service = profile->GetExtensionService(); | 227 const ExtensionService* service = profile->GetExtensionService(); |
| 226 if (service) { | 228 ExtensionProcessManager* process_manager = |
| 229 profile->GetExtensionProcessManager(); | |
|
awong
2012/10/29 23:37:40
2 more spaces
nasko
2012/10/30 00:32:59
Done.
| |
| 230 if (service && process_manager) { | |
| 227 const ExtensionSet* extensions = service->extensions(); | 231 const ExtensionSet* extensions = service->extensions(); |
| 228 for (ExtensionSet::const_iterator it = extensions->begin(); | 232 for (ExtensionSet::const_iterator it = extensions->begin(); |
| 229 it != extensions->end(); ++it) { | 233 it != extensions->end(); ++it) { |
| 230 if ((*it)->is_storage_isolated()) { | 234 if ((*it)->is_storage_isolated()) { |
| 235 content::StoragePartition* storage_partition = | |
| 236 content::BrowserContext::GetStoragePartitionForSite(profile, | |
| 237 (*it)->url()); | |
| 231 net::URLRequestContextGetter* context_getter = | 238 net::URLRequestContextGetter* context_getter = |
| 232 profile->GetRequestContextForStoragePartition((*it)->id()); | 239 storage_partition->GetURLRequestContext(); |
|
awong
2012/10/29 23:37:40
Why is this changing? Is it just cleanup, or is th
nasko
2012/10/30 00:32:59
Because GetRequestContextForStoragePartition is ch
| |
| 233 // TODO(nasko): When new types of storage are isolated, add the | 240 // TODO(nasko): When new types of storage are isolated, add the |
| 234 // appropriate browsing data helper objects to the constructor. | 241 // appropriate browsing data helper objects to the constructor. |
| 235 // For now, just cookies are isolated, so other parameters are NULL. | 242 // For now, just cookies are isolated, so other parameters are NULL. |
| 236 apps_map[(*it)->id()] = new LocalDataContainer( | 243 apps_map[(*it)->id()] = new LocalDataContainer( |
| 237 (*it)->name(), (*it)->id(), | 244 (*it)->name(), (*it)->id(), |
| 238 new BrowsingDataCookieHelper(context_getter), | 245 new BrowsingDataCookieHelper(context_getter), |
| 239 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); | 246 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); |
| 240 } | 247 } |
| 241 } | 248 } |
| 242 app_cookies_tree_model_.reset( | 249 app_cookies_tree_model_.reset( |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 std::string CookiesViewHandler::GetCallback( | 334 std::string CookiesViewHandler::GetCallback( |
| 328 std::string method, CookiesTreeModel* model) { | 335 std::string method, CookiesTreeModel* model) { |
| 329 std::string callback("CookiesView"); | 336 std::string callback("CookiesView"); |
| 330 | 337 |
| 331 if (model == app_cookies_tree_model_) | 338 if (model == app_cookies_tree_model_) |
| 332 callback.append("App"); | 339 callback.append("App"); |
| 333 return callback.append(".").append(method); | 340 return callback.append(".").append(method); |
| 334 } | 341 } |
| 335 | 342 |
| 336 } // namespace options | 343 } // namespace options |
| OLD | NEW |