| 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_EXTENSION_INSTALL_PROMPT_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| 34 class PageNavigator; | 34 class PageNavigator; |
| 35 class WebContents; | 35 class WebContents; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace extensions { | 38 namespace extensions { |
| 39 class BundleInstaller; | 39 class BundleInstaller; |
| 40 class Extension; | 40 class Extension; |
| 41 class ExtensionWebstorePrivateApiTest; | 41 class ExtensionWebstorePrivateApiTest; |
| 42 class MockGetAuthTokenFunction; |
| 42 class PermissionSet; | 43 class PermissionSet; |
| 43 } // namespace extensions | 44 } // namespace extensions |
| 44 | 45 |
| 45 // Displays all the UI around extension installation. | 46 // Displays all the UI around extension installation. |
| 46 class ExtensionInstallPrompt | 47 class ExtensionInstallPrompt |
| 47 : public OAuth2MintTokenFlow::Delegate, | 48 : public OAuth2MintTokenFlow::Delegate, |
| 48 public base::SupportsWeakPtr<ExtensionInstallPrompt> { | 49 public base::SupportsWeakPtr<ExtensionInstallPrompt> { |
| 49 public: | 50 public: |
| 50 enum PromptType { | 51 enum PromptType { |
| 51 UNSET_PROMPT_TYPE = -1, | 52 UNSET_PROMPT_TYPE = -1, |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 282 |
| 282 // Installation was successful. This is declared virtual for testing. | 283 // Installation was successful. This is declared virtual for testing. |
| 283 virtual void OnInstallSuccess(const extensions::Extension* extension, | 284 virtual void OnInstallSuccess(const extensions::Extension* extension, |
| 284 SkBitmap* icon); | 285 SkBitmap* icon); |
| 285 | 286 |
| 286 // Installation failed. This is declared virtual for testing. | 287 // Installation failed. This is declared virtual for testing. |
| 287 virtual void OnInstallFailure(const extensions::CrxInstallerError& error); | 288 virtual void OnInstallFailure(const extensions::CrxInstallerError& error); |
| 288 | 289 |
| 289 protected: | 290 protected: |
| 290 friend class extensions::ExtensionWebstorePrivateApiTest; | 291 friend class extensions::ExtensionWebstorePrivateApiTest; |
| 292 friend class extensions::MockGetAuthTokenFunction; |
| 291 friend class WebstoreStandaloneInstallUnpackFailureTest; | 293 friend class WebstoreStandaloneInstallUnpackFailureTest; |
| 292 friend class MockGetAuthTokenFunction; | |
| 293 | 294 |
| 294 // Whether or not we should record the oauth2 grant upon successful install. | 295 // Whether or not we should record the oauth2 grant upon successful install. |
| 295 bool record_oauth2_grant_; | 296 bool record_oauth2_grant_; |
| 296 | 297 |
| 297 private: | 298 private: |
| 298 friend class GalleryInstallApiTestObserver; | 299 friend class GalleryInstallApiTestObserver; |
| 299 | 300 |
| 300 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains | 301 // Sets the icon that will be used in any UI. If |icon| is NULL, or contains |
| 301 // an empty bitmap, then a default icon will be used instead. | 302 // an empty bitmap, then a default icon will be used instead. |
| 302 void SetIcon(const SkBitmap* icon); | 303 void SetIcon(const SkBitmap* icon); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // A pre-filled prompt. | 349 // A pre-filled prompt. |
| 349 Prompt prompt_; | 350 Prompt prompt_; |
| 350 | 351 |
| 351 scoped_ptr<OAuth2MintTokenFlow> token_flow_; | 352 scoped_ptr<OAuth2MintTokenFlow> token_flow_; |
| 352 | 353 |
| 353 // Used to show the confirm dialog. | 354 // Used to show the confirm dialog. |
| 354 ShowDialogCallback show_dialog_callback_; | 355 ShowDialogCallback show_dialog_callback_; |
| 355 }; | 356 }; |
| 356 | 357 |
| 357 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 358 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| OLD | NEW |