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