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 std::string restore_mode; |
52 g_browser_process->local_state()->GetDictionary( | 52 g_browser_process->local_state()->GetDictionary( |
53 prefs::kServerBackedDeviceState)->GetBoolean(policy::kDeviceStateDisabled, | 53 prefs::kServerBackedDeviceState)->GetString( |
54 &is_device_disabled); | 54 policy::kDeviceStateRestoreMode, |
55 if (!is_device_disabled || | 55 &restore_mode); |
56 if (restore_mode != policy::kDeviceStateRestoreModeDisabled || | |
Mattias Nissler (ping if slow)
2014/10/29 17:41:35
Hm, now that this is getting checked in more and m
bartfab (slow)
2014/10/30 14:10:32
Done.
| |
56 CommandLine::ForCurrentProcess()->HasSwitch( | 57 CommandLine::ForCurrentProcess()->HasSwitch( |
57 switches::kDisableDeviceDisabling)) { | 58 switches::kDisableDeviceDisabling)) { |
58 // Skip the screen if the device is not marked as disabled or device | 59 // Skip the screen if the device is not marked as disabled or device |
59 // disabling has been turned off by flag. | 60 // disabling has been turned off by flag. |
60 IndicateDeviceNotDisabled(); | 61 IndicateDeviceNotDisabled(); |
61 return; | 62 return; |
62 } | 63 } |
63 | 64 |
64 policy::BrowserPolicyConnectorChromeOS* connector = | 65 policy::BrowserPolicyConnectorChromeOS* connector = |
65 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 66 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) { | 105 void DeviceDisabledScreen::OnActorDestroyed(DeviceDisabledScreenActor* actor) { |
105 if (actor_ == actor) | 106 if (actor_ == actor) |
106 actor_ = nullptr; | 107 actor_ = nullptr; |
107 } | 108 } |
108 | 109 |
109 void DeviceDisabledScreen::IndicateDeviceNotDisabled() { | 110 void DeviceDisabledScreen::IndicateDeviceNotDisabled() { |
110 get_base_screen_delegate()->OnExit(BaseScreenDelegate::DEVICE_NOT_DISABLED); | 111 get_base_screen_delegate()->OnExit(BaseScreenDelegate::DEVICE_NOT_DISABLED); |
111 } | 112 } |
112 | 113 |
113 } // namespace chromeos | 114 } // namespace chromeos |
OLD | NEW |