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

Unified Diff: chrome/browser/local_data_container.cc

Issue 10805015: Move browsing_data_helper files into a separate directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chrome_frame build Created 8 years, 5 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/local_data_container.h ('k') | chrome/browser/mock_browsing_data_appcache_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_data_container.cc
diff --git a/chrome/browser/local_data_container.cc b/chrome/browser/local_data_container.cc
deleted file mode 100644
index 89d749c1eff931324fa787e81d0a68b262d2481e..0000000000000000000000000000000000000000
--- a/chrome/browser/local_data_container.cc
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/local_data_container.h"
-
-#include "base/bind.h"
-#include "base/memory/linked_ptr.h"
-#include "chrome/browser/browsing_data_cookie_helper.h"
-#include "chrome/browser/browsing_data_server_bound_cert_helper.h"
-#include "chrome/browser/content_settings/cookie_settings.h"
-#include "chrome/browser/cookies_tree_model.h"
-#include "net/cookies/canonical_cookie.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// LocalDataContainer, public:
-
-LocalDataContainer::LocalDataContainer(
- const std::string& app_name,
- const std::string& app_id,
- BrowsingDataCookieHelper* cookie_helper,
- BrowsingDataDatabaseHelper* database_helper,
- BrowsingDataLocalStorageHelper* local_storage_helper,
- BrowsingDataLocalStorageHelper* session_storage_helper,
- BrowsingDataAppCacheHelper* appcache_helper,
- BrowsingDataIndexedDBHelper* indexed_db_helper,
- BrowsingDataFileSystemHelper* file_system_helper,
- BrowsingDataQuotaHelper* quota_helper,
- BrowsingDataServerBoundCertHelper* server_bound_cert_helper)
- : app_name_(app_name),
- app_id_(app_id),
- appcache_helper_(appcache_helper),
- cookie_helper_(cookie_helper),
- database_helper_(database_helper),
- local_storage_helper_(local_storage_helper),
- session_storage_helper_(session_storage_helper),
- indexed_db_helper_(indexed_db_helper),
- file_system_helper_(file_system_helper),
- quota_helper_(quota_helper),
- server_bound_cert_helper_(server_bound_cert_helper),
- model_(NULL),
- ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {}
-
-LocalDataContainer::~LocalDataContainer() {}
-
-void LocalDataContainer::Init(CookiesTreeModel* model) {
- DCHECK(!model_);
- model_ = model;
-
- DCHECK(cookie_helper_);
- cookie_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnCookiesModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
-
- if (database_helper_) {
- database_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnDatabaseModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-
- if (local_storage_helper_) {
- local_storage_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnLocalStorageModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-
- if (session_storage_helper_) {
- session_storage_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnSessionStorageModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-
- // TODO(michaeln): When all of the UI implementations have been updated, make
- // this a required parameter.
- if (appcache_helper_) {
- appcache_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnAppCacheModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-
- if (indexed_db_helper_) {
- indexed_db_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnIndexedDBModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-
- if (file_system_helper_) {
- file_system_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnFileSystemModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-
- if (quota_helper_) {
- quota_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnQuotaModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-
- if (server_bound_cert_helper_) {
- server_bound_cert_helper_->StartFetching(
- base::Bind(&LocalDataContainer::OnServerBoundCertModelInfoLoaded,
- weak_ptr_factory_.GetWeakPtr()));
- }
-}
-
-void LocalDataContainer::OnAppCacheModelInfoLoaded() {
- using appcache::AppCacheInfo;
- using appcache::AppCacheInfoCollection;
- using appcache::AppCacheInfoVector;
- typedef std::map<GURL, AppCacheInfoVector> InfoByOrigin;
-
- scoped_refptr<AppCacheInfoCollection> appcache_info =
- appcache_helper_->info_collection();
- if (!appcache_info || appcache_info->infos_by_origin.empty())
- return;
-
- for (InfoByOrigin::const_iterator origin =
- appcache_info->infos_by_origin.begin();
- origin != appcache_info->infos_by_origin.end(); ++origin) {
- std::list<AppCacheInfo>& info_list = appcache_info_[origin->first];
- info_list.insert(
- info_list.begin(), origin->second.begin(), origin->second.end());
- }
-
- model_->PopulateAppCacheInfo(this);
-}
-
-void LocalDataContainer::OnCookiesModelInfoLoaded(
- const net::CookieList& cookie_list) {
- cookie_list_.insert(cookie_list_.begin(),
- cookie_list.begin(),
- cookie_list.end());
- DCHECK(model_);
- model_->PopulateCookieInfo(this);
-}
-
-void LocalDataContainer::OnDatabaseModelInfoLoaded(
- const DatabaseInfoList& database_info) {
- database_info_list_ = database_info;
- DCHECK(model_);
- model_->PopulateDatabaseInfo(this);
-}
-
-void LocalDataContainer::OnLocalStorageModelInfoLoaded(
- const LocalStorageInfoList& local_storage_info) {
- local_storage_info_list_ = local_storage_info;
- DCHECK(model_);
- model_->PopulateLocalStorageInfo(this);
-}
-
-void LocalDataContainer::OnSessionStorageModelInfoLoaded(
- const LocalStorageInfoList& session_storage_info) {
- session_storage_info_list_ = session_storage_info;
- DCHECK(model_);
- model_->PopulateSessionStorageInfo(this);
-}
-
-void LocalDataContainer::OnIndexedDBModelInfoLoaded(
- const IndexedDBInfoList& indexed_db_info) {
- indexed_db_info_list_ = indexed_db_info;
- DCHECK(model_);
- model_->PopulateIndexedDBInfo(this);
-}
-
-void LocalDataContainer::OnFileSystemModelInfoLoaded(
- const FileSystemInfoList& file_system_info) {
- file_system_info_list_ = file_system_info;
- DCHECK(model_);
- model_->PopulateFileSystemInfo(this);
-}
-
-void LocalDataContainer::OnQuotaModelInfoLoaded(
- const QuotaInfoList& quota_info) {
- quota_info_list_ = quota_info;
- DCHECK(model_);
- model_->PopulateQuotaInfo(this);
-}
-
-void LocalDataContainer::OnServerBoundCertModelInfoLoaded(
- const ServerBoundCertList& cert_list) {
- server_bound_cert_list_ = cert_list;
- DCHECK(model_);
- model_->PopulateServerBoundCertInfo(this);
-}
« no previous file with comments | « chrome/browser/local_data_container.h ('k') | chrome/browser/mock_browsing_data_appcache_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698