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

Side by Side Diff: chrome/browser/chromeos/system/device_disabling_manager.h

Issue 2815893002: Break circular dependency between InitializeDeviceDisablingManager and DeviceDisabledScreen (Closed)
Patch Set: Different approach, moved Init() outside constructor Created 3 years, 8 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
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 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_DEVICE_DISABLING_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_DEVICE_DISABLING_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_DEVICE_DISABLING_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_DEVICE_DISABLING_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // |delegate| must outlive |this|. 82 // |delegate| must outlive |this|.
83 DeviceDisablingManager(Delegate* delegate, 83 DeviceDisablingManager(Delegate* delegate,
84 CrosSettings* cros_settings, 84 CrosSettings* cros_settings,
85 user_manager::UserManager* user_manager); 85 user_manager::UserManager* user_manager);
86 ~DeviceDisablingManager(); 86 ~DeviceDisablingManager();
87 87
88 void AddObserver(Observer* observer); 88 void AddObserver(Observer* observer);
89 void RemoveObserver(Observer* observer); 89 void RemoveObserver(Observer* observer);
90 90
91 void Init();
emaxx 2017/04/13 13:57:31 nit: Please add a comment like "Must be called aft
emaxx 2017/04/13 13:57:31 nit: Move this method upper, right between constru
Ivan Šandrk 2017/04/13 14:22:25 Should I maybe create a factory method or somethin
emaxx 2017/04/13 14:30:01 But how will the bug resolved then? If you do all
Ivan Šandrk 2017/04/13 14:44:09 Done.
Ivan Šandrk 2017/04/13 14:44:09 Done.
Ivan Šandrk 2017/04/13 14:44:09 Haha good point, forgot about that. Was too focuse
92
91 // Returns the cached domain that owns the device. The domain is only 93 // Returns the cached domain that owns the device. The domain is only
92 // guaranteed to be up to date if the disabled screen was triggered. 94 // guaranteed to be up to date if the disabled screen was triggered.
93 const std::string& enrollment_domain() const { return enrollment_domain_; } 95 const std::string& enrollment_domain() const { return enrollment_domain_; }
94 96
95 // Returns the cached disabled message. The message is only guaranteed to be 97 // Returns the cached disabled message. The message is only guaranteed to be
96 // up to date if the disabled screen was triggered. 98 // up to date if the disabled screen was triggered.
97 const std::string& disabled_message() const { return disabled_message_; } 99 const std::string& disabled_message() const { return disabled_message_; }
98 100
99 // Performs a check whether the device is disabled during OOBE. |callback| 101 // Performs a check whether the device is disabled during OOBE. |callback|
100 // will be invoked with the result of the check. 102 // will be invoked with the result of the check.
101 void CheckWhetherDeviceDisabledDuringOOBE( 103 void CheckWhetherDeviceDisabledDuringOOBE(
102 const DeviceDisabledCheckCallback& callback); 104 const DeviceDisabledCheckCallback& callback);
103 105
104 // Whenever trusted cros settings indicate that the device is disabled, this 106 // Whenever trusted cros settings indicate that the device is disabled, this
105 // method should be used to check whether the device disabling is to be 107 // method should be used to check whether the device disabling is to be
106 // honored. If this method returns false, the device should not be disabled. 108 // honored. If this method returns false, the device should not be disabled.
107 static bool HonorDeviceDisablingDuringNormalOperation(); 109 static bool HonorDeviceDisablingDuringNormalOperation();
108 110
109 private: 111 private:
110 void Init();
111
112 // Cache the disabled message and inform observers if it changed. 112 // Cache the disabled message and inform observers if it changed.
113 void CacheDisabledMessageAndNotify(const std::string& disabled_message); 113 void CacheDisabledMessageAndNotify(const std::string& disabled_message);
114 114
115 void UpdateFromCrosSettings(); 115 void UpdateFromCrosSettings();
116 116
117 Delegate* delegate_; 117 Delegate* delegate_;
118 policy::BrowserPolicyConnectorChromeOS* browser_policy_connector_; 118 policy::BrowserPolicyConnectorChromeOS* browser_policy_connector_;
119 CrosSettings* cros_settings_; 119 CrosSettings* cros_settings_;
120 user_manager::UserManager* user_manager_; 120 user_manager::UserManager* user_manager_;
121 121
(...skipping 16 matching lines...) Expand all
138 138
139 base::WeakPtrFactory<DeviceDisablingManager> weak_factory_; 139 base::WeakPtrFactory<DeviceDisablingManager> weak_factory_;
140 140
141 DISALLOW_COPY_AND_ASSIGN(DeviceDisablingManager); 141 DISALLOW_COPY_AND_ASSIGN(DeviceDisablingManager);
142 }; 142 };
143 143
144 } // namespace system 144 } // namespace system
145 } // namespace chromeos 145 } // namespace chromeos
146 146
147 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_DEVICE_DISABLING_MANAGER_H_ 147 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_DEVICE_DISABLING_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698