| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 public: | 50 public: |
| 51 enum PromptType { | 51 enum PromptType { |
| 52 UNSET_PROMPT_TYPE = -1, | 52 UNSET_PROMPT_TYPE = -1, |
| 53 INSTALL_PROMPT = 0, | 53 INSTALL_PROMPT = 0, |
| 54 INLINE_INSTALL_PROMPT, | 54 INLINE_INSTALL_PROMPT, |
| 55 BUNDLE_INSTALL_PROMPT, | 55 BUNDLE_INSTALL_PROMPT, |
| 56 RE_ENABLE_PROMPT, | 56 RE_ENABLE_PROMPT, |
| 57 PERMISSIONS_PROMPT, | 57 PERMISSIONS_PROMPT, |
| 58 EXTERNAL_INSTALL_PROMPT, | 58 EXTERNAL_INSTALL_PROMPT, |
| 59 POST_INSTALL_PERMISSIONS_PROMPT, | 59 POST_INSTALL_PERMISSIONS_PROMPT, |
| 60 UPDATE_PROMPT, |
| 60 NUM_PROMPT_TYPES | 61 NUM_PROMPT_TYPES |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 // Extra information needed to display an installation or uninstallation | 64 // Extra information needed to display an installation or uninstallation |
| 64 // prompt. Gets populated with raw data and exposes getters for formatted | 65 // prompt. Gets populated with raw data and exposes getters for formatted |
| 65 // strings so that the GTK/views/Cocoa install dialogs don't have to repeat | 66 // strings so that the GTK/views/Cocoa install dialogs don't have to repeat |
| 66 // that logic. | 67 // that logic. |
| 67 class Prompt { | 68 class Prompt { |
| 68 public: | 69 public: |
| 69 explicit Prompt(PromptType type); | 70 explicit Prompt(PromptType type); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 const extensions::Extension* extension, | 284 const extensions::Extension* extension, |
| 284 const IssueAdviceInfo& issue_advice); | 285 const IssueAdviceInfo& issue_advice); |
| 285 | 286 |
| 286 // This is called by the app handler launcher to review what permissions the | 287 // This is called by the app handler launcher to review what permissions the |
| 287 // extension or app currently has. | 288 // extension or app currently has. |
| 288 // | 289 // |
| 289 // This *WILL* call Abort() on |delegate|. | 290 // This *WILL* call Abort() on |delegate|. |
| 290 virtual void ReviewPermissions(Delegate* delegate, | 291 virtual void ReviewPermissions(Delegate* delegate, |
| 291 const extensions::Extension* extension); | 292 const extensions::Extension* extension); |
| 292 | 293 |
| 294 // This is called by the installer to verify whether the update should |
| 295 // proceed. |
| 296 // |
| 297 // We *MUST* eventually call either Proceed() or Abort() on |delegate|. |
| 298 virtual void ConfirmUpdate(Delegate* delegate, |
| 299 const extensions::Extension* extension); |
| 300 |
| 293 // Installation was successful. This is declared virtual for testing. | 301 // Installation was successful. This is declared virtual for testing. |
| 294 virtual void OnInstallSuccess(const extensions::Extension* extension, | 302 virtual void OnInstallSuccess(const extensions::Extension* extension, |
| 295 SkBitmap* icon); | 303 SkBitmap* icon); |
| 296 | 304 |
| 297 // Installation failed. This is declared virtual for testing. | 305 // Installation failed. This is declared virtual for testing. |
| 298 virtual void OnInstallFailure(const extensions::CrxInstallerError& error); | 306 virtual void OnInstallFailure(const extensions::CrxInstallerError& error); |
| 299 | 307 |
| 300 protected: | 308 protected: |
| 301 friend class extensions::ExtensionWebstorePrivateApiTest; | 309 friend class extensions::ExtensionWebstorePrivateApiTest; |
| 302 friend class extensions::MockGetAuthTokenFunction; | 310 friend class extensions::MockGetAuthTokenFunction; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 // A pre-filled prompt. | 367 // A pre-filled prompt. |
| 360 Prompt prompt_; | 368 Prompt prompt_; |
| 361 | 369 |
| 362 scoped_ptr<OAuth2MintTokenFlow> token_flow_; | 370 scoped_ptr<OAuth2MintTokenFlow> token_flow_; |
| 363 | 371 |
| 364 // Used to show the confirm dialog. | 372 // Used to show the confirm dialog. |
| 365 ShowDialogCallback show_dialog_callback_; | 373 ShowDialogCallback show_dialog_callback_; |
| 366 }; | 374 }; |
| 367 | 375 |
| 368 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 376 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| OLD | NEW |