OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 class PromptBrowserLoginFunction : public AsyncExtensionFunction, | 141 class PromptBrowserLoginFunction : public AsyncExtensionFunction, |
142 public NotificationObserver, | 142 public NotificationObserver, |
143 public BrowserSignin::SigninDelegate { | 143 public BrowserSignin::SigninDelegate { |
144 public: | 144 public: |
145 PromptBrowserLoginFunction(); | 145 PromptBrowserLoginFunction(); |
146 // Implements BrowserSignin::SigninDelegate interface. | 146 // Implements BrowserSignin::SigninDelegate interface. |
147 virtual void OnLoginSuccess(); | 147 virtual void OnLoginSuccess(); |
148 virtual void OnLoginFailure(const GoogleServiceAuthError& error); | 148 virtual void OnLoginFailure(const GoogleServiceAuthError& error); |
149 | 149 |
150 // Implements the NotificationObserver interface. | 150 // Implements the NotificationObserver interface. |
151 virtual void Observe(NotificationType type, | 151 virtual void Observe(int type, |
152 const NotificationSource& source, | 152 const NotificationSource& source, |
153 const NotificationDetails& details); | 153 const NotificationDetails& details); |
154 | 154 |
155 protected: | 155 protected: |
156 virtual ~PromptBrowserLoginFunction(); | 156 virtual ~PromptBrowserLoginFunction(); |
157 virtual bool RunImpl(); | 157 virtual bool RunImpl(); |
158 | 158 |
159 private: | 159 private: |
160 // Creates the message for signing in. | 160 // Creates the message for signing in. |
161 virtual string16 GetLoginMessage(); | 161 virtual string16 GetLoginMessage(); |
162 | 162 |
163 // Are we waiting for a token available notification? | 163 // Are we waiting for a token available notification? |
164 bool waiting_for_token_; | 164 bool waiting_for_token_; |
165 | 165 |
166 // Used for listening for TokenService notifications. | 166 // Used for listening for TokenService notifications. |
167 NotificationRegistrar registrar_; | 167 NotificationRegistrar registrar_; |
168 | 168 |
169 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.promptBrowserLogin"); | 169 DECLARE_EXTENSION_FUNCTION_NAME("webstorePrivate.promptBrowserLogin"); |
170 }; | 170 }; |
171 | 171 |
172 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ | 172 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBSTORE_PRIVATE_API_H_ |
OLD | NEW |