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

Unified Diff: chrome/browser/chromeos/system/device_disabling_manager.cc

Issue 2815893002: Break circular dependency between InitializeDeviceDisablingManager and DeviceDisabledScreen (Closed)
Patch Set: Added a check to the crash site 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 side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698