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/ui/webui/chromeos/login/eula_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 11 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
12 #include "chrome/browser/chromeos/login/helper.h" | 12 #include "chrome/browser/chromeos/login/helper.h" |
13 #include "chrome/browser/chromeos/login/oobe_screen.h" | 13 #include "chrome/browser/chromeos/login/oobe_screen.h" |
14 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 14 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" |
15 #include "chrome/browser/chromeos/login/screens/eula_screen.h" | 15 #include "chrome/browser/chromeos/login/screens/eula_screen.h" |
16 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h" | 16 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h" |
17 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 17 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
20 #include "chrome/grit/chromium_strings.h" | 20 #include "chrome/grit/chromium_strings.h" |
21 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
22 #include "chrome/grit/locale_settings.h" | 22 #include "chrome/grit/locale_settings.h" |
23 #include "components/login/localized_values_builder.h" | 23 #include "components/login/localized_values_builder.h" |
24 #include "components/strings/grit/components_strings.h" | 24 #include "components/strings/grit/components_strings.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 l10n_util::GetLocalizedContentsWidthInPixels( | 75 l10n_util::GetLocalizedContentsWidthInPixels( |
76 IDS_CREDITS_APP_DIALOG_HEIGHT_PIXELS)); | 76 IDS_CREDITS_APP_DIALOG_HEIGHT_PIXELS)); |
77 dialog->Show(); | 77 dialog->Show(); |
78 // The dialog object will be deleted on dialog close. | 78 // The dialog object will be deleted on dialog close. |
79 } | 79 } |
80 | 80 |
81 } // namespace | 81 } // namespace |
82 | 82 |
83 namespace chromeos { | 83 namespace chromeos { |
84 | 84 |
85 EulaScreenHandler::EulaScreenHandler(CoreOobeActor* core_oobe_actor) | 85 EulaScreenHandler::EulaScreenHandler(CoreOobeView* core_oobe_view) |
86 : core_oobe_actor_(core_oobe_actor) { | 86 : core_oobe_view_(core_oobe_view) { |
87 set_call_js_prefix(kJsScreenPath); | 87 set_call_js_prefix(kJsScreenPath); |
88 } | 88 } |
89 | 89 |
90 EulaScreenHandler::~EulaScreenHandler() { | 90 EulaScreenHandler::~EulaScreenHandler() { |
91 if (screen_) | 91 if (screen_) |
92 screen_->OnViewDestroyed(this); | 92 screen_->OnViewDestroyed(this); |
93 } | 93 } |
94 | 94 |
95 void EulaScreenHandler::Show() { | 95 void EulaScreenHandler::Show() { |
96 if (!page_is_ready()) { | 96 if (!page_is_ready()) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 dict->SetString("rlzEnabled", "enabled"); | 166 dict->SetString("rlzEnabled", "enabled"); |
167 #else | 167 #else |
168 dict->SetString("rlzEnabled", "disabled"); | 168 dict->SetString("rlzEnabled", "disabled"); |
169 #endif | 169 #endif |
170 } | 170 } |
171 | 171 |
172 void EulaScreenHandler::Initialize() { | 172 void EulaScreenHandler::Initialize() { |
173 if (!page_is_ready() || !screen_) | 173 if (!page_is_ready() || !screen_) |
174 return; | 174 return; |
175 | 175 |
176 core_oobe_actor_->SetUsageStats(screen_->IsUsageStatsEnabled()); | 176 core_oobe_view_->SetUsageStats(screen_->IsUsageStatsEnabled()); |
177 | 177 |
178 // This OEM EULA is a file:// URL which we're unable to load in iframe. | 178 // This OEM EULA is a file:// URL which we're unable to load in iframe. |
179 // Instead if it's defined we use chrome://terms/oem that will load same file. | 179 // Instead if it's defined we use chrome://terms/oem that will load same file. |
180 if (!screen_->GetOemEulaUrl().is_empty()) | 180 if (!screen_->GetOemEulaUrl().is_empty()) |
181 core_oobe_actor_->SetOemEulaUrl(chrome::kChromeUITermsOemURL); | 181 core_oobe_view_->SetOemEulaUrl(chrome::kChromeUITermsOemURL); |
182 | 182 |
183 if (show_on_init_) { | 183 if (show_on_init_) { |
184 Show(); | 184 Show(); |
185 show_on_init_ = false; | 185 show_on_init_ = false; |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { | 189 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { |
190 core_oobe_actor_->SetTpmPassword(tpm_password); | 190 core_oobe_view_->SetTpmPassword(tpm_password); |
191 } | 191 } |
192 | 192 |
193 void EulaScreenHandler::HandleOnLearnMore() { | 193 void EulaScreenHandler::HandleOnLearnMore() { |
194 if (!help_app_.get()) | 194 if (!help_app_.get()) |
195 help_app_ = new HelpAppLauncher(GetNativeWindow()); | 195 help_app_ = new HelpAppLauncher(GetNativeWindow()); |
196 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); | 196 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); |
197 } | 197 } |
198 | 198 |
199 void EulaScreenHandler::HandleOnChromeOSCredits() { | 199 void EulaScreenHandler::HandleOnChromeOSCredits() { |
200 ShowCreditsDialog( | 200 ShowCreditsDialog( |
(...skipping 12 matching lines...) Expand all Loading... |
213 IDS_ABOUT_VERSION_LICENSE_EULA, | 213 IDS_ABOUT_VERSION_LICENSE_EULA, |
214 GURL(chrome::kChromeUICreditsURL)); | 214 GURL(chrome::kChromeUICreditsURL)); |
215 } | 215 } |
216 | 216 |
217 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened() { | 217 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened() { |
218 if (screen_) | 218 if (screen_) |
219 screen_->InitiatePasswordFetch(); | 219 screen_->InitiatePasswordFetch(); |
220 } | 220 } |
221 | 221 |
222 } // namespace chromeos | 222 } // namespace chromeos |
OLD | NEW |