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

Unified Diff: chrome/browser/ui/webui/options/cookies_view_handler.cc

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed a merging of removed variable. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/storage_partition_descriptor.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/cookies_view_handler.cc
diff --git a/chrome/browser/ui/webui/options/cookies_view_handler.cc b/chrome/browser/ui/webui/options/cookies_view_handler.cc
index 065c3dc51829c12fd65897090aaeb2c235a88b74..4bb075c027d5b3a91734566e6293d5ce36a14b14 100644
--- a/chrome/browser/ui/webui/options/cookies_view_handler.cc
+++ b/chrome/browser/ui/webui/options/cookies_view_handler.cc
@@ -22,9 +22,12 @@
#include "chrome/browser/browsing_data/browsing_data_quota_helper.h"
#include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/cookies_tree_model_util.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/site_instance.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_ui.h"
#include "grit/generated_resources.h"
@@ -223,28 +226,37 @@ void CookiesViewHandler::EnsureCookiesTreeModelCreated() {
Profile* profile = Profile::FromWebUI(web_ui());
ContainerMap apps_map;
const ExtensionService* service = profile->GetExtensionService();
- if (service) {
- const ExtensionSet* extensions = service->extensions();
- for (ExtensionSet::const_iterator it = extensions->begin();
- it != extensions->end(); ++it) {
- if ((*it)->is_storage_isolated()) {
- net::URLRequestContextGetter* context_getter =
- profile->GetRequestContextForStoragePartition((*it)->id());
- // TODO(nasko): When new types of storage are isolated, add the
- // appropriate browsing data helper objects to the constructor.
- // For now, just cookies are isolated, so other parameters are NULL.
- apps_map[(*it)->id()] = new LocalDataContainer(
- (*it)->name(), (*it)->id(),
- new BrowsingDataCookieHelper(context_getter),
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- }
+ if (!service)
+ return;
+
+ ExtensionProcessManager* process_manager =
+ extensions::ExtensionSystem::Get(profile)->process_manager();
+ if (!process_manager)
+ return;
+
+ const ExtensionSet* extensions = service->extensions();
+ for (ExtensionSet::const_iterator it = extensions->begin();
+ it != extensions->end(); ++it) {
+ if ((*it)->is_storage_isolated()) {
+ content::StoragePartition* storage_partition =
+ content::BrowserContext::GetStoragePartitionForSite(profile,
+ (*it)->url());
+ net::URLRequestContextGetter* context_getter =
+ storage_partition->GetURLRequestContext();
+ // TODO(nasko): When new types of storage are isolated, add the
+ // appropriate browsing data helper objects to the constructor.
+ // For now, just cookies are isolated, so other parameters are NULL.
+ apps_map[(*it)->id()] = new LocalDataContainer(
+ (*it)->name(), (*it)->id(),
+ new BrowsingDataCookieHelper(context_getter),
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
- app_cookies_tree_model_.reset(
- new CookiesTreeModel(apps_map,
- profile->GetExtensionSpecialStoragePolicy(),
- false));
- app_cookies_tree_model_->AddCookiesTreeObserver(this);
}
+ app_cookies_tree_model_.reset(
+ new CookiesTreeModel(apps_map,
+ profile->GetExtensionSpecialStoragePolicy(),
+ false));
+ app_cookies_tree_model_->AddCookiesTreeObserver(this);
}
}
« no previous file with comments | « chrome/browser/profiles/storage_partition_descriptor.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698