Chromium Code Reviews| Index: chrome/browser/chromeos/login/enterprise_enrollment_view.cc |
| diff --git a/chrome/browser/chromeos/login/enterprise_enrollment_view.cc b/chrome/browser/chromeos/login/enterprise_enrollment_view.cc |
| index 44c7de5a9810528baeca7234cbffbbf6c6fab88c..afa247e9a69675524db7dc647e5400fbe33fdbec 100644 |
| --- a/chrome/browser/chromeos/login/enterprise_enrollment_view.cc |
| +++ b/chrome/browser/chromeos/login/enterprise_enrollment_view.cc |
| @@ -6,6 +6,8 @@ |
| #include "base/json/json_writer.h" |
| #include "base/values.h" |
| +#include "chrome/browser/chromeos/cros/cros_library.h" |
| +#include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" |
| #include "chrome/browser/chromeos/login/helper.h" |
| #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
| @@ -111,6 +113,32 @@ void EnterpriseEnrollmentView::Init() { |
| } |
| void EnterpriseEnrollmentView::ShowConfirmationScreen() { |
| + if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { |
|
pastarmovj
2011/04/13 15:00:35
This code is here only as an example how to use th
|
| + chromeos::CryptohomeLibrary* cryptohome = chromeos::CrosLibrary::Get()->GetCryptohomeLibrary(); |
| + if (cryptohome->TpmIsEnabled() && !cryptohome->TpmIsBeingOwned()) { |
| + if (cryptohome->TpmIsOwned()) { |
| + cryptohome->TpmClearStoredPassword(); |
| + } else { |
| + cryptohome->TpmCanAttemptOwnership(); |
| + } |
| + } |
| + while(cryptohome->TpmIsBeingOwned()); |
| + LOG(ERROR) << "### FI : " << cryptohome->InstallAttributesIsFirstInstall(); |
| + LOG(ERROR) << "### count : " << cryptohome->InstallAttributesCount(); |
| + LOG(ERROR) << "### set : " << cryptohome->InstallAttributesSet("enterprise.owned", "true"); |
| + LOG(ERROR) << "### set : " << cryptohome->InstallAttributesSet("enterprise.user", user_); |
| + LOG(ERROR) << "### count : " << cryptohome->InstallAttributesCount(); |
| + std::string test; |
| + LOG(ERROR) << "### get : " << cryptohome->InstallAttributesGet("enterprise.user", &test); |
| + LOG(ERROR) << "### " << test; |
| + LOG(ERROR) << "### stat : " << cryptohome->InstallAttributesIsSecure(); |
| + LOG(ERROR) << "### lock : " << cryptohome->InstallAttributesFinalize(); |
| + LOG(ERROR) << "### stat : " << cryptohome->InstallAttributesIsSecure(); |
| + } else { |
| + LOG(ERROR) << "Cros library not loaded. " |
| + << "We must have disabled the link that led here."; |
| + } |
| + |
| RenderViewHost* render_view_host = |
| enrollment_page_view_->tab_contents()->render_view_host(); |
| render_view_host->ExecuteJavascriptInWebFrame( |
| @@ -147,6 +175,7 @@ void EnterpriseEnrollmentView::OnAuthSubmitted(const std::string& user, |
| const std::string& password, |
| const std::string& captcha, |
| const std::string& access_code) { |
| + user_ = user; |
| controller_->Authenticate(user, password, captcha, access_code); |
| } |