OLD | NEW |
---|---|
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/screens/device_disabled_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 actor_->SetDelegate(nullptr); | 41 actor_->SetDelegate(nullptr); |
42 } | 42 } |
43 | 43 |
44 void DeviceDisabledScreen::PrepareToShow() { | 44 void DeviceDisabledScreen::PrepareToShow() { |
45 } | 45 } |
46 | 46 |
47 void DeviceDisabledScreen::Show() { | 47 void DeviceDisabledScreen::Show() { |
48 if (!actor_ || showing_) | 48 if (!actor_ || showing_) |
49 return; | 49 return; |
50 | 50 |
51 bool is_device_disabled = false; | 51 if (policy::GetRestoreMode() != policy::RESTORE_MODE_DISABLED || |
Denis Kuznetsov (DE-MUC)
2014/10/30 22:18:06
Do we need to check for trusted mode here?
bartfab (slow)
2014/11/03 13:32:50
Device disabling can be triggered by two different
| |
52 g_browser_process->local_state()->GetDictionary( | |
53 prefs::kServerBackedDeviceState)->GetBoolean(policy::kDeviceStateDisabled, | |
54 &is_device_disabled); | |
55 if (!is_device_disabled || | |
56 CommandLine::ForCurrentProcess()->HasSwitch( | 52 CommandLine::ForCurrentProcess()->HasSwitch( |
57 switches::kDisableDeviceDisabling)) { | 53 switches::kDisableDeviceDisabling)) { |
58 // Skip the screen if the device is not marked as disabled or device | 54 // Skip the screen if the device is not marked as disabled or device |
59 // disabling has been turned off by flag. | 55 // disabling has been turned off by flag. |
60 IndicateDeviceNotDisabled(); | 56 IndicateDeviceNotDisabled(); |
61 return; | 57 return; |
62 } | 58 } |
63 | 59 |
64 policy::BrowserPolicyConnectorChromeOS* connector = | 60 policy::BrowserPolicyConnectorChromeOS* connector = |
65 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 61 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 void DeviceDisabledScreen::OnActorDestroyed(DeviceDisabledScreenActor* actor) { | 100 void DeviceDisabledScreen::OnActorDestroyed(DeviceDisabledScreenActor* actor) { |
105 if (actor_ == actor) | 101 if (actor_ == actor) |
106 actor_ = nullptr; | 102 actor_ = nullptr; |
107 } | 103 } |
108 | 104 |
109 void DeviceDisabledScreen::IndicateDeviceNotDisabled() { | 105 void DeviceDisabledScreen::IndicateDeviceNotDisabled() { |
110 get_base_screen_delegate()->OnExit(BaseScreenDelegate::DEVICE_NOT_DISABLED); | 106 get_base_screen_delegate()->OnExit(BaseScreenDelegate::DEVICE_NOT_DISABLED); |
111 } | 107 } |
112 | 108 |
113 } // namespace chromeos | 109 } // namespace chromeos |
OLD | NEW |