Chromium Code Reviews| Index: chrome/browser/chromeos/system/device_disabling_manager.cc |
| diff --git a/chrome/browser/chromeos/system/device_disabling_manager.cc b/chrome/browser/chromeos/system/device_disabling_manager.cc |
| index dce9e67903a8f07c71e2e1c5943d111c81429ba9..cd4e2c9b8d8a8dd0bf715ba5c8a99c1aac50a14e 100644 |
| --- a/chrome/browser/chromeos/system/device_disabling_manager.cc |
| +++ b/chrome/browser/chromeos/system/device_disabling_manager.cc |
| @@ -21,6 +21,9 @@ |
| #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| #include "components/prefs/pref_service.h" |
| #include "components/user_manager/user_manager.h" |
| +#include "content/public/browser/browser_thread.h" |
| + |
| +using content::BrowserThread; |
| namespace chromeos { |
| namespace system { |
| @@ -74,7 +77,10 @@ void DeviceDisablingManager::Init() { |
| base::Bind(&DeviceDisablingManager::UpdateFromCrosSettings, |
| weak_factory_.GetWeakPtr())); |
| - UpdateFromCrosSettings(); |
| + auto callback = |
|
emaxx
2017/04/12 17:05:49
nit: Storing the callback in a variable seems to b
Ivan Šandrk
2017/04/13 13:38:00
Done. Should I maybe cleanup the code a bit? Use a
|
| + base::BindOnce(&DeviceDisablingManager::UpdateFromCrosSettings, |
| + weak_factory_.GetWeakPtr()); |
| + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); |
|
emaxx
2017/04/12 17:05:49
I think the following way of posting tasks is pref
emaxx
2017/04/12 17:05:49
nit: Please add a comment why the deferring is per
Ivan Šandrk
2017/04/13 13:37:59
Done.
Ivan Šandrk
2017/04/13 13:38:00
Done.
|
| } |
| void DeviceDisablingManager::CacheDisabledMessageAndNotify( |