blob: b4add97a166dfbd8fe7a08d5777fc46f91447c31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright (c) 2011 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/ui/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"
#include "ui/base/text/bytes_formatting.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 =
ui::FormatBytes(info->size);
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);
}
|