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_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/extensions/bundle_installer.h" | 10 #include "chrome/browser/extensions/bundle_installer.h" |
11 #include "chrome/browser/extensions/chrome_extension_function.h" | 11 #include "chrome/browser/extensions/chrome_extension_function.h" |
12 #include "chrome/browser/extensions/extension_install_prompt.h" | 12 #include "chrome/browser/extensions/extension_install_prompt.h" |
13 #include "chrome/browser/extensions/webstore_install_helper.h" | 13 #include "chrome/browser/extensions/webstore_install_helper.h" |
14 #include "chrome/browser/extensions/webstore_installer.h" | 14 #include "chrome/browser/extensions/webstore_installer.h" |
| 15 #include "chrome/browser/signin/signin_manager_factory.h" |
15 #include "chrome/common/extensions/api/webstore_private.h" | 16 #include "chrome/common/extensions/api/webstore_private.h" |
16 #include "components/signin/core/browser/signin_tracker.h" | 17 #include "components/signin/core/browser/signin_tracker.h" |
17 #include "content/public/browser/gpu_data_manager_observer.h" | 18 #include "content/public/browser/gpu_data_manager_observer.h" |
18 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
20 #include "google_apis/gaia/google_service_auth_error.h" | 21 #include "google_apis/gaia/google_service_auth_error.h" |
21 #include "third_party/skia/include/core/SkBitmap.h" | 22 #include "third_party/skia/include/core/SkBitmap.h" |
22 | 23 |
23 class ProfileSyncService; | 24 class ProfileSyncService; |
| 25 class SigninManagerBase; |
24 | 26 |
25 namespace content { | 27 namespace content { |
26 class GpuDataManager; | 28 class GpuDataManager; |
27 } | 29 } |
28 | 30 |
29 class GPUFeatureChecker; | 31 class GPUFeatureChecker; |
30 | 32 |
31 namespace extensions { | 33 namespace extensions { |
32 | 34 |
33 class WebstorePrivateApi { | 35 class WebstorePrivateApi { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 299 |
298 WebstorePrivateIsInIncognitoModeFunction() {} | 300 WebstorePrivateIsInIncognitoModeFunction() {} |
299 | 301 |
300 protected: | 302 protected: |
301 virtual ~WebstorePrivateIsInIncognitoModeFunction() {} | 303 virtual ~WebstorePrivateIsInIncognitoModeFunction() {} |
302 | 304 |
303 // ExtensionFunction: | 305 // ExtensionFunction: |
304 virtual bool RunImpl() OVERRIDE; | 306 virtual bool RunImpl() OVERRIDE; |
305 }; | 307 }; |
306 | 308 |
| 309 class WebstorePrivateSignInFunction : public ChromeAsyncExtensionFunction, |
| 310 public SigninManagerFactory::Observer, |
| 311 public SigninTracker::Observer { |
| 312 public: |
| 313 DECLARE_EXTENSION_FUNCTION("webstorePrivate.signIn", |
| 314 WEBSTOREPRIVATE_SIGNINFUNCTION) |
| 315 |
| 316 WebstorePrivateSignInFunction(); |
| 317 |
| 318 protected: |
| 319 virtual ~WebstorePrivateSignInFunction(); |
| 320 |
| 321 // ExtensionFunction: |
| 322 virtual bool RunImpl() OVERRIDE; |
| 323 |
| 324 // SigninManagerFactory::Observer: |
| 325 virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE; |
| 326 |
| 327 // SigninTracker::Observer: |
| 328 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; |
| 329 virtual void SigninSuccess() OVERRIDE; |
| 330 virtual void MergeSessionComplete(const GoogleServiceAuthError& error) |
| 331 OVERRIDE; |
| 332 |
| 333 private: |
| 334 // The sign-in manager for the invoking tab's Chrome Profile. Weak reference. |
| 335 SigninManagerBase* signin_manager_; |
| 336 |
| 337 // Tracks changes to sign-in state. Used to notify the page when an existing |
| 338 // in-progress sign-in completes, either with success or failure. |
| 339 scoped_ptr<SigninTracker> signin_tracker_; |
| 340 }; |
| 341 |
307 } // namespace extensions | 342 } // namespace extensions |
308 | 343 |
309 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H
_ | 344 #endif // CHROME_BROWSER_EXTENSIONS_API_WEBSTORE_PRIVATE_WEBSTORE_PRIVATE_API_H
_ |
OLD | NEW |