Chromium Code Reviews| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 | 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: | 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. | 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 | 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 | 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. | 384 // device the setting will be respected only until the policy is not set. |
| 385 base::FundamentalValue value(usage_statistics_reporting_); | 385 CrosSettings::Get()->SetBoolean(kStatsReportingPref, |
| 386 SignedSettingsTempStorage::Store( | 386 usage_statistics_reporting_); |
| 387 /* base::FundamentalValue value(usage_statistics_reporting_); | |
| 388 SignedSettingsCache::Store( | |
| 387 kStatsReportingPref, | 389 kStatsReportingPref, |
| 388 value, | 390 value, |
| 389 g_browser_process->local_state()); | 391 g_browser_process->local_state());*/ |
|
Mattias Nissler (ping if slow)
2011/11/30 12:25:50
commented out? why?
pastarmovj
2011/11/30 17:21:16
Fixed this whole bunch of code I kind of forgot to
| |
| 390 bool enabled = | 392 bool enabled = |
| 391 OptionsUtil::ResolveMetricsReportingEnabled(usage_statistics_reporting_); | 393 OptionsUtil::ResolveMetricsReportingEnabled(usage_statistics_reporting_); |
| 392 // Make sure the local state cached value is updated too because the real | 394 // Make sure the local state cached value is updated too because the real |
| 393 // policy will only get written when the owner is created and the cache won't | 395 // policy will only get written when the owner is created and the cache won't |
| 394 // be updated until the policy is reread. | 396 // be updated until the policy is reread. |
| 395 g_browser_process->local_state()->SetBoolean(kStatsReportingPref, enabled); | 397 g_browser_process->local_state()->SetBoolean(kStatsReportingPref, enabled); |
| 396 if (enabled) { | 398 if (enabled) { |
| 397 #if defined(USE_LINUX_BREAKPAD) | 399 #if defined(USE_LINUX_BREAKPAD) |
| 398 // The crash reporter initialization needs IO to complete. | 400 // The crash reporter initialization needs IO to complete. |
| 399 base::ThreadRestrictions::ScopedAllowIO allow_io; | 401 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 694 | 696 |
| 695 bool WizardController::usage_statistics_reporting() const { | 697 bool WizardController::usage_statistics_reporting() const { |
| 696 return usage_statistics_reporting_; | 698 return usage_statistics_reporting_; |
| 697 } | 699 } |
| 698 | 700 |
| 699 void WizardController::SetZeroDelays() { | 701 void WizardController::SetZeroDelays() { |
| 700 kShowDelayMs = 0; | 702 kShowDelayMs = 0; |
| 701 } | 703 } |
| 702 | 704 |
| 703 } // namespace chromeos | 705 } // namespace chromeos |
| OLD | NEW |