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 <signal.h> | 7 #include <signal.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
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/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.h" |
20 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 20 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| 21 #include "chrome/browser/chromeos/cros_settings.h" |
21 #include "chrome/browser/chromeos/cros_settings_names.h" | 22 #include "chrome/browser/chromeos/cros_settings_names.h" |
22 #include "chrome/browser/chromeos/customization_document.h" | 23 #include "chrome/browser/chromeos/customization_document.h" |
23 #include "chrome/browser/chromeos/language_preferences.h" | 24 #include "chrome/browser/chromeos/language_preferences.h" |
24 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen.
h" | 25 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen.
h" |
25 #include "chrome/browser/chromeos/login/eula_screen.h" | 26 #include "chrome/browser/chromeos/login/eula_screen.h" |
26 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 27 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
27 #include "chrome/browser/chromeos/login/helper.h" | 28 #include "chrome/browser/chromeos/login/helper.h" |
28 #include "chrome/browser/chromeos/login/html_page_screen.h" | 29 #include "chrome/browser/chromeos/login/html_page_screen.h" |
29 #include "chrome/browser/chromeos/login/login_display_host.h" | 30 #include "chrome/browser/chromeos/login/login_display_host.h" |
30 #include "chrome/browser/chromeos/login/login_utils.h" | 31 #include "chrome/browser/chromeos/login/login_utils.h" |
31 #include "chrome/browser/chromeos/login/network_screen.h" | 32 #include "chrome/browser/chromeos/login/network_screen.h" |
32 #include "chrome/browser/chromeos/login/oobe_display.h" | 33 #include "chrome/browser/chromeos/login/oobe_display.h" |
33 #include "chrome/browser/chromeos/login/registration_screen.h" | 34 #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" | 35 #include "chrome/browser/chromeos/login/update_screen.h" |
36 #include "chrome/browser/chromeos/login/user_image_screen.h" | 36 #include "chrome/browser/chromeos/login/user_image_screen.h" |
37 #include "chrome/browser/chromeos/login/user_manager.h" | 37 #include "chrome/browser/chromeos/login/user_manager.h" |
38 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 38 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
39 #include "chrome/browser/prefs/pref_service.h" | 39 #include "chrome/browser/prefs/pref_service.h" |
40 #include "chrome/browser/profiles/profile_manager.h" | 40 #include "chrome/browser/profiles/profile_manager.h" |
41 #include "chrome/browser/ui/options/options_util.h" | 41 #include "chrome/browser/ui/options/options_util.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "content/public/browser/notification_types.h" | 43 #include "content/public/browser/notification_types.h" |
44 #include "ui/base/accelerators/accelerator.h" | 44 #include "ui/base/accelerators/accelerator.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 // TODO(dpolukhin): show error message after login screen is displayed. | 369 // TODO(dpolukhin): show error message after login screen is displayed. |
370 ShowLoginScreen(); | 370 ShowLoginScreen(); |
371 } | 371 } |
372 | 372 |
373 void WizardController::OnUpdateCompleted() { | 373 void WizardController::OnUpdateCompleted() { |
374 OnOOBECompleted(); | 374 OnOOBECompleted(); |
375 } | 375 } |
376 | 376 |
377 void WizardController::OnEulaAccepted() { | 377 void WizardController::OnEulaAccepted() { |
378 MarkEulaAccepted(); | 378 MarkEulaAccepted(); |
379 // TODO(pastarmovj): Make this code cache the value for the pref in a better | |
380 // way until we can store it in the policy blob. See explanation below: | |
381 // At this point we can not write this in the signed settings pref blob. | |
382 // But we can at least create the consent file and Chrome would port that | |
383 // if the device is owned by a local user. In case of enterprise enrolled | |
384 // device the setting will be respected only until the policy is not set. | |
385 base::FundamentalValue value(usage_statistics_reporting_); | |
386 SignedSettingsTempStorage::Store( | |
387 kStatsReportingPref, | |
388 value, | |
389 g_browser_process->local_state()); | |
390 bool enabled = | 379 bool enabled = |
391 OptionsUtil::ResolveMetricsReportingEnabled(usage_statistics_reporting_); | 380 OptionsUtil::ResolveMetricsReportingEnabled(usage_statistics_reporting_); |
392 // Make sure the local state cached value is updated too because the real | 381 CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); |
393 // policy will only get written when the owner is created and the cache won't | |
394 // be updated until the policy is reread. | |
395 g_browser_process->local_state()->SetBoolean(kStatsReportingPref, enabled); | |
396 if (enabled) { | 382 if (enabled) { |
397 #if defined(USE_LINUX_BREAKPAD) | 383 #if defined(USE_LINUX_BREAKPAD) |
398 // The crash reporter initialization needs IO to complete. | 384 // The crash reporter initialization needs IO to complete. |
399 base::ThreadRestrictions::ScopedAllowIO allow_io; | 385 base::ThreadRestrictions::ScopedAllowIO allow_io; |
400 InitCrashReporter(); | 386 InitCrashReporter(); |
401 #endif | 387 #endif |
402 } | 388 } |
403 | 389 |
404 InitiateOOBEUpdate(); | 390 InitiateOOBEUpdate(); |
405 } | 391 } |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 680 |
695 bool WizardController::usage_statistics_reporting() const { | 681 bool WizardController::usage_statistics_reporting() const { |
696 return usage_statistics_reporting_; | 682 return usage_statistics_reporting_; |
697 } | 683 } |
698 | 684 |
699 void WizardController::SetZeroDelays() { | 685 void WizardController::SetZeroDelays() { |
700 kShowDelayMs = 0; | 686 kShowDelayMs = 0; |
701 } | 687 } |
702 | 688 |
703 } // namespace chromeos | 689 } // namespace chromeos |
OLD | NEW |