| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } // namespace extensions | 45 } // namespace extensions |
| 46 | 46 |
| 47 namespace infobars { | 47 namespace infobars { |
| 48 class InfoBarDelegate; | 48 class InfoBarDelegate; |
| 49 } | 49 } |
| 50 | 50 |
| 51 // Displays all the UI around extension installation. | 51 // Displays all the UI around extension installation. |
| 52 class ExtensionInstallPrompt | 52 class ExtensionInstallPrompt |
| 53 : public base::SupportsWeakPtr<ExtensionInstallPrompt> { | 53 : public base::SupportsWeakPtr<ExtensionInstallPrompt> { |
| 54 public: | 54 public: |
| 55 // A setting to cause extension/app installs from the webstore skip the normal | |
| 56 // confirmation dialog. This should only be used in tests. | |
| 57 enum AutoConfirmForTests { | |
| 58 NONE, // The prompt will show normally. | |
| 59 ACCEPT, // The prompt will always accept. | |
| 60 CANCEL, // The prompt will always cancel. | |
| 61 }; | |
| 62 static AutoConfirmForTests g_auto_confirm_for_tests; | |
| 63 | |
| 64 // This enum is associated with Extensions.InstallPrompt_Type UMA histogram. | 55 // This enum is associated with Extensions.InstallPrompt_Type UMA histogram. |
| 65 // Do not modify existing values and add new values only to the end. | 56 // Do not modify existing values and add new values only to the end. |
| 66 enum PromptType { | 57 enum PromptType { |
| 67 UNSET_PROMPT_TYPE = -1, | 58 UNSET_PROMPT_TYPE = -1, |
| 68 INSTALL_PROMPT = 0, | 59 INSTALL_PROMPT = 0, |
| 69 INLINE_INSTALL_PROMPT, | 60 INLINE_INSTALL_PROMPT, |
| 70 BUNDLE_INSTALL_PROMPT, | 61 BUNDLE_INSTALL_PROMPT, |
| 71 RE_ENABLE_PROMPT, | 62 RE_ENABLE_PROMPT, |
| 72 PERMISSIONS_PROMPT, | 63 PERMISSIONS_PROMPT, |
| 73 EXTERNAL_INSTALL_PROMPT, | 64 EXTERNAL_INSTALL_PROMPT, |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 Delegate* delegate_; | 453 Delegate* delegate_; |
| 463 | 454 |
| 464 // A pre-filled prompt. | 455 // A pre-filled prompt. |
| 465 scoped_refptr<Prompt> prompt_; | 456 scoped_refptr<Prompt> prompt_; |
| 466 | 457 |
| 467 // Used to show the confirm dialog. | 458 // Used to show the confirm dialog. |
| 468 ShowDialogCallback show_dialog_callback_; | 459 ShowDialogCallback show_dialog_callback_; |
| 469 }; | 460 }; |
| 470 | 461 |
| 471 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 462 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| OLD | NEW |