Commit 96fdf920 authored by mohammed@chromium.org's avatar mohammed@chromium.org

Modified the certificate details viewers to include the timezone in the...

Modified the certificate details viewers to include the timezone in the certificates validity dates.

Now when you check the certificate details and go to validity you will find the creation and expiration times reported in UTC timezone.

BUG=200243
R=jww@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273782 0039d316-1c4b-4281-b951-d872f2087c98
parent 333ad1de
......@@ -2732,6 +2732,9 @@ Even if you have downloaded files from this website before, the website might ha
<message name="IDS_CERT_DETAILS_NOT_AFTER" desc="The label of the Validity->Not After element in the details page of the certificate info dialog.">
Not After
</message>
<message name="IDS_CERT_DETAILS_UTC_TIMEZONE" desc="The string specifying the timezone in the Validity->Not Before and Validity->Not After elements in the details page of the certificate info dialog.">
(UTC)
</message>
<message name="IDS_CERT_DETAILS_SUBJECT" desc="The label of the Subject element in the details page of the certificate info dialog. (In this case, subject refers to the entity the certificate was issued to.)">
Subject
</message>
......
......@@ -347,10 +347,16 @@ void CertificateViewerDialogHandler::RequestCertificateFields(
l10n_util::GetStringUTF8(IDS_CERT_DETAILS_NOT_AFTER));
base::Time issued, expires;
if (x509_certificate_model::GetTimes(cert, &issued, &expires)) {
node_details->SetString("payload.val",
base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(issued)));
alt_node_details->SetString("payload.val",
base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(expires)));
// The object Time internally saves the time in UTC timezone. This is why we
// do a simple UTC string concatenation.
node_details->SetString(
"payload.val",
base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(issued)) + " " +
l10n_util::GetStringUTF8(IDS_CERT_DETAILS_UTC_TIMEZONE));
alt_node_details->SetString(
"payload.val",
base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(expires)) + " " +
l10n_util::GetStringUTF8(IDS_CERT_DETAILS_UTC_TIMEZONE));
}
cert_fields->Append(node_details = new base::DictionaryValue());
......
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