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

Unified Diff: chrome/browser/chromeos/settings/device_oauth2_token_service.h

Issue 892633003: Do not announce robot account token before account ID is available (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/settings/device_oauth2_token_service.h
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service.h b/chrome/browser/chromeos/settings/device_oauth2_token_service.h
index 0d5f1fe6bc045f3930d95eba218afedd32dd20ec..4941c0279dcdc79bfffde0d230cdb730ad1d42be 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service.h
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "base/stl_util.h"
#include "base/time/time.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "google_apis/gaia/gaia_oauth_client.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "net/url_request/url_request_context_getter.h"
@@ -104,6 +105,9 @@ class DeviceOAuth2TokenService : public OAuth2TokenService,
STATE_TOKEN_VALID,
};
+ // Invoked by CrosSettings when the robot account ID becomes available.
+ void OnServiceAccountIdentityChanged();
+
// Use DeviceOAuth2TokenServiceFactory to get an instance of this class.
// Ownership of |token_encryptor| will be taken.
explicit DeviceOAuth2TokenService(net::URLRequestContextGetter* getter,
@@ -161,6 +165,9 @@ class DeviceOAuth2TokenService : public OAuth2TokenService,
scoped_ptr<gaia::GaiaOAuthClient> gaia_oauth_client_;
+ scoped_ptr<CrosSettings::ObserverSubscription>
+ service_account_identity_subscription_;
+
base::WeakPtrFactory<DeviceOAuth2TokenService> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenService);

Powered by Google App Engine
This is Rietveld 408576698