OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/ui/webui/quota_internals/quota_internals_types.h" | 5 #include "chrome/browser/ui/webui/quota_internals/quota_internals_types.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 std::string StorageTypeToString(storage::StorageType type) { | 14 std::string StorageTypeToString(storage::StorageType type) { |
15 switch (type) { | 15 switch (type) { |
16 case storage::kStorageTypeTemporary: | 16 case storage::kStorageTypeTemporary: |
17 return "temporary"; | 17 return "temporary"; |
18 case storage::kStorageTypePersistent: | 18 case storage::kStorageTypePersistent: |
19 return "persistent"; | 19 return "persistent"; |
20 case storage::kStorageTypeSyncable: | 20 case storage::kStorageTypeSyncable: |
21 return "syncable"; | 21 return "syncable"; |
22 case storage::kStorageTypeQuotaNotManaged: | 22 case storage::kStorageTypeQuotaNotManaged: |
23 return "quota not managed"; | 23 return "quota not managed"; |
24 case storage::kStorageTypeUnknown: | 24 case storage::kStorageTypeUnknown: |
25 return "unknown"; | 25 return "unknown"; |
| 26 case storage::kStorageTypeDurable: |
| 27 NOTREACHED(); |
| 28 return "durable"; |
26 } | 29 } |
27 return "unknown"; | 30 return "unknown"; |
28 } | 31 } |
29 | 32 |
30 } // anonymous namespace | 33 } // anonymous namespace |
31 | 34 |
32 namespace quota_internals { | 35 namespace quota_internals { |
33 | 36 |
34 GlobalStorageInfo::GlobalStorageInfo(storage::StorageType type) | 37 GlobalStorageInfo::GlobalStorageInfo(storage::StorageType type) |
35 : type_(type), usage_(-1), unlimited_usage_(-1), quota_(-1) { | 38 : type_(type), usage_(-1), unlimited_usage_(-1), quota_(-1) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 if (!last_access_time_.is_null()) | 98 if (!last_access_time_.is_null()) |
96 dict->SetDouble("lastAccessTime", last_access_time_.ToDoubleT() * 1000.0); | 99 dict->SetDouble("lastAccessTime", last_access_time_.ToDoubleT() * 1000.0); |
97 if (!last_modified_time_.is_null()) { | 100 if (!last_modified_time_.is_null()) { |
98 dict->SetDouble("lastModifiedTime", | 101 dict->SetDouble("lastModifiedTime", |
99 last_modified_time_.ToDoubleT() * 1000.0); | 102 last_modified_time_.ToDoubleT() * 1000.0); |
100 } | 103 } |
101 return dict; | 104 return dict; |
102 } | 105 } |
103 | 106 |
104 } // namespace quota_internals | 107 } // namespace quota_internals |
OLD | NEW |