| 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/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.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/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/callback_helpers.h" | 15 #include "base/callback_helpers.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/prefs/pref_registry_simple.h" | 18 #include "base/prefs/pref_registry_simple.h" |
| 19 #include "base/prefs/pref_service.h" | 19 #include "base/prefs/pref_service.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/threading/thread_restrictions.h" | |
| 22 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/browser_process_platform_part.h" | 22 #include "chrome/browser/browser_process_platform_part.h" |
| 24 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
| 25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 24 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 26 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 25 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 27 #include "chrome/browser/chromeos/customization/customization_document.h" | 26 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 28 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.
h" | 27 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.
h" |
| 29 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" | 28 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" |
| 30 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 29 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 31 #include "chrome/browser/chromeos/login/helper.h" | 30 #include "chrome/browser/chromeos/login/helper.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 histogram->AddTime(step_time); | 130 histogram->AddTime(step_time); |
| 132 } | 131 } |
| 133 | 132 |
| 134 bool IsRemoraRequisition() { | 133 bool IsRemoraRequisition() { |
| 135 return g_browser_process->platform_part() | 134 return g_browser_process->platform_part() |
| 136 ->browser_policy_connector_chromeos() | 135 ->browser_policy_connector_chromeos() |
| 137 ->GetDeviceCloudPolicyManager() | 136 ->GetDeviceCloudPolicyManager() |
| 138 ->IsRemoraRequisition(); | 137 ->IsRemoraRequisition(); |
| 139 } | 138 } |
| 140 | 139 |
| 140 #if defined(GOOGLE_CHROME_BUILD) |
| 141 void InitializeCrashReporter() { |
| 142 // The crash reporter initialization needs IO to complete. |
| 143 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| 144 breakpad::InitCrashReporter(std::string()); |
| 145 } |
| 146 #endif |
| 147 |
| 141 } // namespace | 148 } // namespace |
| 142 | 149 |
| 143 namespace chromeos { | 150 namespace chromeos { |
| 144 | 151 |
| 145 const char WizardController::kNetworkScreenName[] = "network"; | 152 const char WizardController::kNetworkScreenName[] = "network"; |
| 146 const char WizardController::kLoginScreenName[] = "login"; | 153 const char WizardController::kLoginScreenName[] = "login"; |
| 147 const char WizardController::kUpdateScreenName[] = "update"; | 154 const char WizardController::kUpdateScreenName[] = "update"; |
| 148 const char WizardController::kUserImageScreenName[] = "image"; | 155 const char WizardController::kUserImageScreenName[] = "image"; |
| 149 const char WizardController::kEulaScreenName[] = "eula"; | 156 const char WizardController::kEulaScreenName[] = "eula"; |
| 150 const char WizardController::kEnableDebuggingScreenName[] = "debugging"; | 157 const char WizardController::kEnableDebuggingScreenName[] = "debugging"; |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 } else { | 595 } else { |
| 589 InitiateOOBEUpdate(); | 596 InitiateOOBEUpdate(); |
| 590 } | 597 } |
| 591 } | 598 } |
| 592 | 599 |
| 593 void WizardController::InitiateMetricsReportingChangeCallback(bool enabled) { | 600 void WizardController::InitiateMetricsReportingChangeCallback(bool enabled) { |
| 594 CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); | 601 CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); |
| 595 if (!enabled) | 602 if (!enabled) |
| 596 return; | 603 return; |
| 597 #if defined(GOOGLE_CHROME_BUILD) | 604 #if defined(GOOGLE_CHROME_BUILD) |
| 598 // The crash reporter initialization needs IO to complete. | 605 if (!content::BrowserThread::PostBlockingPoolTask( |
| 599 base::ThreadRestrictions::ScopedAllowIO allow_io; | 606 FROM_HERE, base::Bind(&InitializeCrashReporter))) { |
| 600 breakpad::InitCrashReporter(std::string()); | 607 LOG(ERROR) << "Failed to start crash reporter initialization."; |
| 608 } |
| 601 #endif | 609 #endif |
| 602 | |
| 603 } | 610 } |
| 604 | 611 |
| 605 void WizardController::OnUpdateErrorCheckingForUpdate() { | 612 void WizardController::OnUpdateErrorCheckingForUpdate() { |
| 606 // TODO(nkostylev): Update should be required during OOBE. | 613 // TODO(nkostylev): Update should be required during OOBE. |
| 607 // We do not want to block users from being able to proceed to the login | 614 // We do not want to block users from being able to proceed to the login |
| 608 // screen if there is any error checking for an update. | 615 // screen if there is any error checking for an update. |
| 609 // They could use "browse without sign-in" feature to set up the network to be | 616 // They could use "browse without sign-in" feature to set up the network to be |
| 610 // able to perform the update later. | 617 // able to perform the update later. |
| 611 OnUpdateCompleted(); | 618 OnUpdateCompleted(); |
| 612 } | 619 } |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 } | 1300 } |
| 1294 | 1301 |
| 1295 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1302 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
| 1296 screen->SetParameters(effective_config, shark_controller_.get(), | 1303 screen->SetParameters(effective_config, shark_controller_.get(), |
| 1297 remora_controller_.get()); | 1304 remora_controller_.get()); |
| 1298 SetStatusAreaVisible(true); | 1305 SetStatusAreaVisible(true); |
| 1299 SetCurrentScreen(screen); | 1306 SetCurrentScreen(screen); |
| 1300 } | 1307 } |
| 1301 | 1308 |
| 1302 } // namespace chromeos | 1309 } // namespace chromeos |
| OLD | NEW |