| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/login/eula_screen.h" | 5 #include "chrome/browser/chromeos/login/eula_screen.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 9 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 9 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| 10 #include "chrome/browser/chromeos/customization_document.h" | 10 #include "chrome/browser/chromeos/customization_document.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 if (actor_) | 21 if (actor_) |
| 22 actor_->SetDelegate(NULL); | 22 actor_->SetDelegate(NULL); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void EulaScreen::PrepareToShow() { | 25 void EulaScreen::PrepareToShow() { |
| 26 actor_->PrepareToShow(); | 26 actor_->PrepareToShow(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void EulaScreen::Show() { | 29 void EulaScreen::Show() { |
| 30 // Command to own the TPM. | 30 // Command to own the TPM. |
| 31 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) { | 31 chromeos::CrosLibrary::Get()-> |
| 32 chromeos::CrosLibrary::Get()-> | 32 GetCryptohomeLibrary()->TpmCanAttemptOwnership(); |
| 33 GetCryptohomeLibrary()->TpmCanAttemptOwnership(); | |
| 34 } else { | |
| 35 LOG(ERROR) << "Cros library not loaded. " | |
| 36 << "We must have disabled the link that led here."; | |
| 37 } | |
| 38 actor_->Show(); | 33 actor_->Show(); |
| 39 } | 34 } |
| 40 | 35 |
| 41 void EulaScreen::Hide() { | 36 void EulaScreen::Hide() { |
| 42 actor_->Hide(); | 37 actor_->Hide(); |
| 43 } | 38 } |
| 44 | 39 |
| 45 bool EulaScreen::IsTpmEnabled() const { | 40 bool EulaScreen::IsTpmEnabled() const { |
| 46 return chromeos::CrosLibrary::Get()->EnsureLoaded() && | 41 return chromeos::CrosLibrary::Get()->GetCryptohomeLibrary()->TpmIsEnabled(); |
| 47 chromeos::CrosLibrary::Get()->GetCryptohomeLibrary()->TpmIsEnabled(); | |
| 48 } | 42 } |
| 49 | 43 |
| 50 GURL EulaScreen::GetOemEulaUrl() const { | 44 GURL EulaScreen::GetOemEulaUrl() const { |
| 51 const StartupCustomizationDocument* customization = | 45 const StartupCustomizationDocument* customization = |
| 52 StartupCustomizationDocument::GetInstance(); | 46 StartupCustomizationDocument::GetInstance(); |
| 53 if (customization->IsReady()) { | 47 if (customization->IsReady()) { |
| 54 std::string locale = customization->initial_locale(); | 48 std::string locale = customization->initial_locale(); |
| 55 std::string eula_page = customization->GetEULAPage(locale); | 49 std::string eula_page = customization->GetEULAPage(locale); |
| 56 if (!eula_page.empty()) | 50 if (!eula_page.empty()) |
| 57 return GURL(eula_page); | 51 return GURL(eula_page); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 88 bool EulaScreen::IsUsageStatsEnabled() const { | 82 bool EulaScreen::IsUsageStatsEnabled() const { |
| 89 return get_screen_observer()->usage_statistics_reporting(); | 83 return get_screen_observer()->usage_statistics_reporting(); |
| 90 } | 84 } |
| 91 | 85 |
| 92 void EulaScreen::OnActorDestroyed(EulaScreenActor* actor) { | 86 void EulaScreen::OnActorDestroyed(EulaScreenActor* actor) { |
| 93 if (actor_ == actor) | 87 if (actor_ == actor) |
| 94 actor_ = NULL; | 88 actor_ = NULL; |
| 95 } | 89 } |
| 96 | 90 |
| 97 } // namespace chromeos | 91 } // namespace chromeos |
| OLD | NEW |