1 // Copyright (c) 2011 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_UI_WEBUI_QUOTA_INTERNALS_QUOTA_INTERNALS_TYPES_H_
6 #define CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_QUOTA_INTERNALS_TYPES_H_
11 #include "base/time/time.h"
13 #include "webkit/common/quota/quota_types.h"
19 namespace quota_internals {
21 // Represends global usage and quota information for specific type of storage.
22 class GlobalStorageInfo {
24 explicit GlobalStorageInfo(quota::StorageType type);
27 void set_usage(int64 usage) {
31 void set_unlimited_usage(int64 unlimited_usage) {
32 unlimited_usage_ = unlimited_usage;
35 void set_quota(int64 quota) {
39 // Create new Value for passing to WebUI page. Caller is responsible for
40 // deleting the returned pointer.
41 base::Value* NewValue() const;
43 quota::StorageType type_;
46 int64 unlimited_usage_;
50 // Represents per host usage and quota information for the storage.
51 class PerHostStorageInfo {
53 PerHostStorageInfo(const std::string& host, quota::StorageType type);
54 ~PerHostStorageInfo();
56 void set_usage(int64 usage) {
60 void set_quota(int64 quota) {
64 // Create new Value for passing to WebUI page. Caller is responsible for
65 // deleting the returned pointer.
66 base::Value* NewValue() const;
69 quota::StorageType type_;
75 // Represendts per origin usage and access time information.
76 class PerOriginStorageInfo {
78 PerOriginStorageInfo(const GURL& origin, quota::StorageType type);
79 ~PerOriginStorageInfo();
81 void set_in_use(bool in_use) {
82 in_use_ = in_use ? 1 : 0;
85 void set_used_count(int used_count) {
86 used_count_ = used_count;
89 void set_last_access_time(base::Time last_access_time) {
90 last_access_time_ = last_access_time;
93 void set_last_modified_time(base::Time last_modified_time) {
94 last_modified_time_ = last_modified_time;
97 // Create new Value for passing to WebUI page. Caller is responsible for
98 // deleting the returned pointer.
99 base::Value* NewValue() const;
102 quota::StorageType type_;
107 base::Time last_access_time_;
108 base::Time last_modified_time_;
112 #endif // CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_QUOTA_INTERNALS_TYPES_H_