diff options
Diffstat (limited to 'chrome/browser/ui/views/appcache_info_view.cc')
-rw-r--r-- | chrome/browser/ui/views/appcache_info_view.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome/browser/ui/views/appcache_info_view.cc b/chrome/browser/ui/views/appcache_info_view.cc new file mode 100644 index 0000000..03d3919 --- /dev/null +++ b/chrome/browser/ui/views/appcache_info_view.cc @@ -0,0 +1,40 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/views/appcache_info_view.h" + +#include "base/i18n/time_formatting.h" +#include "base/string_util.h" +#include "base/utf_string_conversions.h" +#include "grit/generated_resources.h" + +namespace { +const int kInfoLabelIds[] = { + IDS_COOKIES_APPLICATION_CACHE_MANIFEST_LABEL, + IDS_COOKIES_SIZE_LABEL, + IDS_COOKIES_COOKIE_CREATED_LABEL, + IDS_COOKIES_LAST_ACCESSED_LABEL +}; +} // namespace + +AppCacheInfoView::AppCacheInfoView() + : GenericInfoView(ARRAYSIZE(kInfoLabelIds), kInfoLabelIds) { +} + +void AppCacheInfoView::SetAppCacheInfo(const appcache::AppCacheInfo* info) { + DCHECK(info); + string16 manifest_url = + UTF8ToUTF16(info->manifest_url.spec()); + string16 size = + FormatBytes(info->size, GetByteDisplayUnits(info->size), true); + string16 creation_date = + base::TimeFormatFriendlyDateAndTime(info->creation_time); + string16 last_access_date = + base::TimeFormatFriendlyDateAndTime(info->last_access_time); + int row = 0; + SetValue(row++, manifest_url); + SetValue(row++, size); + SetValue(row++, creation_date); + SetValue(row++, last_access_date); +} |