Commit fec53852 authored by dhnishi@chromium.org's avatar dhnishi@chromium.org

Surface the audited last usage time in a user readable string on the

Website Settings options page.

Image: http://imgur.com/LzbuTsJ

BUG=372607

Review URL: https://codereview.chromium.org/445623003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287979 0039d316-1c4b-4281-b951-d872f2087c98
parent 6fad8a5e
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
/* Styles for the origin list elements in the website settings page. */ /* Styles for the origin list elements in the website settings page. */
#origin-list { #origin-list {
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
font-family: Noto Sans;
font-size: 13px;
margin: 5px 0 0; margin: 5px 0 0;
min-height: 287px; min-height: 287px;
} }
...@@ -45,9 +47,12 @@ ...@@ -45,9 +47,12 @@
height: 30px; height: 30px;
} }
.local-storage-usage {
color: #7f7f7f;
margin: auto 0;
}
list.origin-list .favicon-cell { list.origin-list .favicon-cell {
-webkit-margin-start: 6px; -webkit-margin-start: 6px;
-webkit-padding-start: 21px; -webkit-padding-start: 21px;
font-family: Noto Sans;
font-size: 13px;
} }
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#include "ui/base/l10n/time_format.h"
#include "ui/base/text/bytes_formatting.h" #include "ui/base/text/bytes_formatting.h"
namespace { namespace {
...@@ -159,6 +160,11 @@ void WebsiteSettingsHandler::UpdateOrigins() { ...@@ -159,6 +160,11 @@ void WebsiteSettingsHandler::UpdateOrigins() {
base::DictionaryValue* origin_entry = new base::DictionaryValue(); base::DictionaryValue* origin_entry = new base::DictionaryValue();
origin_entry->SetDoubleWithoutPathExpansion("usage", origin_entry->SetDoubleWithoutPathExpansion("usage",
last_usage.ToDoubleT()); last_usage.ToDoubleT());
origin_entry->SetStringWithoutPathExpansion(
"usageString",
ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_ELAPSED,
ui::TimeFormat::LENGTH_SHORT,
base::Time::Now() - last_usage));
origins.SetWithoutPathExpansion(origin, origin_entry); origins.SetWithoutPathExpansion(origin, origin_entry);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment