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_cookie_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_flash_lso_helper.h" |
10 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.h" |
11 #include "chrome/browser/content_settings/cookie_settings.h" | 11 #include "chrome/browser/content_settings/cookie_settings.h" |
12 #include "chrome/browser/cookies_tree_model.h" | 12 #include "chrome/browser/cookies_tree_model.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 const std::string& app_name, | 19 const std::string& app_name, |
20 const std::string& app_id, | 20 const std::string& app_id, |
21 BrowsingDataCookieHelper* cookie_helper, | 21 BrowsingDataCookieHelper* cookie_helper, |
22 BrowsingDataDatabaseHelper* database_helper, | 22 BrowsingDataDatabaseHelper* database_helper, |
23 BrowsingDataLocalStorageHelper* local_storage_helper, | 23 BrowsingDataLocalStorageHelper* local_storage_helper, |
24 BrowsingDataLocalStorageHelper* session_storage_helper, | 24 BrowsingDataLocalStorageHelper* session_storage_helper, |
25 BrowsingDataAppCacheHelper* appcache_helper, | 25 BrowsingDataAppCacheHelper* appcache_helper, |
26 BrowsingDataIndexedDBHelper* indexed_db_helper, | 26 BrowsingDataIndexedDBHelper* indexed_db_helper, |
27 BrowsingDataFileSystemHelper* file_system_helper, | 27 BrowsingDataFileSystemHelper* file_system_helper, |
28 BrowsingDataQuotaHelper* quota_helper, | 28 BrowsingDataQuotaHelper* quota_helper, |
29 BrowsingDataServerBoundCertHelper* server_bound_cert_helper) | 29 BrowsingDataServerBoundCertHelper* server_bound_cert_helper, |
30 BrowsingDataFlashLSOHelper* flash_lso_helper) | |
30 : app_name_(app_name), | 31 : app_name_(app_name), |
31 app_id_(app_id), | 32 app_id_(app_id), |
32 appcache_helper_(appcache_helper), | 33 appcache_helper_(appcache_helper), |
33 cookie_helper_(cookie_helper), | 34 cookie_helper_(cookie_helper), |
34 database_helper_(database_helper), | 35 database_helper_(database_helper), |
35 local_storage_helper_(local_storage_helper), | 36 local_storage_helper_(local_storage_helper), |
36 session_storage_helper_(session_storage_helper), | 37 session_storage_helper_(session_storage_helper), |
37 indexed_db_helper_(indexed_db_helper), | 38 indexed_db_helper_(indexed_db_helper), |
38 file_system_helper_(file_system_helper), | 39 file_system_helper_(file_system_helper), |
39 quota_helper_(quota_helper), | 40 quota_helper_(quota_helper), |
40 server_bound_cert_helper_(server_bound_cert_helper), | 41 server_bound_cert_helper_(server_bound_cert_helper), |
42 flash_lso_helper_(flash_lso_helper), | |
41 model_(NULL), | 43 model_(NULL), |
42 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {} | 44 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {} |
43 | 45 |
44 LocalDataContainer::~LocalDataContainer() {} | 46 LocalDataContainer::~LocalDataContainer() {} |
45 | 47 |
46 void LocalDataContainer::Init(CookiesTreeModel* model) { | 48 void LocalDataContainer::Init(CookiesTreeModel* model) { |
47 DCHECK(!model_); | 49 DCHECK(!model_); |
48 model_ = model; | 50 model_ = model; |
49 | 51 |
50 DCHECK(cookie_helper_); | 52 DCHECK(cookie_helper_); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 quota_helper_->StartFetching( | 96 quota_helper_->StartFetching( |
95 base::Bind(&LocalDataContainer::OnQuotaModelInfoLoaded, | 97 base::Bind(&LocalDataContainer::OnQuotaModelInfoLoaded, |
96 weak_ptr_factory_.GetWeakPtr())); | 98 weak_ptr_factory_.GetWeakPtr())); |
97 } | 99 } |
98 | 100 |
99 if (server_bound_cert_helper_) { | 101 if (server_bound_cert_helper_) { |
100 server_bound_cert_helper_->StartFetching( | 102 server_bound_cert_helper_->StartFetching( |
101 base::Bind(&LocalDataContainer::OnServerBoundCertModelInfoLoaded, | 103 base::Bind(&LocalDataContainer::OnServerBoundCertModelInfoLoaded, |
102 weak_ptr_factory_.GetWeakPtr())); | 104 weak_ptr_factory_.GetWeakPtr())); |
103 } | 105 } |
106 | |
107 if (flash_lso_helper_) { | |
108 flash_lso_helper_->StartFetching( | |
109 base::Bind(&LocalDataContainer::OnFlashLSOInfoLoaded, | |
110 weak_ptr_factory_.GetWeakPtr())); | |
111 } | |
104 } | 112 } |
105 | 113 |
106 void LocalDataContainer::OnAppCacheModelInfoLoaded() { | 114 void LocalDataContainer::OnAppCacheModelInfoLoaded() { |
107 using appcache::AppCacheInfo; | 115 using appcache::AppCacheInfo; |
108 using appcache::AppCacheInfoCollection; | 116 using appcache::AppCacheInfoCollection; |
109 using appcache::AppCacheInfoVector; | 117 using appcache::AppCacheInfoVector; |
110 typedef std::map<GURL, AppCacheInfoVector> InfoByOrigin; | 118 typedef std::map<GURL, AppCacheInfoVector> InfoByOrigin; |
111 | 119 |
112 scoped_refptr<AppCacheInfoCollection> appcache_info = | 120 scoped_refptr<AppCacheInfoCollection> appcache_info = |
113 appcache_helper_->info_collection(); | 121 appcache_helper_->info_collection(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 DCHECK(model_); | 183 DCHECK(model_); |
176 model_->PopulateQuotaInfo(this); | 184 model_->PopulateQuotaInfo(this); |
177 } | 185 } |
178 | 186 |
179 void LocalDataContainer::OnServerBoundCertModelInfoLoaded( | 187 void LocalDataContainer::OnServerBoundCertModelInfoLoaded( |
180 const ServerBoundCertList& cert_list) { | 188 const ServerBoundCertList& cert_list) { |
181 server_bound_cert_list_ = cert_list; | 189 server_bound_cert_list_ = cert_list; |
182 DCHECK(model_); | 190 DCHECK(model_); |
183 model_->PopulateServerBoundCertInfo(this); | 191 model_->PopulateServerBoundCertInfo(this); |
184 } | 192 } |
193 | |
194 void LocalDataContainer::OnFlashLSOInfoLoaded( | |
195 const FlashLSODomainList& domains) { | |
196 flash_lso_domain_list_ = domains; | |
markusheintz_
2012/07/31 15:09:13
domains/sites/
domain/site/
| |
197 DCHECK(model_); | |
198 model_->PopulateFlashLSOInfo(this); | |
199 } | |
OLD | NEW |