Chromium Code Reviews| Index: chrome/browser/extensions/api/identity/identity_api.h |
| =================================================================== |
| --- chrome/browser/extensions/api/identity/identity_api.h (revision 177049) |
| +++ chrome/browser/extensions/api/identity/identity_api.h (working copy) |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
|
sail
2013/01/18 16:17:01
don't update the copyright year on files you modif
|
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -10,6 +10,7 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "chrome/browser/extensions/api/identity/web_auth_flow.h" |
| +#include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
| #include "chrome/browser/extensions/app_notify_channel_setup.h" |
| #include "chrome/browser/extensions/extension_function.h" |
| #include "chrome/browser/extensions/extension_install_prompt.h" |
| @@ -19,6 +20,7 @@ |
| class GetAuthTokenFunctionTest; |
| class MockGetAuthTokenFunction; |
| class GoogleServiceAuthError; |
| +class Profile; |
| namespace extensions { |
| @@ -30,7 +32,7 @@ |
| extern const char kUserRejected[]; |
| extern const char kUserNotSignedIn[]; |
| extern const char kInvalidRedirect[]; |
| -} |
| +} // namespace identity_constants |
| class IdentityGetAuthTokenFunction : public AsyncExtensionFunction, |
| public OAuth2MintTokenFlow::Delegate, |
| @@ -45,8 +47,8 @@ |
| virtual ~IdentityGetAuthTokenFunction(); |
| private: |
| - friend class ::GetAuthTokenFunctionTest; |
| - friend class ::MockGetAuthTokenFunction; |
| + friend class GetAuthTokenFunctionTest; |
| + friend class MockGetAuthTokenFunction; |
| // ExtensionFunction: |
| virtual bool RunImpl() OVERRIDE; |
| @@ -110,6 +112,24 @@ |
| scoped_ptr<WebAuthFlow> auth_flow_; |
| }; |
| +class IdentityAPI : public ProfileKeyedAPI { |
| + public: |
| + explicit IdentityAPI(Profile* profile); |
| + virtual ~IdentityAPI(); |
| + |
| + // ProfileKeyedAPI implementation. |
| + static ProfileKeyedAPIFactory<IdentityAPI>* GetFactoryInstance(); |
| + |
| + private: |
| + friend class ProfileKeyedAPIFactory<IdentityAPI>; |
| + |
| + // ProfileKeyedAPI implementation. |
| + static const char* service_name() { |
| + return "IdentityAPI"; |
| + } |
| + static const bool kServiceIsNULLWhileTesting = true; |
| +}; |
| + |
| } // namespace extensions |
| #endif // CHROME_BROWSER_EXTENSIONS_API_IDENTITY_IDENTITY_API_H_ |