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

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

Issue 711433002: Enable device disabling during normal operation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_4_425574_add_device_disabling_manager
Patch Set: Address one more comment I had missed. 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/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 23 matching lines...) Expand all
34 #include "chrome/browser/chromeos/login/startup_utils.h" 34 #include "chrome/browser/chromeos/login/startup_utils.h"
35 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 35 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
36 #include "chrome/browser/chromeos/login/user_flow.h" 36 #include "chrome/browser/chromeos/login/user_flow.h"
37 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" 37 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
38 #include "chrome/browser/chromeos/login/wizard_controller.h" 38 #include "chrome/browser/chromeos/login/wizard_controller.h"
39 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 39 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
40 #include "chrome/browser/chromeos/policy/device_local_account.h" 40 #include "chrome/browser/chromeos/policy/device_local_account.h"
41 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" 41 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
42 #include "chrome/browser/chromeos/profiles/profile_helper.h" 42 #include "chrome/browser/chromeos/profiles/profile_helper.h"
43 #include "chrome/browser/chromeos/settings/cros_settings.h" 43 #include "chrome/browser/chromeos/settings/cros_settings.h"
44 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
44 #include "chrome/browser/signin/easy_unlock_service.h" 45 #include "chrome/browser/signin/easy_unlock_service.h"
45 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" 46 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
46 #include "chrome/common/chrome_switches.h" 47 #include "chrome/common/chrome_switches.h"
47 #include "chrome/common/chrome_version_info.h" 48 #include "chrome/common/chrome_version_info.h"
48 #include "chrome/common/url_constants.h" 49 #include "chrome/common/url_constants.h"
49 #include "chrome/grit/generated_resources.h" 50 #include "chrome/grit/generated_resources.h"
50 #include "chromeos/chromeos_switches.h" 51 #include "chromeos/chromeos_switches.h"
51 #include "chromeos/dbus/dbus_thread_manager.h" 52 #include "chromeos/dbus/dbus_thread_manager.h"
52 #include "chromeos/dbus/power_manager_client.h" 53 #include "chromeos/dbus/power_manager_client.h"
53 #include "chromeos/dbus/session_manager_client.h" 54 #include "chromeos/dbus/session_manager_client.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED) 429 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED)
429 return; 430 return;
430 431
431 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) { 432 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
432 // If the |cros_settings_| are permanently untrusted, show an error message 433 // If the |cros_settings_| are permanently untrusted, show an error message
433 // and refuse to log in. 434 // and refuse to log in.
434 login_display_->ShowError(IDS_LOGIN_ERROR_OWNER_KEY_LOST, 435 login_display_->ShowError(IDS_LOGIN_ERROR_OWNER_KEY_LOST,
435 1, 436 1,
436 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT); 437 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT);
437 438
438 // Reenable clicking on other windows and the status area. Do not start the 439 // Re-enable clicking on other windows and the status area. Do not start the
439 // auto-login timer though. Without trusted |cros_settings_|, no auto-login 440 // auto-login timer though. Without trusted |cros_settings_|, no auto-login
440 // can succeed. 441 // can succeed.
441 login_display_->SetUIEnabled(true); 442 login_display_->SetUIEnabled(true);
442 return; 443 return;
443 } 444 }
444 445
446 bool device_disabled = false;
447 cros_settings_->GetBoolean(kDeviceDisabled, &device_disabled);
448 if (device_disabled && system::DeviceDisablingManager::
449 HonorDeviceDisablingDuringNormalOperation()) {
450 // If the device is disabled, bail out. A device disabled screen will be
451 // shown by the DeviceDisablingManager.
452
453 // Re-enable clicking on other windows and the status area. Do not start the
454 // auto-login timer though. On a disabled device, no auto-login can succeed.
455 login_display_->SetUIEnabled(true);
456 return;
457 }
458
445 if (is_login_in_progress_) { 459 if (is_login_in_progress_) {
446 // If there is another login in progress, bail out. Do not re-enable 460 // If there is another login in progress, bail out. Do not re-enable
447 // clicking on other windows and the status area. Do not start the 461 // clicking on other windows and the status area. Do not start the
448 // auto-login timer. 462 // auto-login timer.
449 return; 463 return;
450 } 464 }
451 465
452 if (user_context.GetUserType() != user_manager::USER_TYPE_REGULAR && 466 if (user_context.GetUserType() != user_manager::USER_TYPE_REGULAR &&
453 user_manager::UserManager::Get()->IsUserLoggedIn()) { 467 user_manager::UserManager::Get()->IsUserLoggedIn()) {
454 // Multi-login is only allowed for regular users. If we are attempting to 468 // Multi-login is only allowed for regular users. If we are attempting to
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 is_login_in_progress_ = false; 1214 is_login_in_progress_ = false;
1201 1215
1202 // Reenable clicking on other windows and status area. 1216 // Reenable clicking on other windows and status area.
1203 login_display_->SetUIEnabled(true); 1217 login_display_->SetUIEnabled(true);
1204 1218
1205 if (start_public_session_timer) 1219 if (start_public_session_timer)
1206 StartPublicSessionAutoLoginTimer(); 1220 StartPublicSessionAutoLoginTimer();
1207 } 1221 }
1208 1222
1209 } // namespace chromeos 1223 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698