| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/callback_helpers.h" | 16 #include "base/callback_helpers.h" |
| 17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
| 18 #include "base/location.h" | 18 #include "base/location.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/macros.h" | 20 #include "base/macros.h" |
| 21 #include "base/metrics/histogram_macros.h" | 21 #include "base/metrics/histogram_macros.h" |
| 22 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
| 23 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 24 #include "base/task_scheduler/post_task.h" | |
| 25 #include "base/threading/thread_task_runner_handle.h" | 24 #include "base/threading/thread_task_runner_handle.h" |
| 26 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/browser_process.h" |
| 27 #include "chrome/browser/browser_process_platform_part.h" | 26 #include "chrome/browser/browser_process_platform_part.h" |
| 28 #include "chrome/browser/chrome_notification_types.h" | 27 #include "chrome/browser/chrome_notification_types.h" |
| 29 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 30 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 29 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 31 #include "chrome/browser/chromeos/arc/arc_util.h" | 30 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 32 #include "chrome/browser/chromeos/customization/customization_document.h" | 31 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 33 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.
h" | 32 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.
h" |
| 34 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" | 33 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 (network->type() == shill::kTypeCellular && | 215 (network->type() == shill::kTypeCellular && |
| 217 !help_utils_chromeos::IsUpdateOverCellularAllowed())) { | 216 !help_utils_chromeos::IsUpdateOverCellularAllowed())) { |
| 218 return false; | 217 return false; |
| 219 } | 218 } |
| 220 return true; | 219 return true; |
| 221 } | 220 } |
| 222 | 221 |
| 223 #if defined(GOOGLE_CHROME_BUILD) | 222 #if defined(GOOGLE_CHROME_BUILD) |
| 224 void InitializeCrashReporter() { | 223 void InitializeCrashReporter() { |
| 225 // The crash reporter initialization needs IO to complete. | 224 // The crash reporter initialization needs IO to complete. |
| 225 DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| 226 breakpad::InitCrashReporter(std::string()); | 226 breakpad::InitCrashReporter(std::string()); |
| 227 } | 227 } |
| 228 #endif | 228 #endif |
| 229 | 229 |
| 230 } // namespace | 230 } // namespace |
| 231 | 231 |
| 232 namespace chromeos { | 232 namespace chromeos { |
| 233 | 233 |
| 234 // static | 234 // static |
| 235 const int WizardController::kMinAudibleOutputVolumePercent = 10; | 235 const int WizardController::kMinAudibleOutputVolumePercent = 10; |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 } else { | 711 } else { |
| 712 InitiateOOBEUpdate(); | 712 InitiateOOBEUpdate(); |
| 713 } | 713 } |
| 714 } | 714 } |
| 715 | 715 |
| 716 void WizardController::OnChangedMetricsReportingState(bool enabled) { | 716 void WizardController::OnChangedMetricsReportingState(bool enabled) { |
| 717 CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); | 717 CrosSettings::Get()->SetBoolean(kStatsReportingPref, enabled); |
| 718 if (!enabled) | 718 if (!enabled) |
| 719 return; | 719 return; |
| 720 #if defined(GOOGLE_CHROME_BUILD) | 720 #if defined(GOOGLE_CHROME_BUILD) |
| 721 if (!base::PostTaskWithTraits(FROM_HERE, | 721 if (!content::BrowserThread::PostBlockingPoolTask( |
| 722 base::TaskTraits().MayBlock().WithPriority( | 722 FROM_HERE, base::Bind(&InitializeCrashReporter))) { |
| 723 base::TaskPriority::BACKGROUND), | |
| 724 base::Bind(&InitializeCrashReporter))) { | |
| 725 LOG(ERROR) << "Failed to start crash reporter initialization."; | 723 LOG(ERROR) << "Failed to start crash reporter initialization."; |
| 726 } | 724 } |
| 727 #endif | 725 #endif |
| 728 } | 726 } |
| 729 | 727 |
| 730 void WizardController::OnUpdateErrorCheckingForUpdate() { | 728 void WizardController::OnUpdateErrorCheckingForUpdate() { |
| 731 // TODO(nkostylev): Update should be required during OOBE. | 729 // TODO(nkostylev): Update should be required during OOBE. |
| 732 // We do not want to block users from being able to proceed to the login | 730 // We do not want to block users from being able to proceed to the login |
| 733 // screen if there is any error checking for an update. | 731 // screen if there is any error checking for an update. |
| 734 // They could use "browse without sign-in" feature to set up the network to be | 732 // They could use "browse without sign-in" feature to set up the network to be |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1492 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
| 1495 } | 1493 } |
| 1496 | 1494 |
| 1497 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1495 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
| 1498 screen->SetParameters(effective_config, shark_controller_.get()); | 1496 screen->SetParameters(effective_config, shark_controller_.get()); |
| 1499 SetStatusAreaVisible(true); | 1497 SetStatusAreaVisible(true); |
| 1500 SetCurrentScreen(screen); | 1498 SetCurrentScreen(screen); |
| 1501 } | 1499 } |
| 1502 | 1500 |
| 1503 } // namespace chromeos | 1501 } // namespace chromeos |
| OLD | NEW |