| 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/browsing_data/local_data_container.h" | 5 #include "chrome/browser/browsing_data/local_data_container.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/linked_ptr.h" | 8 #include "base/memory/linked_ptr.h" |
| 9 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
| 9 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" | |
| 11 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 11 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 12 #include "chrome/browser/content_settings/cookie_settings.h" | 12 #include "chrome/browser/content_settings/cookie_settings.h" |
| 13 #include "net/cookies/canonical_cookie.h" | 13 #include "net/cookies/canonical_cookie.h" |
| 14 | 14 |
| 15 /////////////////////////////////////////////////////////////////////////////// | 15 /////////////////////////////////////////////////////////////////////////////// |
| 16 // LocalDataContainer, public: | 16 // LocalDataContainer, public: |
| 17 | 17 |
| 18 LocalDataContainer::LocalDataContainer( | 18 LocalDataContainer::LocalDataContainer( |
| 19 BrowsingDataCookieHelper* cookie_helper, | 19 BrowsingDataCookieHelper* cookie_helper, |
| 20 BrowsingDataDatabaseHelper* database_helper, | 20 BrowsingDataDatabaseHelper* database_helper, |
| 21 BrowsingDataLocalStorageHelper* local_storage_helper, | 21 BrowsingDataLocalStorageHelper* local_storage_helper, |
| 22 BrowsingDataLocalStorageHelper* session_storage_helper, | 22 BrowsingDataLocalStorageHelper* session_storage_helper, |
| 23 BrowsingDataAppCacheHelper* appcache_helper, | 23 BrowsingDataAppCacheHelper* appcache_helper, |
| 24 BrowsingDataIndexedDBHelper* indexed_db_helper, | 24 BrowsingDataIndexedDBHelper* indexed_db_helper, |
| 25 BrowsingDataFileSystemHelper* file_system_helper, | 25 BrowsingDataFileSystemHelper* file_system_helper, |
| 26 BrowsingDataQuotaHelper* quota_helper, | 26 BrowsingDataQuotaHelper* quota_helper, |
| 27 BrowsingDataServerBoundCertHelper* server_bound_cert_helper, | 27 BrowsingDataChannelIDHelper* channel_id_helper, |
| 28 BrowsingDataFlashLSOHelper* flash_lso_helper) | 28 BrowsingDataFlashLSOHelper* flash_lso_helper) |
| 29 : appcache_helper_(appcache_helper), | 29 : appcache_helper_(appcache_helper), |
| 30 cookie_helper_(cookie_helper), | 30 cookie_helper_(cookie_helper), |
| 31 database_helper_(database_helper), | 31 database_helper_(database_helper), |
| 32 local_storage_helper_(local_storage_helper), | 32 local_storage_helper_(local_storage_helper), |
| 33 session_storage_helper_(session_storage_helper), | 33 session_storage_helper_(session_storage_helper), |
| 34 indexed_db_helper_(indexed_db_helper), | 34 indexed_db_helper_(indexed_db_helper), |
| 35 file_system_helper_(file_system_helper), | 35 file_system_helper_(file_system_helper), |
| 36 quota_helper_(quota_helper), | 36 quota_helper_(quota_helper), |
| 37 server_bound_cert_helper_(server_bound_cert_helper), | 37 channel_id_helper_(channel_id_helper), |
| 38 flash_lso_helper_(flash_lso_helper), | 38 flash_lso_helper_(flash_lso_helper), |
| 39 model_(NULL), | 39 model_(NULL), |
| 40 weak_ptr_factory_(this) {} | 40 weak_ptr_factory_(this) {} |
| 41 | 41 |
| 42 LocalDataContainer::~LocalDataContainer() {} | 42 LocalDataContainer::~LocalDataContainer() {} |
| 43 | 43 |
| 44 void LocalDataContainer::Init(CookiesTreeModel* model) { | 44 void LocalDataContainer::Init(CookiesTreeModel* model) { |
| 45 DCHECK(!model_); | 45 DCHECK(!model_); |
| 46 model_ = model; | 46 model_ = model; |
| 47 | 47 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 base::Bind(&LocalDataContainer::OnFileSystemModelInfoLoaded, | 87 base::Bind(&LocalDataContainer::OnFileSystemModelInfoLoaded, |
| 88 weak_ptr_factory_.GetWeakPtr())); | 88 weak_ptr_factory_.GetWeakPtr())); |
| 89 } | 89 } |
| 90 | 90 |
| 91 if (quota_helper_.get()) { | 91 if (quota_helper_.get()) { |
| 92 quota_helper_->StartFetching( | 92 quota_helper_->StartFetching( |
| 93 base::Bind(&LocalDataContainer::OnQuotaModelInfoLoaded, | 93 base::Bind(&LocalDataContainer::OnQuotaModelInfoLoaded, |
| 94 weak_ptr_factory_.GetWeakPtr())); | 94 weak_ptr_factory_.GetWeakPtr())); |
| 95 } | 95 } |
| 96 | 96 |
| 97 if (server_bound_cert_helper_.get()) { | 97 if (channel_id_helper_.get()) { |
| 98 server_bound_cert_helper_->StartFetching( | 98 channel_id_helper_->StartFetching( |
| 99 base::Bind(&LocalDataContainer::OnServerBoundCertModelInfoLoaded, | 99 base::Bind(&LocalDataContainer::OnChannelIDModelInfoLoaded, |
| 100 weak_ptr_factory_.GetWeakPtr())); | 100 weak_ptr_factory_.GetWeakPtr())); |
| 101 } | 101 } |
| 102 | 102 |
| 103 if (flash_lso_helper_.get()) { | 103 if (flash_lso_helper_.get()) { |
| 104 flash_lso_helper_->StartFetching( | 104 flash_lso_helper_->StartFetching( |
| 105 base::Bind(&LocalDataContainer::OnFlashLSOInfoLoaded, | 105 base::Bind(&LocalDataContainer::OnFlashLSOInfoLoaded, |
| 106 weak_ptr_factory_.GetWeakPtr())); | 106 weak_ptr_factory_.GetWeakPtr())); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 model_->PopulateFileSystemInfo(this); | 173 model_->PopulateFileSystemInfo(this); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void LocalDataContainer::OnQuotaModelInfoLoaded( | 176 void LocalDataContainer::OnQuotaModelInfoLoaded( |
| 177 const QuotaInfoList& quota_info) { | 177 const QuotaInfoList& quota_info) { |
| 178 quota_info_list_ = quota_info; | 178 quota_info_list_ = quota_info; |
| 179 DCHECK(model_); | 179 DCHECK(model_); |
| 180 model_->PopulateQuotaInfo(this); | 180 model_->PopulateQuotaInfo(this); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void LocalDataContainer::OnServerBoundCertModelInfoLoaded( | 183 void LocalDataContainer::OnChannelIDModelInfoLoaded( |
| 184 const ServerBoundCertList& cert_list) { | 184 const ChannelIDList& channel_id_list) { |
| 185 server_bound_cert_list_ = cert_list; | 185 channel_id_list_ = channel_id_list; |
| 186 DCHECK(model_); | 186 DCHECK(model_); |
| 187 model_->PopulateServerBoundCertInfo(this); | 187 model_->PopulateChannelIDInfo(this); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void LocalDataContainer::OnFlashLSOInfoLoaded( | 190 void LocalDataContainer::OnFlashLSOInfoLoaded( |
| 191 const FlashLSODomainList& domains) { | 191 const FlashLSODomainList& domains) { |
| 192 flash_lso_domain_list_ = domains; | 192 flash_lso_domain_list_ = domains; |
| 193 DCHECK(model_); | 193 DCHECK(model_); |
| 194 model_->PopulateFlashLSOInfo(this); | 194 model_->PopulateFlashLSOInfo(this); |
| 195 } | 195 } |
| OLD | NEW |