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

Side by Side Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 882043006: Prevent single-app kiosk mode auto-launch if device is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « chrome/browser/chromeos/login/kiosk_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/login_display_host_impl.h" 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/audio/sounds.h" 9 #include "ash/audio/sounds.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" 42 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h"
43 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" 43 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h"
44 #include "chrome/browser/chromeos/login/ui/oobe_display.h" 44 #include "chrome/browser/chromeos/login/ui/oobe_display.h"
45 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" 45 #include "chrome/browser/chromeos/login/ui/webui_login_display.h"
46 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" 46 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
47 #include "chrome/browser/chromeos/login/wizard_controller.h" 47 #include "chrome/browser/chromeos/login/wizard_controller.h"
48 #include "chrome/browser/chromeos/mobile_config.h" 48 #include "chrome/browser/chromeos/mobile_config.h"
49 #include "chrome/browser/chromeos/net/delay_network_call.h" 49 #include "chrome/browser/chromeos/net/delay_network_call.h"
50 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 50 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
51 #include "chrome/browser/chromeos/policy/enrollment_config.h" 51 #include "chrome/browser/chromeos/policy/enrollment_config.h"
52 #include "chrome/browser/chromeos/settings/cros_settings.h"
53 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
52 #include "chrome/browser/chromeos/system/input_device_settings.h" 54 #include "chrome/browser/chromeos/system/input_device_settings.h"
53 #include "chrome/browser/chromeos/system/timezone_util.h" 55 #include "chrome/browser/chromeos/system/timezone_util.h"
54 #include "chrome/browser/chromeos/ui/focus_ring_controller.h" 56 #include "chrome/browser/chromeos/ui/focus_ring_controller.h"
55 #include "chrome/browser/lifetime/application_lifetime.h" 57 #include "chrome/browser/lifetime/application_lifetime.h"
56 #include "chrome/browser/profiles/profile_manager.h" 58 #include "chrome/browser/profiles/profile_manager.h"
57 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 59 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
58 #include "chrome/common/chrome_constants.h" 60 #include "chrome/common/chrome_constants.h"
59 #include "chrome/common/chrome_switches.h" 61 #include "chrome/common/chrome_switches.h"
60 #include "chrome/common/pref_names.h" 62 #include "chrome/common/pref_names.h"
61 #include "chrome/grit/browser_resources.h" 63 #include "chrome/grit/browser_resources.h"
62 #include "chromeos/audio/chromeos_sounds.h" 64 #include "chromeos/audio/chromeos_sounds.h"
63 #include "chromeos/chromeos_constants.h" 65 #include "chromeos/chromeos_constants.h"
64 #include "chromeos/chromeos_switches.h" 66 #include "chromeos/chromeos_switches.h"
65 #include "chromeos/dbus/dbus_thread_manager.h" 67 #include "chromeos/dbus/dbus_thread_manager.h"
66 #include "chromeos/dbus/session_manager_client.h" 68 #include "chromeos/dbus/session_manager_client.h"
67 #include "chromeos/login/login_state.h" 69 #include "chromeos/login/login_state.h"
70 #include "chromeos/settings/cros_settings_names.h"
71 #include "chromeos/settings/cros_settings_provider.h"
68 #include "chromeos/settings/timezone_settings.h" 72 #include "chromeos/settings/timezone_settings.h"
69 #include "chromeos/timezone/timezone_resolver.h" 73 #include "chromeos/timezone/timezone_resolver.h"
70 #include "components/session_manager/core/session_manager.h" 74 #include "components/session_manager/core/session_manager.h"
71 #include "components/user_manager/user_manager.h" 75 #include "components/user_manager/user_manager.h"
72 #include "content/public/browser/notification_service.h" 76 #include "content/public/browser/notification_service.h"
73 #include "content/public/browser/notification_types.h" 77 #include "content/public/browser/notification_types.h"
74 #include "content/public/browser/web_contents.h" 78 #include "content/public/browser/web_contents.h"
75 #include "content/public/browser/web_ui.h" 79 #include "content/public/browser/web_ui.h"
76 #include "media/audio/sounds/sounds_manager.h" 80 #include "media/audio/sounds/sounds_manager.h"
77 #include "ui/aura/window.h" 81 #include "ui/aura/window.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 SetStatusAreaVisible(false); 664 SetStatusAreaVisible(false);
661 665
662 demo_app_launcher_.reset(new DemoAppLauncher()); 666 demo_app_launcher_.reset(new DemoAppLauncher());
663 demo_app_launcher_->StartDemoAppLaunch(); 667 demo_app_launcher_->StartDemoAppLaunch();
664 } 668 }
665 669
666 void LoginDisplayHostImpl::StartAppLaunch(const std::string& app_id, 670 void LoginDisplayHostImpl::StartAppLaunch(const std::string& app_id,
667 bool diagnostic_mode) { 671 bool diagnostic_mode) {
668 VLOG(1) << "Login WebUI >> start app launch."; 672 VLOG(1) << "Login WebUI >> start app launch.";
669 SetStatusAreaVisible(false); 673 SetStatusAreaVisible(false);
674
675 // Wait for the |CrosSettings| to become either trusted or permanently
676 // untrusted.
677 const CrosSettingsProvider::TrustedStatus status =
678 CrosSettings::Get()->PrepareTrustedValues(base::Bind(
679 &LoginDisplayHostImpl::StartAppLaunch,
680 pointer_factory_.GetWeakPtr(),
681 app_id,
682 diagnostic_mode));
683 if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED)
684 return;
685
686 if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
687 // If the |CrosSettings| are permanently untrusted, refuse to launch a
688 // single-app kiosk mode session.
689 LOG(ERROR) << "Login WebUI >> Refusing to launch single-app kiosk mode.";
690 SetStatusAreaVisible(true);
691 return;
692 }
693
694 bool device_disabled = false;
695 CrosSettings::Get()->GetBoolean(kDeviceDisabled, &device_disabled);
696 if (device_disabled && system::DeviceDisablingManager::
697 HonorDeviceDisablingDuringNormalOperation()) {
698 // If the device is disabled, bail out. A device disabled screen will be
699 // shown by the DeviceDisablingManager.
700 return;
701 }
702
670 finalize_animation_type_ = ANIMATION_FADE_OUT; 703 finalize_animation_type_ = ANIMATION_FADE_OUT;
671 if (!login_window_) 704 if (!login_window_)
672 LoadURL(GURL(kAppLaunchSplashURL)); 705 LoadURL(GURL(kAppLaunchSplashURL));
673 706
674 login_view_->set_should_emit_login_prompt_visible(false); 707 login_view_->set_should_emit_login_prompt_visible(false);
675 708
676 app_launch_controller_.reset(new AppLaunchController( 709 app_launch_controller_.reset(new AppLaunchController(
677 app_id, diagnostic_mode, this, GetOobeUI())); 710 app_id, diagnostic_mode, this, GetOobeUI()));
678 711
679 app_launch_controller_->StartAppLaunch(); 712 app_launch_controller_->StartAppLaunch();
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 1266
1234 locale_util::SwitchLanguageCallback callback( 1267 locale_util::SwitchLanguageCallback callback(
1235 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))); 1268 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())));
1236 1269
1237 // Load locale keyboards here. Hardware layout would be automatically enabled. 1270 // Load locale keyboards here. Hardware layout would be automatically enabled.
1238 locale_util::SwitchLanguage( 1271 locale_util::SwitchLanguage(
1239 locale, true, true /* login_layouts_only */, callback); 1272 locale, true, true /* login_layouts_only */, callback);
1240 } 1273 }
1241 1274
1242 } // namespace chromeos 1275 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/kiosk_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698