| 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 #include "chrome/browser/extensions/extension_install_prompt.h" | 5 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 show_dialog_callback_ = show_dialog_callback; | 730 show_dialog_callback_ = show_dialog_callback; |
| 731 | 731 |
| 732 // We special-case themes to not show any confirm UI. Instead they are | 732 // We special-case themes to not show any confirm UI. Instead they are |
| 733 // immediately installed, and then we show an infobar (see OnInstallSuccess) | 733 // immediately installed, and then we show an infobar (see OnInstallSuccess) |
| 734 // to allow the user to revert if they don't like it. | 734 // to allow the user to revert if they don't like it. |
| 735 // | 735 // |
| 736 // We don't do this in the case where off-store extension installs are | 736 // We don't do this in the case where off-store extension installs are |
| 737 // disabled because in that case, we don't show the dangerous download UI, so | 737 // disabled because in that case, we don't show the dangerous download UI, so |
| 738 // we need the UI confirmation. | 738 // we need the UI confirmation. |
| 739 if (extension->is_theme()) { | 739 if (extension->is_theme()) { |
| 740 if (extension->from_webstore() || | 740 if (extension->from_webstore()) { |
| 741 extensions::FeatureSwitch::easy_off_store_install()->IsEnabled()) { | |
| 742 delegate->InstallUIProceed(); | 741 delegate->InstallUIProceed(); |
| 743 return; | 742 return; |
| 744 } | 743 } |
| 745 } | 744 } |
| 746 | 745 |
| 747 LoadImageIfNeeded(); | 746 LoadImageIfNeeded(); |
| 748 } | 747 } |
| 749 | 748 |
| 750 void ExtensionInstallPrompt::ConfirmReEnable(Delegate* delegate, | 749 void ExtensionInstallPrompt::ConfirmReEnable(Delegate* delegate, |
| 751 const Extension* extension) { | 750 const Extension* extension) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 } | 943 } |
| 945 | 944 |
| 946 if (AutoConfirmPrompt(delegate_)) | 945 if (AutoConfirmPrompt(delegate_)) |
| 947 return; | 946 return; |
| 948 | 947 |
| 949 if (show_dialog_callback_.is_null()) | 948 if (show_dialog_callback_.is_null()) |
| 950 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); | 949 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); |
| 951 else | 950 else |
| 952 show_dialog_callback_.Run(show_params_, delegate_, prompt_); | 951 show_dialog_callback_.Run(show_params_, delegate_, prompt_); |
| 953 } | 952 } |
| OLD | NEW |