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

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: CR changes per Munjal and 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..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__

Powered by Google App Engine
This is Rietveld 408576698