OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 public ObfuscatedGaiaIdFetcher::Delegate, | 59 public ObfuscatedGaiaIdFetcher::Delegate, |
60 public OAuth2TokenService::Observer, | 60 public OAuth2TokenService::Observer, |
61 public OAuth2TokenService::Consumer { | 61 public OAuth2TokenService::Consumer { |
62 public: | 62 public: |
63 PushMessagingGetChannelIdFunction(); | 63 PushMessagingGetChannelIdFunction(); |
64 | 64 |
65 protected: | 65 protected: |
66 virtual ~PushMessagingGetChannelIdFunction(); | 66 virtual ~PushMessagingGetChannelIdFunction(); |
67 | 67 |
68 // ExtensionFunction: | 68 // ExtensionFunction: |
69 virtual bool RunImpl() OVERRIDE; | 69 virtual bool RunAsync() OVERRIDE; |
70 DECLARE_EXTENSION_FUNCTION("pushMessaging.getChannelId", | 70 DECLARE_EXTENSION_FUNCTION("pushMessaging.getChannelId", |
71 PUSHMESSAGING_GETCHANNELID) | 71 PUSHMESSAGING_GETCHANNELID) |
72 | 72 |
73 private: | 73 private: |
74 void ReportResult(const std::string& gaia_id, | 74 void ReportResult(const std::string& gaia_id, |
75 const std::string& error_message); | 75 const std::string& error_message); |
76 | 76 |
77 void BuildAndSendResult(const std::string& gaia_id, | 77 void BuildAndSendResult(const std::string& gaia_id, |
78 const std::string& error_message); | 78 const std::string& error_message); |
79 | 79 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 DISALLOW_COPY_AND_ASSIGN(PushMessagingAPI); | 158 DISALLOW_COPY_AND_ASSIGN(PushMessagingAPI); |
159 }; | 159 }; |
160 | 160 |
161 template <> | 161 template <> |
162 void BrowserContextKeyedAPIFactory< | 162 void BrowserContextKeyedAPIFactory< |
163 PushMessagingAPI>::DeclareFactoryDependencies(); | 163 PushMessagingAPI>::DeclareFactoryDependencies(); |
164 | 164 |
165 } // namespace extensions | 165 } // namespace extensions |
166 | 166 |
167 #endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ | 167 #endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
OLD | NEW |