Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui/certificate_viewer_webui.h" | 5 #include "chrome/browser/ui/webui/certificate_viewer_webui.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 | 340 |
| 341 node_details->Set("children", cert_sub_fields = new base::ListValue()); | 341 node_details->Set("children", cert_sub_fields = new base::ListValue()); |
| 342 cert_sub_fields->Append(node_details = new base::DictionaryValue()); | 342 cert_sub_fields->Append(node_details = new base::DictionaryValue()); |
| 343 node_details->SetString("label", | 343 node_details->SetString("label", |
| 344 l10n_util::GetStringUTF8(IDS_CERT_DETAILS_NOT_BEFORE)); | 344 l10n_util::GetStringUTF8(IDS_CERT_DETAILS_NOT_BEFORE)); |
| 345 cert_sub_fields->Append(alt_node_details = new base::DictionaryValue()); | 345 cert_sub_fields->Append(alt_node_details = new base::DictionaryValue()); |
| 346 alt_node_details->SetString("label", | 346 alt_node_details->SetString("label", |
| 347 l10n_util::GetStringUTF8(IDS_CERT_DETAILS_NOT_AFTER)); | 347 l10n_util::GetStringUTF8(IDS_CERT_DETAILS_NOT_AFTER)); |
| 348 base::Time issued, expires; | 348 base::Time issued, expires; |
| 349 if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { | 349 if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { |
| 350 //The object Time internally save the time in UTC timezone. | |
|
jww
2014/05/27 17:25:34
Please add a space before the comment per Chromium
| |
| 350 node_details->SetString("payload.val", | 351 node_details->SetString("payload.val", |
| 351 base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(issued))); | 352 base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(issued)) + " (UTC)"); |
|
jww
2014/05/27 17:25:34
This should probably be internationalized.
| |
| 352 alt_node_details->SetString("payload.val", | 353 alt_node_details->SetString("payload.val", |
| 353 base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(expires))); | 354 base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(expires)) + " (UTC)") ; |
|
jww
2014/05/27 17:25:34
See above comment on 352.
| |
| 354 } | 355 } |
| 355 | 356 |
| 356 cert_fields->Append(node_details = new base::DictionaryValue()); | 357 cert_fields->Append(node_details = new base::DictionaryValue()); |
| 357 node_details->SetString("label", | 358 node_details->SetString("label", |
| 358 l10n_util::GetStringUTF8(IDS_CERT_DETAILS_SUBJECT)); | 359 l10n_util::GetStringUTF8(IDS_CERT_DETAILS_SUBJECT)); |
| 359 node_details->SetString("payload.val", | 360 node_details->SetString("payload.val", |
| 360 x509_certificate_model::GetSubjectName(cert)); | 361 x509_certificate_model::GetSubjectName(cert)); |
| 361 | 362 |
| 362 // Subject key information. | 363 // Subject key information. |
| 363 cert_fields->Append(node_details = new base::DictionaryValue()); | 364 cert_fields->Append(node_details = new base::DictionaryValue()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 const base::ListValue* args) const { | 435 const base::ListValue* args) const { |
| 435 int cert_index; | 436 int cert_index; |
| 436 double val; | 437 double val; |
| 437 if (!(args->GetDouble(0, &val))) | 438 if (!(args->GetDouble(0, &val))) |
| 438 return -1; | 439 return -1; |
| 439 cert_index = static_cast<int>(val); | 440 cert_index = static_cast<int>(val); |
| 440 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) | 441 if (cert_index < 0 || cert_index >= static_cast<int>(cert_chain_.size())) |
| 441 return -1; | 442 return -1; |
| 442 return cert_index; | 443 return cert_index; |
| 443 } | 444 } |
| OLD | NEW |