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/chromeos/login/screens/eula_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/eula_screen.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/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/chromeos/customization/customization_document.h" | 11 #include "chrome/browser/chromeos/customization/customization_document.h" |
12 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 12 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
13 #include "chrome/browser/chromeos/login/screens/eula_view.h" | 13 #include "chrome/browser/chromeos/login/screens/eula_view.h" |
14 #include "chrome/browser/chromeos/login/wizard_controller.h" | 14 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 15 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
15 #include "chromeos/dbus/cryptohome_client.h" | 16 #include "chromeos/dbus/cryptohome_client.h" |
16 #include "chromeos/dbus/dbus_method_call_status.h" | 17 #include "chromeos/dbus/dbus_method_call_status.h" |
17 #include "chromeos/dbus/dbus_thread_manager.h" | 18 #include "chromeos/dbus/dbus_thread_manager.h" |
18 | 19 |
19 namespace chromeos { | 20 namespace chromeos { |
20 namespace { | 21 namespace { |
21 | 22 |
22 constexpr const char kUserActionAcceptButtonClicked[] = "accept-button"; | 23 constexpr const char kUserActionAcceptButtonClicked[] = "accept-button"; |
23 constexpr const char kUserActionBackButtonClicked[] = "back-button"; | 24 constexpr const char kUserActionBackButtonClicked[] = "back-button"; |
24 constexpr const char kContextKeyUsageStatsEnabled[] = "usageStatsEnabled"; | 25 constexpr const char kContextKeyUsageStatsEnabled[] = "usageStatsEnabled"; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 77 |
77 void EulaScreen::OnViewDestroyed(EulaView* view) { | 78 void EulaScreen::OnViewDestroyed(EulaView* view) { |
78 if (view_ == view) | 79 if (view_ == view) |
79 view_ = NULL; | 80 view_ = NULL; |
80 } | 81 } |
81 | 82 |
82 void EulaScreen::Show() { | 83 void EulaScreen::Show() { |
83 // Command to own the TPM. | 84 // Command to own the TPM. |
84 DBusThreadManager::Get()->GetCryptohomeClient()->TpmCanAttemptOwnership( | 85 DBusThreadManager::Get()->GetCryptohomeClient()->TpmCanAttemptOwnership( |
85 EmptyVoidDBusMethodCallback()); | 86 EmptyVoidDBusMethodCallback()); |
86 if (WizardController::UsingHandsOffEnrollment()) | 87 if (policy::DeviceCloudPolicyManagerChromeOS::GetZeroTouchEnrollmentMode() == |
| 88 policy::ZeroTouchEnrollmentMode::HANDS_OFF) |
87 OnUserAction(kUserActionAcceptButtonClicked); | 89 OnUserAction(kUserActionAcceptButtonClicked); |
88 else if (view_) | 90 else if (view_) |
89 view_->Show(); | 91 view_->Show(); |
90 } | 92 } |
91 | 93 |
92 void EulaScreen::Hide() { | 94 void EulaScreen::Hide() { |
93 if (view_) | 95 if (view_) |
94 view_->Hide(); | 96 view_->Hide(); |
95 } | 97 } |
96 | 98 |
(...skipping 14 matching lines...) Expand all Loading... |
111 } | 113 } |
112 } | 114 } |
113 | 115 |
114 void EulaScreen::OnPasswordFetched(const std::string& tpm_password) { | 116 void EulaScreen::OnPasswordFetched(const std::string& tpm_password) { |
115 tpm_password_ = tpm_password; | 117 tpm_password_ = tpm_password; |
116 if (view_) | 118 if (view_) |
117 view_->OnPasswordFetched(tpm_password_); | 119 view_->OnPasswordFetched(tpm_password_); |
118 } | 120 } |
119 | 121 |
120 } // namespace chromeos | 122 } // namespace chromeos |
OLD | NEW |