Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: chrome/browser/ui/webui/about_ui.cc

Issue 9652017: [chromeos] Fix chrome://cryptohome crash (Closed) Base URL: http://git.chromium.org/git/chromium/src@master
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/about_ui.h" 5 #include "chrome/browser/ui/webui/about_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 output.append("<h3>CryptohomeLibrary:</h3>"); 528 output.append("<h3>CryptohomeLibrary:</h3>");
529 output.append("<table>"); 529 output.append("<table>");
530 output.append(AddBoolRow("IsMounted", cryptohome->IsMounted())); 530 output.append(AddBoolRow("IsMounted", cryptohome->IsMounted()));
531 output.append(AddBoolRow("TpmIsReady", cryptohome->TpmIsReady())); 531 output.append(AddBoolRow("TpmIsReady", cryptohome->TpmIsReady()));
532 output.append(AddBoolRow("TpmIsEnabled", cryptohome->TpmIsEnabled())); 532 output.append(AddBoolRow("TpmIsEnabled", cryptohome->TpmIsEnabled()));
533 output.append(AddBoolRow("TpmIsOwned", cryptohome->TpmIsOwned())); 533 output.append(AddBoolRow("TpmIsOwned", cryptohome->TpmIsOwned()));
534 output.append(AddBoolRow("TpmIsBeingOwned", cryptohome->TpmIsBeingOwned())); 534 output.append(AddBoolRow("TpmIsBeingOwned", cryptohome->TpmIsBeingOwned()));
535 output.append(AddBoolRow("Pkcs11IsTpmTokenReady", is_tpm_token_ready)); 535 output.append(AddBoolRow("Pkcs11IsTpmTokenReady", is_tpm_token_ready));
536 output.append("</table>"); 536 output.append("</table>");
537 537
538 std::string token_name, user_pin;
539 crypto::GetTPMTokenInfo(&token_name, &user_pin);
540 output.append("<h3>crypto:</h3>"); 538 output.append("<h3>crypto:</h3>");
541 output.append("<table>"); 539 output.append("<table>");
542 output.append(AddBoolRow("IsTPMTokenReady", crypto::IsTPMTokenReady())); 540 output.append(AddBoolRow("IsTPMTokenReady", crypto::IsTPMTokenReady()));
541 std::string token_name, user_pin;
542 if (crypto::IsTPMTokenReady())
543 crypto::GetTPMTokenInfo(&token_name, &user_pin);
543 output.append(AddStringRow("token_name", token_name)); 544 output.append(AddStringRow("token_name", token_name));
544 output.append(AddStringRow("user_pin", std::string(user_pin.length(), '*'))); 545 output.append(AddStringRow("user_pin", std::string(user_pin.length(), '*')));
545 output.append("</table>"); 546 output.append("</table>");
546 AppendFooter(&output); 547 AppendFooter(&output);
547 548
548 source->FinishDataRequest(output, request_id); 549 source->FinishDataRequest(output, request_id);
549 } 550 }
550 551
551 void FinishCryptohomeDataRequest(scoped_refptr<AboutUIHTMLSource> source, 552 void FinishCryptohomeDataRequest(scoped_refptr<AboutUIHTMLSource> source,
552 const std::string& query, 553 const std::string& query,
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 } 1402 }
1402 1403
1403 AboutUI::AboutUI(content::WebUI* web_ui, const std::string& name) 1404 AboutUI::AboutUI(content::WebUI* web_ui, const std::string& name)
1404 : WebUIController(web_ui) { 1405 : WebUIController(web_ui) {
1405 Profile* profile = Profile::FromWebUI(web_ui); 1406 Profile* profile = Profile::FromWebUI(web_ui);
1406 ChromeURLDataManager::DataSource* source = 1407 ChromeURLDataManager::DataSource* source =
1407 new AboutUIHTMLSource(name, profile); 1408 new AboutUIHTMLSource(name, profile);
1408 if (source) 1409 if (source)
1409 profile->GetChromeURLDataManager()->AddDataSource(source); 1410 profile->GetChromeURLDataManager()->AddDataSource(source);
1410 } 1411 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698