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

Unified Diff: chrome/browser/chromeos/arc/test/arc_data_removed_waiter.cc

Issue 2561023002: arc: ARC loading progress should not be shown when started from OOBE. (Closed)
Patch Set: rebased + comments updated 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/test/arc_data_removed_waiter.cc
diff --git a/chrome/browser/chromeos/arc/test/arc_data_removed_waiter.cc b/chrome/browser/chromeos/arc/test/arc_data_removed_waiter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d9f3acb9172142fa2b835c9d79af9e4582c97b36
--- /dev/null
+++ b/chrome/browser/chromeos/arc/test/arc_data_removed_waiter.cc
@@ -0,0 +1,32 @@
+// 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/test/arc_data_removed_waiter.h"
+
+#include "base/memory/ptr_util.h"
+#include "base/run_loop.h"
+
+namespace arc {
+
+ArcDataRemovedWaiter::ArcDataRemovedWaiter() {
+ DCHECK(ArcSessionManager::Get());
+ ArcSessionManager::Get()->AddObserver(this);
+}
+
+ArcDataRemovedWaiter::~ArcDataRemovedWaiter() {
+ ArcSessionManager::Get()->RemoveObserver(this);
+}
+
+void ArcDataRemovedWaiter::Wait() {
+ run_loop_ = base::MakeUnique<base::RunLoop>();
+ run_loop_->Run();
+ run_loop_.reset();
+}
+
+void ArcDataRemovedWaiter::OnArcDataRemoved() {
+ if (!run_loop_)
+ return;
+ run_loop_->Quit();
+}
+
+} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698