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

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

Issue 2456803002: Remove OnOptInChanged callback. (Closed)
Patch Set: Address comments. Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | chrome/browser/chromeos/extensions/gfx_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_auth_service_browsertest.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service_browsertest.cc b/chrome/browser/chromeos/arc/arc_auth_service_browsertest.cc
index 9ac9f84ab430bae7c045ad4c8604507e744b5200..b4f10f1634d503e88d540df48345b2487f76a0da 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service_browsertest.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service_browsertest.cc
@@ -55,11 +55,12 @@ const char kFakeUserName[] = "test@example.com";
namespace arc {
-// Base ArcAuthService observer.
-class ArcAuthServiceObserver : public ArcAuthService::Observer {
+// Observer of ARC bridge shutdown.
+class ArcAuthServiceShutdownObserver : public ArcAuthService::Observer {
public:
- // ArcAuthService::Observer:
- ~ArcAuthServiceObserver() override {
+ ArcAuthServiceShutdownObserver() { ArcAuthService::Get()->AddObserver(this); }
+
+ ~ArcAuthServiceShutdownObserver() override {
ArcAuthService::Get()->RemoveObserver(this);
}
@@ -69,36 +70,6 @@ class ArcAuthServiceObserver : public ArcAuthService::Observer {
run_loop_.reset();
}
- protected:
- ArcAuthServiceObserver() { ArcAuthService::Get()->AddObserver(this); }
-
- std::unique_ptr<base::RunLoop> run_loop_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ArcAuthServiceObserver);
-};
-
-// Observer of ArcAuthService state change.
-class ArcAuthServiceStateObserver : public ArcAuthServiceObserver {
- public:
- ArcAuthServiceStateObserver() : ArcAuthServiceObserver() {}
-
- // ArcAuthService::Observer:
- void OnOptInChanged(ArcAuthService::State state) override {
- if (!run_loop_)
- return;
- run_loop_->Quit();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ArcAuthServiceStateObserver);
-};
-
-// Observer of ARC bridge shutdown.
-class ArcAuthServiceShutdownObserver : public ArcAuthServiceObserver {
- public:
- ArcAuthServiceShutdownObserver() : ArcAuthServiceObserver() {}
-
// ArcAuthService::Observer:
void OnShutdownBridge() override {
if (!run_loop_)
@@ -107,6 +78,8 @@ class ArcAuthServiceShutdownObserver : public ArcAuthServiceObserver {
}
private:
+ std::unique_ptr<base::RunLoop> run_loop_;
+
DISALLOW_COPY_AND_ASSIGN(ArcAuthServiceShutdownObserver);
};
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | chrome/browser/chromeos/extensions/gfx_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698