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/cookies_tree_model.h" | 5 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 const BrowsingDataLocalStorageHelper::LocalStorageInfo* | 207 const BrowsingDataLocalStorageHelper::LocalStorageInfo* |
208 session_storage_info) { | 208 session_storage_info) { |
209 Init(TYPE_SESSION_STORAGE); | 209 Init(TYPE_SESSION_STORAGE); |
210 this->session_storage_info = session_storage_info; | 210 this->session_storage_info = session_storage_info; |
211 origin = session_storage_info->origin_url; | 211 origin = session_storage_info->origin_url; |
212 return *this; | 212 return *this; |
213 } | 213 } |
214 | 214 |
215 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitAppCache( | 215 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitAppCache( |
216 const GURL& origin, | 216 const GURL& origin, |
217 const appcache::AppCacheInfo* appcache_info) { | 217 const content::AppCacheInfo* appcache_info) { |
218 Init(TYPE_APPCACHE); | 218 Init(TYPE_APPCACHE); |
219 this->appcache_info = appcache_info; | 219 this->appcache_info = appcache_info; |
220 this->origin = origin; | 220 this->origin = origin; |
221 return *this; | 221 return *this; |
222 } | 222 } |
223 | 223 |
224 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitIndexedDB( | 224 CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitIndexedDB( |
225 const content::IndexedDBInfo* indexed_db_info) { | 225 const content::IndexedDBInfo* indexed_db_info) { |
226 Init(TYPE_INDEXED_DB); | 226 Init(TYPE_INDEXED_DB); |
227 this->indexed_db_info = indexed_db_info; | 227 this->indexed_db_info = indexed_db_info; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 CookieTreeNode::DetailedInfo CookieTreeCookieNode::GetDetailedInfo() const { | 295 CookieTreeNode::DetailedInfo CookieTreeCookieNode::GetDetailedInfo() const { |
296 return DetailedInfo().InitCookie(&*cookie_); | 296 return DetailedInfo().InitCookie(&*cookie_); |
297 } | 297 } |
298 | 298 |
299 /////////////////////////////////////////////////////////////////////////////// | 299 /////////////////////////////////////////////////////////////////////////////// |
300 // CookieTreeAppCacheNode, public: | 300 // CookieTreeAppCacheNode, public: |
301 | 301 |
302 CookieTreeAppCacheNode::CookieTreeAppCacheNode( | 302 CookieTreeAppCacheNode::CookieTreeAppCacheNode( |
303 const GURL& origin_url, | 303 const GURL& origin_url, |
304 std::list<appcache::AppCacheInfo>::iterator appcache_info) | 304 std::list<content::AppCacheInfo>::iterator appcache_info) |
305 : CookieTreeNode(base::UTF8ToUTF16(appcache_info->manifest_url.spec())), | 305 : CookieTreeNode(base::UTF8ToUTF16(appcache_info->manifest_url.spec())), |
306 origin_url_(origin_url), | 306 origin_url_(origin_url), |
307 appcache_info_(appcache_info) { | 307 appcache_info_(appcache_info) { |
308 } | 308 } |
309 | 309 |
310 CookieTreeAppCacheNode::~CookieTreeAppCacheNode() { | 310 CookieTreeAppCacheNode::~CookieTreeAppCacheNode() { |
311 } | 311 } |
312 | 312 |
313 void CookieTreeAppCacheNode::DeleteStoredObjects() { | 313 void CookieTreeAppCacheNode::DeleteStoredObjects() { |
314 LocalDataContainer* container = GetLocalDataContainerForNode(this); | 314 LocalDataContainer* container = GetLocalDataContainerForNode(this); |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 void CookiesTreeModel::PopulateFlashLSOInfo( | 1039 void CookiesTreeModel::PopulateFlashLSOInfo( |
1040 LocalDataContainer* container) { | 1040 LocalDataContainer* container) { |
1041 ScopedBatchUpdateNotifier notifier(this, GetRoot()); | 1041 ScopedBatchUpdateNotifier notifier(this, GetRoot()); |
1042 PopulateFlashLSOInfoWithFilter(container, ¬ifier, base::string16()); | 1042 PopulateFlashLSOInfoWithFilter(container, ¬ifier, base::string16()); |
1043 } | 1043 } |
1044 | 1044 |
1045 void CookiesTreeModel::PopulateAppCacheInfoWithFilter( | 1045 void CookiesTreeModel::PopulateAppCacheInfoWithFilter( |
1046 LocalDataContainer* container, | 1046 LocalDataContainer* container, |
1047 ScopedBatchUpdateNotifier* notifier, | 1047 ScopedBatchUpdateNotifier* notifier, |
1048 const base::string16& filter) { | 1048 const base::string16& filter) { |
1049 using appcache::AppCacheInfo; | 1049 using content::AppCacheInfo; |
1050 typedef std::map<GURL, std::list<AppCacheInfo> > InfoByOrigin; | 1050 typedef std::map<GURL, std::list<AppCacheInfo> > InfoByOrigin; |
1051 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); | 1051 CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); |
1052 | 1052 |
1053 if (container->appcache_info_.empty()) | 1053 if (container->appcache_info_.empty()) |
1054 return; | 1054 return; |
1055 | 1055 |
1056 notifier->StartBatchUpdate(); | 1056 notifier->StartBatchUpdate(); |
1057 for (InfoByOrigin::iterator origin = container->appcache_info_.begin(); | 1057 for (InfoByOrigin::iterator origin = container->appcache_info_.begin(); |
1058 origin != container->appcache_info_.end(); ++origin) { | 1058 origin != container->appcache_info_.end(); ++origin) { |
1059 base::string16 host_node_name = base::UTF8ToUTF16(origin->first.host()); | 1059 base::string16 host_node_name = base::UTF8ToUTF16(origin->first.host()); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1335 | 1335 |
1336 void CookiesTreeModel::NotifyObserverEndBatch() { | 1336 void CookiesTreeModel::NotifyObserverEndBatch() { |
1337 // Only notify the observers if this is the outermost call to EndBatch() if | 1337 // Only notify the observers if this is the outermost call to EndBatch() if |
1338 // called in a nested manner. | 1338 // called in a nested manner. |
1339 if (--batch_update_ == 0) { | 1339 if (--batch_update_ == 0) { |
1340 FOR_EACH_OBSERVER(Observer, | 1340 FOR_EACH_OBSERVER(Observer, |
1341 cookies_observer_list_, | 1341 cookies_observer_list_, |
1342 TreeModelEndBatch(this)); | 1342 TreeModelEndBatch(this)); |
1343 } | 1343 } |
1344 } | 1344 } |
OLD | NEW |