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

Unified Diff: chrome/browser/chromeos/arc/arc_session_manager_data_removed_waiter.cc

Issue 2561023002: arc: ARC loading progress should not be shown when started from OOBE. (Closed)
Patch Set: refactored Created 3 years, 11 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/arc/arc_session_manager_data_removed_waiter.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager_data_removed_waiter.cc b/chrome/browser/chromeos/arc/arc_session_manager_data_removed_waiter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f576bb5df8823fcb0f3b78cf8d3bfbc6c868a06c
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_session_manager_data_removed_waiter.cc
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#include "chrome/browser/chromeos/arc/arc_session_manager_data_removed_waiter.h"
+
+#include "base/run_loop.h"
+
+namespace arc {
+
+ArcSessionManagerDataRemovedWaiter::ArcSessionManagerDataRemovedWaiter() {
+ DCHECK(ArcSessionManager::Get());
+ ArcSessionManager::Get()->AddObserver(this);
+}
+
+ArcSessionManagerDataRemovedWaiter::~ArcSessionManagerDataRemovedWaiter() {
+ ArcSessionManager::Get()->RemoveObserver(this);
+}
+
+void ArcSessionManagerDataRemovedWaiter::Wait() {
+ run_loop_.reset(new base::RunLoop);
hidehiko 2017/01/30 10:12:35 run_loop_ = base::MakeUnique<RunLoop>(); cf) Pleas
khmel 2017/01/31 02:47:08 Done.
+ run_loop_->Run();
+ run_loop_.reset();
+}
+
+void ArcSessionManagerDataRemovedWaiter::OnArcDataRemoved() {
+ if (!run_loop_)
+ return;
+ run_loop_->Quit();
+}
+
+} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698