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

Unified Diff: chrome/browser/idle_chromeos.cc

Issue 7864022: Fixing the bug, that caused UI to hang after unsupported device was inserted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small fixes Created 9 years, 3 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/idle_chromeos.cc
diff --git a/chrome/browser/idle_chromeos.cc b/chrome/browser/idle_chromeos.cc
index 2971fb93631cf12062e10c51085f48ce1e47a221..23777a05be7cdcf504d3748d03288614fee67d50 100644
--- a/chrome/browser/idle_chromeos.cc
+++ b/chrome/browser/idle_chromeos.cc
@@ -22,9 +22,18 @@ void CalculateIdleStateNotifier(unsigned int idle_treshold,
}
void CalculateIdleState(unsigned int idle_threshold, IdleCallback notify) {
+ if (IsWorkstationInLockedState()) {
+ notify.Run(IDLE_STATE_LOCKED);
+ return;
+ }
chromeos::CalculateIdleTimeCallback* callback =
new base::Callback<void(int64_t)>(base::Bind(&CalculateIdleStateNotifier,
idle_threshold,
notify));
chromeos::CrosLibrary::Get()->GetPowerLibrary()->CalculateIdleTime(callback);
}
+
+bool IsWorkstationInLockedState() {
+ // TODO(sidor): Make it work.
+ return false;
+}

Powered by Google App Engine
This is Rietveld 408576698