Chromium Code Reviews| Index: chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| index 5d8e95cc92354a4aad3fbf48def392ed1988d9ac..3d8024fbe608863876b60f31c99ea7923939db06 100644 |
| --- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| +++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
| @@ -10,6 +10,9 @@ |
| #include "base/compiler_specific.h" |
| #include "base/gtest_prod_util.h" |
|
dcheng
2012/08/20 19:10:01
#include "base/memory/scoped_ptr.h"
Pete Williamson
2012/08/20 20:53:05
Done.
|
| #include "chrome/browser/extensions/api/push_messaging/invalidation_handler_observer.h" |
| +#include "chrome/browser/extensions/api/push_messaging/obfuscated_gaia_id_fetcher.h" |
| +#include "chrome/browser/extensions/extension_function.h" |
| +#include "chrome/common/net/gaia/google_service_auth_error.h" |
| class Profile; |
| @@ -36,6 +39,31 @@ class PushMessagingEventRouter : public InvalidationHandlerObserver { |
| DISALLOW_COPY_AND_ASSIGN(PushMessagingEventRouter); |
| }; |
| +class PushMessagingGetChannelIdFunction |
| + : public AsyncExtensionFunction, public ObfuscatedGaiaIdFetcher::Delegate{ |
|
dcheng
2012/08/20 19:10:01
Indent two spaces. Missing space before {
Pete Williamson
2012/08/20 20:53:05
Added spaces
|
| + public: |
| + PushMessagingGetChannelIdFunction(); |
| + |
| + protected: |
| + virtual ~PushMessagingGetChannelIdFunction(); |
| + |
| + // ExtensionFunction: |
| + virtual bool RunImpl() OVERRIDE; |
| + DECLARE_EXTENSION_FUNCTION_NAME("experimental.pushMessaging.getChannelId"); |
| + |
| + private: |
| + void GetChannelIdOnIOThread(); |
| + void RespondOnUIThread(const std::string& gaiaId, const long status); |
| + void StartGaiaIdFetch(); |
| + virtual void OnObfuscatedGaiaIdFetchSuccess(const std::string& gaia_id) |
|
dcheng
2012/08/20 19:10:01
I'd add a comment here:
// ObfuscatedGiaiaIdFetche
Pete Williamson
2012/08/20 20:53:05
Done.
|
| + OVERRIDE; |
| + virtual void OnObfuscatedGaiaIdFetchFailure( |
| + const GoogleServiceAuthError& error) OVERRIDE; |
| + scoped_ptr<ObfuscatedGaiaIdFetcher> fetcher_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PushMessagingGetChannelIdFunction); |
| +}; |
| + |
| } // namespace extension |
| #endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |