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