| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } // namespace extensions | 46 } // namespace extensions |
| 47 | 47 |
| 48 namespace infobars { | 48 namespace infobars { |
| 49 class InfoBarDelegate; | 49 class InfoBarDelegate; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Displays all the UI around extension installation. | 52 // Displays all the UI around extension installation. |
| 53 class ExtensionInstallPrompt | 53 class ExtensionInstallPrompt |
| 54 : public base::SupportsWeakPtr<ExtensionInstallPrompt> { | 54 : public base::SupportsWeakPtr<ExtensionInstallPrompt> { |
| 55 public: | 55 public: |
| 56 // A setting to cause extension/app installs from the webstore skip the normal |
| 57 // confirmation dialog. This should only be used in tests. |
| 58 enum AutoConfirmForTests { |
| 59 NONE, // The prompt will show normally. |
| 60 ACCEPT, // The prompt will always accept. |
| 61 CANCEL, // The prompt will always cancel. |
| 62 }; |
| 63 static AutoConfirmForTests g_auto_confirm_for_tests; |
| 64 |
| 56 // This enum is associated with Extensions.InstallPrompt_Type UMA histogram. | 65 // This enum is associated with Extensions.InstallPrompt_Type UMA histogram. |
| 57 // Do not modify existing values and add new values only to the end. | 66 // Do not modify existing values and add new values only to the end. |
| 58 enum PromptType { | 67 enum PromptType { |
| 59 UNSET_PROMPT_TYPE = -1, | 68 UNSET_PROMPT_TYPE = -1, |
| 60 INSTALL_PROMPT = 0, | 69 INSTALL_PROMPT = 0, |
| 61 INLINE_INSTALL_PROMPT, | 70 INLINE_INSTALL_PROMPT, |
| 62 BUNDLE_INSTALL_PROMPT, | 71 BUNDLE_INSTALL_PROMPT, |
| 63 RE_ENABLE_PROMPT, | 72 RE_ENABLE_PROMPT, |
| 64 PERMISSIONS_PROMPT, | 73 PERMISSIONS_PROMPT, |
| 65 EXTERNAL_INSTALL_PROMPT, | 74 EXTERNAL_INSTALL_PROMPT, |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 Delegate* delegate_; | 412 Delegate* delegate_; |
| 404 | 413 |
| 405 // A pre-filled prompt. | 414 // A pre-filled prompt. |
| 406 scoped_refptr<Prompt> prompt_; | 415 scoped_refptr<Prompt> prompt_; |
| 407 | 416 |
| 408 // Used to show the confirm dialog. | 417 // Used to show the confirm dialog. |
| 409 ShowDialogCallback show_dialog_callback_; | 418 ShowDialogCallback show_dialog_callback_; |
| 410 }; | 419 }; |
| 411 | 420 |
| 412 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ | 421 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_PROMPT_H_ |
| OLD | NEW |