[GCM] Clean up AccountTracker public API

This CL restricts the AccountTracker public API to what's actually
used by GCMAccountTracker, its only client. This helps to clarify what
the purpose of AccountTracker is.

The CL also removes an AccountTracker unittest that was calling into a
now-private API. That test checks that a token revocation doesn't
cause any AccountTracker event to fire if the token was never made
available in the first place. That sequence of events (token revocation
being fired by OAuth2TokenService without the token first being made
available) doesn't reflect reality, so there is no purpose in testing
for it.

Change-Id: Ic3085897b87895faa6cf0c3d5d5d9f6520d0c808
Reviewed-on: https://chromium-review.googlesource.com/1046832
Commit-Queue: Colin Blundell <[email protected]>
Reviewed-by: Peter Beverloo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#561013}
diff --git a/components/gcm_driver/account_tracker.h b/components/gcm_driver/account_tracker.h
index 23ed00b..d6a7e34 100644
--- a/components/gcm_driver/account_tracker.h
+++ b/components/gcm_driver/account_tracker.h
@@ -65,6 +65,18 @@
   // in the vector. Additional accounts will be in order of their gaia IDs.
   std::vector<AccountIds> GetAccounts() const;
 
+  // Indicates if all user information has been fetched. If the result is false,
+  // there are still unfinished fetchers.
+  virtual bool IsAllUserInfoFetched() const;
+
+ private:
+  friend class AccountIdFetcher;
+
+  struct AccountState {
+    AccountIds ids;
+    bool is_signed_in;
+  };
+
   // OAuth2TokenService::Observer implementation.
   void OnRefreshTokenAvailable(const std::string& account_key) override;
   void OnRefreshTokenRevoked(const std::string& account_key) override;
@@ -79,19 +91,6 @@
   void GoogleSignedOut(const std::string& account_id,
                        const std::string& username) override;
 
-  // Sets the state of an account. Does not fire notifications.
-  void SetAccountStateForTest(AccountIds ids, bool is_signed_in);
-
-  // Indicates if all user information has been fetched. If the result is false,
-  // there are still unfinished fetchers.
-  virtual bool IsAllUserInfoFetched() const;
-
- private:
-  struct AccountState {
-    AccountIds ids;
-    bool is_signed_in;
-  };
-
   void NotifySignInChanged(const AccountState& account);
 
   void UpdateSignInState(const std::string& account_key, bool is_signed_in);