| 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/views/appcache_info_view.h" | 5 #include "chrome/browser/ui/views/appcache_info_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| 11 #include "ui/base/text/bytes_formatting.h" |
| 11 | 12 |
| 12 namespace { | 13 namespace { |
| 13 const int kInfoLabelIds[] = { | 14 const int kInfoLabelIds[] = { |
| 14 IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL, | 15 IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL, |
| 15 IDS_COOKIES_SIZE_LABEL, | 16 IDS_COOKIES_SIZE_LABEL, |
| 16 IDS_COOKIES_COOKIE_CREATED_LABEL, | 17 IDS_COOKIES_COOKIE_CREATED_LABEL, |
| 17 IDS_COOKIES_LAST_ACCESSED_LABEL | 18 IDS_COOKIES_LAST_ACCESSED_LABEL |
| 18 }; | 19 }; |
| 19 } // namespace | 20 } // namespace |
| 20 | 21 |
| 21 AppCacheInfoView::AppCacheInfoView() | 22 AppCacheInfoView::AppCacheInfoView() |
| 22 : GenericInfoView(ARRAYSIZE(kInfoLabelIds), kInfoLabelIds) { | 23 : GenericInfoView(ARRAYSIZE(kInfoLabelIds), kInfoLabelIds) { |
| 23 } | 24 } |
| 24 | 25 |
| 25 void AppCacheInfoView::SetAppCacheInfo(const appcache::AppCacheInfo* info) { | 26 void AppCacheInfoView::SetAppCacheInfo(const appcache::AppCacheInfo* info) { |
| 26 DCHECK(info); | 27 DCHECK(info); |
| 27 string16 manifest_url = | 28 string16 manifest_url = |
| 28 UTF8ToUTF16(info->manifest_url.spec()); | 29 UTF8ToUTF16(info->manifest_url.spec()); |
| 29 string16 size = | 30 string16 size = |
| 30 FormatBytes(info->size, GetByteDisplayUnits(info->size), true); | 31 ui::FormatBytes(info->size, ui::DATA_UNITS_NATURAL, true); |
| 31 string16 creation_date = | 32 string16 creation_date = |
| 32 base::TimeFormatFriendlyDateAndTime(info->creation_time); | 33 base::TimeFormatFriendlyDateAndTime(info->creation_time); |
| 33 string16 last_access_date = | 34 string16 last_access_date = |
| 34 base::TimeFormatFriendlyDateAndTime(info->last_access_time); | 35 base::TimeFormatFriendlyDateAndTime(info->last_access_time); |
| 35 int row = 0; | 36 int row = 0; |
| 36 SetValue(row++, manifest_url); | 37 SetValue(row++, manifest_url); |
| 37 SetValue(row++, size); | 38 SetValue(row++, size); |
| 38 SetValue(row++, creation_date); | 39 SetValue(row++, creation_date); |
| 39 SetValue(row++, last_access_date); | 40 SetValue(row++, last_access_date); |
| 40 } | 41 } |
| OLD | NEW |