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 {
41 return appcaches_
.get();
43 CannedBrowsingDataCookieHelper
* cookies() const { return cookies_
.get(); }
44 CannedBrowsingDataDatabaseHelper
* databases() const {
45 return databases_
.get();
47 CannedBrowsingDataFileSystemHelper
* file_systems() const {
48 return file_systems_
.get();
50 CannedBrowsingDataIndexedDBHelper
* indexed_dbs() const {
51 return indexed_dbs_
.get();
53 CannedBrowsingDataLocalStorageHelper
* local_storages() const {
54 return local_storages_
.get();
56 CannedBrowsingDataServerBoundCertHelper
* server_bound_certs() const {
57 return server_bound_certs_
.get();
59 CannedBrowsingDataLocalStorageHelper
* session_storages() const {
60 return session_storages_
.get();
64 scoped_refptr
<CannedBrowsingDataAppCacheHelper
> appcaches_
;
65 scoped_refptr
<CannedBrowsingDataCookieHelper
> cookies_
;
66 scoped_refptr
<CannedBrowsingDataDatabaseHelper
> databases_
;
67 scoped_refptr
<CannedBrowsingDataFileSystemHelper
> file_systems_
;
68 scoped_refptr
<CannedBrowsingDataIndexedDBHelper
> indexed_dbs_
;
69 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> local_storages_
;
70 scoped_refptr
<CannedBrowsingDataServerBoundCertHelper
> server_bound_certs_
;
71 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> session_storages_
;
73 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer
);
76 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_