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

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

Issue 10919307: Move IndexedDBContext into the StoragePartition and ensure isolation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove useless include Created 8 years, 3 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 | Annotate | Revision Log
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 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"
28 #include "content/public/browser/storage_partition.h"
27 #include "content/public/browser/web_ui.h" 29 #include "content/public/browser/web_ui.h"
28 #include "grit/generated_resources.h" 30 #include "grit/generated_resources.h"
29 #include "ui/base/l10n/l10n_util.h" 31 #include "ui/base/l10n/l10n_util.h"
30 32
31 namespace options { 33 namespace options {
32 34
33 CookiesViewHandler::CookiesViewHandler() 35 CookiesViewHandler::CookiesViewHandler()
34 : batch_update_(false), 36 : batch_update_(false),
35 app_context_(false), 37 app_context_(false),
36 model_util_(new CookiesTreeModelUtil) { 38 model_util_(new CookiesTreeModelUtil) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 DCHECK(batch_update_); 183 DCHECK(batch_update_);
182 batch_update_ = false; 184 batch_update_ = false;
183 185
184 SendChildren(model->GetRoot()); 186 SendChildren(model->GetRoot());
185 } 187 }
186 188
187 void CookiesViewHandler::EnsureCookiesTreeModelCreated() { 189 void CookiesViewHandler::EnsureCookiesTreeModelCreated() {
188 if (!app_context_ && !cookies_tree_model_.get()) { 190 if (!app_context_ && !cookies_tree_model_.get()) {
189 Profile* profile = Profile::FromWebUI(web_ui()); 191 Profile* profile = Profile::FromWebUI(web_ui());
190 ContainerMap apps_map; 192 ContainerMap apps_map;
193 content::StoragePartition* storage_partition =
194 content::BrowserContext::GetDefaultStoragePartition(profile);
195 content::IndexedDBContext* indexed_db_context =
196 storage_partition->GetIndexedDBContext();
191 apps_map[std::string()] = new LocalDataContainer( 197 apps_map[std::string()] = new LocalDataContainer(
192 "Site Data", std::string(), 198 "Site Data", std::string(),
193 new BrowsingDataCookieHelper(profile->GetRequestContext()), 199 new BrowsingDataCookieHelper(profile->GetRequestContext()),
194 new BrowsingDataDatabaseHelper(profile), 200 new BrowsingDataDatabaseHelper(profile),
195 new BrowsingDataLocalStorageHelper(profile), 201 new BrowsingDataLocalStorageHelper(profile),
196 NULL, 202 NULL,
197 new BrowsingDataAppCacheHelper(profile), 203 new BrowsingDataAppCacheHelper(profile),
198 BrowsingDataIndexedDBHelper::Create(profile), 204 BrowsingDataIndexedDBHelper::Create(indexed_db_context),
199 BrowsingDataFileSystemHelper::Create(profile), 205 BrowsingDataFileSystemHelper::Create(profile),
200 BrowsingDataQuotaHelper::Create(profile), 206 BrowsingDataQuotaHelper::Create(profile),
201 BrowsingDataServerBoundCertHelper::Create(profile), 207 BrowsingDataServerBoundCertHelper::Create(profile),
202 BrowsingDataFlashLSOHelper::Create(profile)); 208 BrowsingDataFlashLSOHelper::Create(profile));
203 cookies_tree_model_.reset( 209 cookies_tree_model_.reset(
204 new CookiesTreeModel(apps_map, 210 new CookiesTreeModel(apps_map,
205 profile->GetExtensionSpecialStoragePolicy(), 211 profile->GetExtensionSpecialStoragePolicy(),
206 false)); 212 false));
207 cookies_tree_model_->AddCookiesTreeObserver(this); 213 cookies_tree_model_->AddCookiesTreeObserver(this);
208 } 214 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 std::string CookiesViewHandler::GetCallback( 321 std::string CookiesViewHandler::GetCallback(
316 std::string method, CookiesTreeModel* model) { 322 std::string method, CookiesTreeModel* model) {
317 std::string callback("CookiesView"); 323 std::string callback("CookiesView");
318 324
319 if (model == app_cookies_tree_model_) 325 if (model == app_cookies_tree_model_)
320 callback.append("App"); 326 callback.append("App");
321 return callback.append(".").append(method); 327 return callback.append(".").append(method);
322 } 328 }
323 329
324 } // namespace options 330 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698