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

Unified Diff: chrome/browser/extensions/api/push_messaging/push_messaging_api.h

Issue 10836182: Obfuscated Gaia ID fetcher (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: More CR changes per DCheng Created 8 years, 4 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/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..42b10246d555f059ffdb4a0e9e201d8cd6049df4 100644
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h
@@ -9,7 +9,11 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
#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 +40,30 @@ class PushMessagingEventRouter : public InvalidationHandlerObserver {
DISALLOW_COPY_AND_ASSIGN(PushMessagingEventRouter);
};
+class PushMessagingGetChannelIdFunction
+ : public AsyncExtensionFunction, public ObfuscatedGaiaIdFetcher::Delegate {
+ public:
+ PushMessagingGetChannelIdFunction();
+
+ protected:
+ virtual ~PushMessagingGetChannelIdFunction();
+
+ // ExtensionFunction:
+ virtual bool RunImpl() OVERRIDE;
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.pushMessaging.getChannelId");
+
+ private:
+ void ReportResult(const std::string& gaiaId, const long status);
+ // ObfuscatedGiaiaIdFetcher::Delegate implementation.
Mihai Parparita -not on Chrome 2012/08/22 21:40:45 Add a newline before this comment.
Pete Williamson 2012/08/23 17:20:50 Done.
+ virtual void OnObfuscatedGaiaIdFetchSuccess(const std::string& gaia_id)
+ 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__

Powered by Google App Engine
This is Rietveld 408576698