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

Unified Diff: google_apis/gaia/dummy_identity_provider.h

Issue 301973009: Add browser-global GCMDriver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: google_apis/gaia/dummy_identity_provider.h
diff --git a/google_apis/gaia/dummy_identity_provider.h b/google_apis/gaia/dummy_identity_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..46d598d4a3afff708d9bae3754c510631f78fa8f
--- /dev/null
+++ b/google_apis/gaia/dummy_identity_provider.h
@@ -0,0 +1,38 @@
+// Copyright 2014 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.
+
+#ifndef GOOGLE_APIS_GAIA_DUMMY_IDENTITY_PROVIDER_H_
+#define GOOGLE_APIS_GAIA_DUMMY_IDENTITY_PROVIDER_H_
+
+#include "base/compiler_specific.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "google_apis/gaia/identity_provider.h"
+
+// GCMDriver depends on IdentityProvider as it was originally meant to work for
+// signed-in users only. This dependency is being removed. While it is still
+// present, DummyIdentityProvider will be used for the browser-global GCMDriver
+// instance. The DummyIdentityProvider never has any active user or tokens.
+// TODO(bartfab,jianli): Remove this class when GCMDriver no longer depends on
+// IdentityService.
+class DummyIdentityProvider : public IdentityProvider {
+ public:
+ DummyIdentityProvider();
+ virtual ~DummyIdentityProvider();
+
+ // IdentityProvider:
+ virtual std::string GetActiveUsername() OVERRIDE;
+ virtual std::string GetActiveAccountId() OVERRIDE;
+ virtual OAuth2TokenService* GetTokenService() OVERRIDE;
+ virtual bool RequestLogin() OVERRIDE;
+
+ private:
+ class DummyOAuth2TokenService;
+
+ scoped_ptr<DummyOAuth2TokenService> oauth2_token_service_;
+
+ DISALLOW_COPY_AND_ASSIGN(DummyIdentityProvider);
+};
+
+#endif // GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698