| 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/logging.h" | 19 #include "base/logging.h" |
| 19 #include "base/macros.h" | 20 #include "base/macros.h" |
| 20 #include "base/metrics/histogram.h" | 21 #include "base/metrics/histogram.h" |
| 22 #include "base/single_thread_task_runner.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 24 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/browser_process_platform_part.h" | 26 #include "chrome/browser/browser_process_platform_part.h" |
| 24 #include "chrome/browser/chrome_notification_types.h" | 27 #include "chrome/browser/chrome_notification_types.h" |
| 25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 26 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 29 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 27 #include "chrome/browser/chromeos/customization/customization_document.h" | 30 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 28 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.
h" | 31 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.
h" |
| 29 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" | 32 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" |
| 30 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 33 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 31 #include "chrome/browser/chromeos/login/helper.h" | 34 #include "chrome/browser/chromeos/login/helper.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 accessibility_subscription_ = accessibility_manager->RegisterCallback( | 247 accessibility_subscription_ = accessibility_manager->RegisterCallback( |
| 245 base::Bind(&WizardController::OnAccessibilityStatusChanged, | 248 base::Bind(&WizardController::OnAccessibilityStatusChanged, |
| 246 base::Unretained(this))); | 249 base::Unretained(this))); |
| 247 } else { | 250 } else { |
| 248 NOTIMPLEMENTED(); | 251 NOTIMPLEMENTED(); |
| 249 } | 252 } |
| 250 } | 253 } |
| 251 | 254 |
| 252 WizardController::~WizardController() { | 255 WizardController::~WizardController() { |
| 253 if (shark_connection_listener_.get()) { | 256 if (shark_connection_listener_.get()) { |
| 254 base::MessageLoop::current()->DeleteSoon( | 257 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( |
| 255 FROM_HERE, shark_connection_listener_.release()); | 258 FROM_HERE, shark_connection_listener_.release()); |
| 256 } | 259 } |
| 257 if (default_controller_ == this) { | 260 if (default_controller_ == this) { |
| 258 default_controller_ = nullptr; | 261 default_controller_ = nullptr; |
| 259 } else { | 262 } else { |
| 260 NOTREACHED() << "More than one controller are alive."; | 263 NOTREACHED() << "More than one controller are alive."; |
| 261 } | 264 } |
| 262 } | 265 } |
| 263 | 266 |
| 264 void WizardController::Init(const std::string& first_screen_name) { | 267 void WizardController::Init(const std::string& first_screen_name) { |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 base::Bind(&WizardController::OnSharkConnected, | 1358 base::Bind(&WizardController::OnSharkConnected, |
| 1356 weak_factory_.GetWeakPtr()))); | 1359 weak_factory_.GetWeakPtr()))); |
| 1357 } | 1360 } |
| 1358 } | 1361 } |
| 1359 | 1362 |
| 1360 void WizardController::OnSharkConnected( | 1363 void WizardController::OnSharkConnected( |
| 1361 std::unique_ptr<pairing_chromeos::HostPairingController> | 1364 std::unique_ptr<pairing_chromeos::HostPairingController> |
| 1362 remora_controller) { | 1365 remora_controller) { |
| 1363 VLOG(1) << "OnSharkConnected"; | 1366 VLOG(1) << "OnSharkConnected"; |
| 1364 remora_controller_ = std::move(remora_controller); | 1367 remora_controller_ = std::move(remora_controller); |
| 1365 base::MessageLoop::current()->DeleteSoon( | 1368 base::ThreadTaskRunnerHandle::Get()->DeleteSoon( |
| 1366 FROM_HERE, shark_connection_listener_.release()); | 1369 FROM_HERE, shark_connection_listener_.release()); |
| 1367 SetControllerDetectedPref(true); | 1370 SetControllerDetectedPref(true); |
| 1368 ShowHostPairingScreen(); | 1371 ShowHostPairingScreen(); |
| 1369 } | 1372 } |
| 1370 | 1373 |
| 1371 void WizardController::OnSetHostNetworkFailed() { | 1374 void WizardController::OnSetHostNetworkFailed() { |
| 1372 remora_controller_->OnNetworkConnectivityChanged( | 1375 remora_controller_->OnNetworkConnectivityChanged( |
| 1373 pairing_chromeos::HostPairingController::CONNECTIVITY_NONE); | 1376 pairing_chromeos::HostPairingController::CONNECTIVITY_NONE); |
| 1374 } | 1377 } |
| 1375 | 1378 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1387 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; | 1390 : policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT; |
| 1388 } | 1391 } |
| 1389 | 1392 |
| 1390 EnrollmentScreen* screen = EnrollmentScreen::Get(this); | 1393 EnrollmentScreen* screen = EnrollmentScreen::Get(this); |
| 1391 screen->SetParameters(effective_config, shark_controller_.get()); | 1394 screen->SetParameters(effective_config, shark_controller_.get()); |
| 1392 SetStatusAreaVisible(true); | 1395 SetStatusAreaVisible(true); |
| 1393 SetCurrentScreen(screen); | 1396 SetCurrentScreen(screen); |
| 1394 } | 1397 } |
| 1395 | 1398 |
| 1396 } // namespace chromeos | 1399 } // namespace chromeos |
| OLD | NEW |