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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
11 class CannedBrowsingDataAppCacheHelper
;
12 class CannedBrowsingDataCookieHelper
;
13 class CannedBrowsingDataDatabaseHelper
;
14 class CannedBrowsingDataFileSystemHelper
;
15 class CannedBrowsingDataIndexedDBHelper
;
16 class CannedBrowsingDataLocalStorageHelper
;
17 class CannedBrowsingDataServerBoundCertHelper
;
18 class CookiesTreeModel
;
22 class LocalSharedObjectsContainer
{
24 explicit LocalSharedObjectsContainer(Profile
* profile
);
25 ~LocalSharedObjectsContainer();
27 // Empties the container.
30 // Returns the number of objects stored in the container.
31 size_t GetObjectCount() const;
33 // Returns the number of objects for the given |origin|.
34 size_t GetObjectCountForDomain(const GURL
& url
) const;
36 // Creates a new CookiesTreeModel for all objects in the container,
37 // copying each of them.
38 scoped_ptr
<CookiesTreeModel
> CreateCookiesTreeModel() const;
40 CannedBrowsingDataAppCacheHelper
* appcaches() const {
43 CannedBrowsingDataCookieHelper
* cookies() const {
46 CannedBrowsingDataDatabaseHelper
* databases() const {
49 CannedBrowsingDataFileSystemHelper
* file_systems() const {
52 CannedBrowsingDataIndexedDBHelper
* indexed_dbs() const {
55 CannedBrowsingDataLocalStorageHelper
* local_storages() const {
56 return local_storages_
;
58 CannedBrowsingDataServerBoundCertHelper
* server_bound_certs() const {
59 return server_bound_certs_
;
61 CannedBrowsingDataLocalStorageHelper
* session_storages() const {
62 return session_storages_
;
66 scoped_refptr
<CannedBrowsingDataAppCacheHelper
> appcaches_
;
67 scoped_refptr
<CannedBrowsingDataCookieHelper
> cookies_
;
68 scoped_refptr
<CannedBrowsingDataDatabaseHelper
> databases_
;
69 scoped_refptr
<CannedBrowsingDataFileSystemHelper
> file_systems_
;
70 scoped_refptr
<CannedBrowsingDataIndexedDBHelper
> indexed_dbs_
;
71 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> local_storages_
;
72 scoped_refptr
<CannedBrowsingDataServerBoundCertHelper
> server_bound_certs_
;
73 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> session_storages_
;
75 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer
);
78 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_