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/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" |
18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/chromeos/cros_settings_names.h" | |
20 #include "chrome/browser/chromeos/cros/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.h" |
21 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 20 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
22 #include "chrome/browser/chromeos/customization_document.h" | 21 #include "chrome/browser/chromeos/customization_document.h" |
23 #include "chrome/browser/chromeos/language_preferences.h" | 22 #include "chrome/browser/chromeos/language_preferences.h" |
24 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" | 23 #include "chrome/browser/chromeos/login/enterprise_enrollment_screen.h" |
25 #include "chrome/browser/chromeos/login/eula_screen.h" | 24 #include "chrome/browser/chromeos/login/eula_screen.h" |
26 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 25 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
27 #include "chrome/browser/chromeos/login/helper.h" | 26 #include "chrome/browser/chromeos/login/helper.h" |
28 #include "chrome/browser/chromeos/login/html_page_screen.h" | 27 #include "chrome/browser/chromeos/login/html_page_screen.h" |
29 #include "chrome/browser/chromeos/login/login_display_host.h" | 28 #include "chrome/browser/chromeos/login/login_display_host.h" |
30 #include "chrome/browser/chromeos/login/login_utils.h" | 29 #include "chrome/browser/chromeos/login/login_utils.h" |
31 #include "chrome/browser/chromeos/login/network_screen.h" | 30 #include "chrome/browser/chromeos/login/network_screen.h" |
32 #include "chrome/browser/chromeos/login/oobe_display.h" | 31 #include "chrome/browser/chromeos/login/oobe_display.h" |
33 #include "chrome/browser/chromeos/login/registration_screen.h" | 32 #include "chrome/browser/chromeos/login/registration_screen.h" |
34 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" | |
35 #include "chrome/browser/chromeos/login/update_screen.h" | 33 #include "chrome/browser/chromeos/login/update_screen.h" |
36 #include "chrome/browser/chromeos/login/user_image_screen.h" | 34 #include "chrome/browser/chromeos/login/user_image_screen.h" |
37 #include "chrome/browser/chromeos/login/user_manager.h" | 35 #include "chrome/browser/chromeos/login/user_manager.h" |
38 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 36 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
| 37 #include "chrome/browser/chromeos/metrics_cros_settings_provider.h" |
39 #include "chrome/browser/prefs/pref_service.h" | 38 #include "chrome/browser/prefs/pref_service.h" |
40 #include "chrome/browser/profiles/profile_manager.h" | 39 #include "chrome/browser/profiles/profile_manager.h" |
41 #include "chrome/browser/ui/options/options_util.h" | |
42 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
43 #include "content/common/content_notification_types.h" | 41 #include "content/common/content_notification_types.h" |
44 #include "content/common/notification_service.h" | 42 #include "content/common/notification_service.h" |
45 #include "ui/base/l10n/l10n_util.h" | 43 #include "ui/base/l10n/l10n_util.h" |
46 #include "views/accelerator.h" | 44 #include "views/accelerator.h" |
47 | 45 |
48 #if defined(USE_LINUX_BREAKPAD) | |
49 #include "chrome/app/breakpad_linux.h" | |
50 #endif | |
51 | |
52 namespace { | 46 namespace { |
53 | 47 |
54 // A boolean pref of the EULA accepted flag. | 48 // A boolean pref of the EULA accepted flag. |
55 const char kEulaAccepted[] = "EulaAccepted"; | 49 const char kEulaAccepted[] = "EulaAccepted"; |
56 | 50 |
57 // A string pref with initial locale set in VPD or manifest. | 51 // A string pref with initial locale set in VPD or manifest. |
58 const char kInitialLocale[] = "intl.initial_locale"; | 52 const char kInitialLocale[] = "intl.initial_locale"; |
59 | 53 |
60 // A boolean pref of the OOBE complete flag (first OOBE part before login). | 54 // A boolean pref of the OOBE complete flag (first OOBE part before login). |
61 const char kOobeComplete[] = "OobeComplete"; | 55 const char kOobeComplete[] = "OobeComplete"; |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 // TODO(dpolukhin): show error message after login screen is displayed. | 371 // TODO(dpolukhin): show error message after login screen is displayed. |
378 ShowLoginScreen(); | 372 ShowLoginScreen(); |
379 } | 373 } |
380 | 374 |
381 void WizardController::OnUpdateCompleted() { | 375 void WizardController::OnUpdateCompleted() { |
382 OnOOBECompleted(); | 376 OnOOBECompleted(); |
383 } | 377 } |
384 | 378 |
385 void WizardController::OnEulaAccepted() { | 379 void WizardController::OnEulaAccepted() { |
386 MarkEulaAccepted(); | 380 MarkEulaAccepted(); |
387 // TODO(pastarmovj): Make this code cache the value for the pref in a better | 381 chromeos::MetricsCrosSettingsProvider::SetMetricsStatus( |
388 // way until we can store it in the policy blob. See explanation below: | 382 usage_statistics_reporting_); |
389 // At this point we can not write this in the signed settings pref blob. | |
390 // But we can at least create the consent file and Chrome would port that | |
391 // if the device is owned by a local user. In case of enterprise enrolled | |
392 // device the setting will be respected only until the policy is not set. | |
393 SignedSettingsTempStorage::Store( | |
394 kStatsReportingPref, | |
395 (usage_statistics_reporting_ ? "true" : "false"), | |
396 g_browser_process->local_state()); | |
397 bool enabled = | |
398 OptionsUtil::ResolveMetricsReportingEnabled(usage_statistics_reporting_); | |
399 if (enabled) { | |
400 #if defined(USE_LINUX_BREAKPAD) | |
401 InitCrashReporter(); | |
402 #endif | |
403 } | |
404 | |
405 InitiateOOBEUpdate(); | 383 InitiateOOBEUpdate(); |
406 } | 384 } |
407 | 385 |
408 void WizardController::OnUpdateErrorCheckingForUpdate() { | 386 void WizardController::OnUpdateErrorCheckingForUpdate() { |
409 // TODO(nkostylev): Update should be required during OOBE. | 387 // TODO(nkostylev): Update should be required during OOBE. |
410 // We do not want to block users from being able to proceed to the login | 388 // We do not want to block users from being able to proceed to the login |
411 // screen if there is any error checking for an update. | 389 // screen if there is any error checking for an update. |
412 // They could use "browse without sign-in" feature to set up the network to be | 390 // They could use "browse without sign-in" feature to set up the network to be |
413 // able to perform the update later. | 391 // able to perform the update later. |
414 OnOOBECompleted(); | 392 OnOOBECompleted(); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 | 679 |
702 bool WizardController::usage_statistics_reporting() const { | 680 bool WizardController::usage_statistics_reporting() const { |
703 return usage_statistics_reporting_; | 681 return usage_statistics_reporting_; |
704 } | 682 } |
705 | 683 |
706 void WizardController::SetZeroDelays() { | 684 void WizardController::SetZeroDelays() { |
707 kShowDelayMs = 0; | 685 kShowDelayMs = 0; |
708 } | 686 } |
709 | 687 |
710 } // namespace chromeos | 688 } // namespace chromeos |
OLD | NEW |