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"
10 #include "components/content_settings/core/browser/local_shared_objects_counter.h"
12 class CannedBrowsingDataAppCacheHelper
;
13 class CannedBrowsingDataChannelIDHelper
;
14 class CannedBrowsingDataCookieHelper
;
15 class CannedBrowsingDataDatabaseHelper
;
16 class CannedBrowsingDataFileSystemHelper
;
17 class CannedBrowsingDataIndexedDBHelper
;
18 class CannedBrowsingDataLocalStorageHelper
;
19 class CannedBrowsingDataServiceWorkerHelper
;
20 class CookiesTreeModel
;
23 class LocalSharedObjectsContainer
: public LocalSharedObjectsCounter
{
25 explicit LocalSharedObjectsContainer(Profile
* profile
);
26 ~LocalSharedObjectsContainer() override
;
28 // LocalSharedObjectsCounter:
29 size_t GetObjectCount() const override
;
30 size_t GetObjectCountForDomain(const GURL
& url
) const override
;
32 // Empties the container.
35 // Creates a new CookiesTreeModel for all objects in the container,
36 // copying each of them.
37 scoped_ptr
<CookiesTreeModel
> CreateCookiesTreeModel() const;
39 CannedBrowsingDataAppCacheHelper
* appcaches() const {
40 return appcaches_
.get();
42 CannedBrowsingDataChannelIDHelper
* channel_ids() const {
43 return channel_ids_
.get();
45 CannedBrowsingDataCookieHelper
* cookies() const { return cookies_
.get(); }
46 CannedBrowsingDataDatabaseHelper
* databases() const {
47 return databases_
.get();
49 CannedBrowsingDataFileSystemHelper
* file_systems() const {
50 return file_systems_
.get();
52 CannedBrowsingDataIndexedDBHelper
* indexed_dbs() const {
53 return indexed_dbs_
.get();
55 CannedBrowsingDataLocalStorageHelper
* local_storages() const {
56 return local_storages_
.get();
58 CannedBrowsingDataServiceWorkerHelper
* service_workers() const {
59 return service_workers_
.get();
61 CannedBrowsingDataLocalStorageHelper
* session_storages() const {
62 return session_storages_
.get();
66 scoped_refptr
<CannedBrowsingDataAppCacheHelper
> appcaches_
;
67 scoped_refptr
<CannedBrowsingDataChannelIDHelper
> channel_ids_
;
68 scoped_refptr
<CannedBrowsingDataCookieHelper
> cookies_
;
69 scoped_refptr
<CannedBrowsingDataDatabaseHelper
> databases_
;
70 scoped_refptr
<CannedBrowsingDataFileSystemHelper
> file_systems_
;
71 scoped_refptr
<CannedBrowsingDataIndexedDBHelper
> indexed_dbs_
;
72 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> local_storages_
;
73 scoped_refptr
<CannedBrowsingDataServiceWorkerHelper
> service_workers_
;
74 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> session_storages_
;
76 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer
);
79 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_