Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 696263003: Prevent login while cros settings are untrusted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_425574_add_protos_for_device_disabling_in_steady_state
Patch Set: Fix multi-login. Fix style guide violation: no else after return. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "chrome/common/pref_names.h" 63 #include "chrome/common/pref_names.h"
64 #include "chromeos/audio/cras_audio_handler.h" 64 #include "chromeos/audio/cras_audio_handler.h"
65 #include "chromeos/chromeos_constants.h" 65 #include "chromeos/chromeos_constants.h"
66 #include "chromeos/chromeos_switches.h" 66 #include "chromeos/chromeos_switches.h"
67 #include "chromeos/dbus/dbus_thread_manager.h" 67 #include "chromeos/dbus/dbus_thread_manager.h"
68 #include "chromeos/dbus/session_manager_client.h" 68 #include "chromeos/dbus/session_manager_client.h"
69 #include "chromeos/network/network_state.h" 69 #include "chromeos/network/network_state.h"
70 #include "chromeos/network/network_state_handler.h" 70 #include "chromeos/network/network_state_handler.h"
71 #include "chromeos/network/portal_detector/network_portal_detector.h" 71 #include "chromeos/network/portal_detector/network_portal_detector.h"
72 #include "chromeos/settings/cros_settings_names.h" 72 #include "chromeos/settings/cros_settings_names.h"
73 #include "chromeos/settings/cros_settings_provider.h"
73 #include "chromeos/settings/timezone_settings.h" 74 #include "chromeos/settings/timezone_settings.h"
74 #include "components/crash/app/breakpad_linux.h" 75 #include "components/crash/app/breakpad_linux.h"
75 #include "components/pairing/bluetooth_controller_pairing_controller.h" 76 #include "components/pairing/bluetooth_controller_pairing_controller.h"
76 #include "components/pairing/bluetooth_host_pairing_controller.h" 77 #include "components/pairing/bluetooth_host_pairing_controller.h"
77 #include "components/pairing/shark_connection_listener.h" 78 #include "components/pairing/shark_connection_listener.h"
78 #include "components/user_manager/user_manager.h" 79 #include "components/user_manager/user_manager.h"
79 #include "content/public/browser/browser_thread.h" 80 #include "content/public/browser/browser_thread.h"
80 #include "content/public/browser/notification_types.h" 81 #include "content/public/browser/notification_types.h"
81 #include "ui/base/accelerators/accelerator.h" 82 #include "ui/base/accelerators/accelerator.h"
82 83
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 } else if (cras->GetOutputVolumePercent() < kMinAudibleOutputVolumePercent) { 1083 } else if (cras->GetOutputVolumePercent() < kMinAudibleOutputVolumePercent) {
1083 cras->SetOutputVolumePercent(kMinAudibleOutputVolumePercent); 1084 cras->SetOutputVolumePercent(kMinAudibleOutputVolumePercent);
1084 } 1085 }
1085 } 1086 }
1086 1087
1087 void WizardController::AutoLaunchKioskApp() { 1088 void WizardController::AutoLaunchKioskApp() {
1088 KioskAppManager::App app_data; 1089 KioskAppManager::App app_data;
1089 std::string app_id = KioskAppManager::Get()->GetAutoLaunchApp(); 1090 std::string app_id = KioskAppManager::Get()->GetAutoLaunchApp();
1090 CHECK(KioskAppManager::Get()->GetApp(app_id, &app_data)); 1091 CHECK(KioskAppManager::Get()->GetApp(app_id, &app_data));
1091 1092
1093 // Wait for the |CrosSettings| to become either trusted or permanently
1094 // untrusted.
1095 const CrosSettingsProvider::TrustedStatus status =
1096 CrosSettings::Get()->PrepareTrustedValues(base::Bind(
1097 &WizardController::AutoLaunchKioskApp,
1098 weak_factory_.GetWeakPtr()));
1099 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED)
1100 return;
1101
1102 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
1103 // If the |cros_settings_| are permanently untrusted, show an error message
1104 // and refuse to auto-launch the kiosk app.
1105 GetErrorScreen()->SetUIState(ErrorScreen::UI_STATE_LOCAL_STATE_ERROR);
1106 SetStatusAreaVisible(false);
1107 ShowErrorScreen();
1108 return;
1109 }
1110
1092 host_->StartAppLaunch(app_id, false /* diagnostic_mode */); 1111 host_->StartAppLaunch(app_id, false /* diagnostic_mode */);
1093 } 1112 }
1094 1113
1095 // static 1114 // static
1096 void WizardController::SetZeroDelays() { 1115 void WizardController::SetZeroDelays() {
1097 kShowDelayMs = 0; 1116 kShowDelayMs = 0;
1098 zero_delay_enabled_ = true; 1117 zero_delay_enabled_ = true;
1099 } 1118 }
1100 1119
1101 // static 1120 // static
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 scoped_ptr<pairing_chromeos::HostPairingController> remora_controller) { 1313 scoped_ptr<pairing_chromeos::HostPairingController> remora_controller) {
1295 VLOG(1) << "OnSharkConnected"; 1314 VLOG(1) << "OnSharkConnected";
1296 remora_controller_ = remora_controller.Pass(); 1315 remora_controller_ = remora_controller.Pass();
1297 base::MessageLoop::current()->DeleteSoon( 1316 base::MessageLoop::current()->DeleteSoon(
1298 FROM_HERE, shark_connection_listener_.release()); 1317 FROM_HERE, shark_connection_listener_.release());
1299 shark_controller_detected_ = true; 1318 shark_controller_detected_ = true;
1300 ShowHostPairingScreen(); 1319 ShowHostPairingScreen();
1301 } 1320 }
1302 1321
1303 } // namespace chromeos 1322 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/kiosk_browsertest.cc ('k') | chrome/browser/chromeos/policy/device_local_account_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698