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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 images_list, | 701 images_list, |
702 base::Bind(&ExtensionInstallPrompt::OnImageLoaded, AsWeakPtr())); | 702 base::Bind(&ExtensionInstallPrompt::OnImageLoaded, AsWeakPtr())); |
703 } | 703 } |
704 | 704 |
705 void ExtensionInstallPrompt::ShowConfirmation() { | 705 void ExtensionInstallPrompt::ShowConfirmation() { |
706 if (prompt_.type() == INSTALL_PROMPT) | 706 if (prompt_.type() == INSTALL_PROMPT) |
707 prompt_.set_experiment(ExtensionInstallPromptExperiment::Find()); | 707 prompt_.set_experiment(ExtensionInstallPromptExperiment::Find()); |
708 else | 708 else |
709 prompt_.set_experiment(ExtensionInstallPromptExperiment::ControlGroup()); | 709 prompt_.set_experiment(ExtensionInstallPromptExperiment::ControlGroup()); |
710 | 710 |
711 if (permissions_.get() && | 711 if (permissions_.get()) { |
712 (!extension_ || | 712 if (extension_) { |
713 !extensions::PermissionsData::ShouldSkipPermissionWarnings( | 713 const extensions::PermissionsData* permissions_data = |
714 extension_))) { | 714 extensions::PermissionsData::ForExtension(extension_); |
715 Manifest::Type extension_type = extension_ ? | 715 prompt_.SetPermissions(permissions_data->GetPermissionMessageStrings()); |
716 extension_->GetType() : Manifest::TYPE_UNKNOWN; | 716 prompt_.SetPermissionsDetails( |
717 prompt_.SetPermissions( | 717 permissions_data->GetPermissionMessageDetailsStrings()); |
718 extensions::PermissionMessageProvider::Get()-> | 718 } else { |
719 GetWarningMessages(permissions_, extension_type)); | 719 const extensions::PermissionMessageProvider* message_provider = |
720 prompt_.SetPermissionsDetails( | 720 extensions::PermissionMessageProvider::Get(); |
721 extensions::PermissionMessageProvider::Get()-> | 721 prompt_.SetPermissions(message_provider->GetWarningMessages( |
722 GetWarningMessagesDetails(permissions_, extension_type)); | 722 permissions_, Manifest::TYPE_UNKNOWN)); |
| 723 prompt_.SetPermissionsDetails(message_provider->GetWarningMessagesDetails( |
| 724 permissions_, Manifest::TYPE_UNKNOWN)); |
| 725 } |
723 } | 726 } |
724 | 727 |
725 switch (prompt_.type()) { | 728 switch (prompt_.type()) { |
726 case PERMISSIONS_PROMPT: | 729 case PERMISSIONS_PROMPT: |
727 case RE_ENABLE_PROMPT: | 730 case RE_ENABLE_PROMPT: |
728 case INLINE_INSTALL_PROMPT: | 731 case INLINE_INSTALL_PROMPT: |
729 case EXTERNAL_INSTALL_PROMPT: | 732 case EXTERNAL_INSTALL_PROMPT: |
730 case INSTALL_PROMPT: | 733 case INSTALL_PROMPT: |
731 case LAUNCH_PROMPT: | 734 case LAUNCH_PROMPT: |
732 case POST_INSTALL_PERMISSIONS_PROMPT: | 735 case POST_INSTALL_PERMISSIONS_PROMPT: |
(...skipping 12 matching lines...) Expand all Loading... |
745 } | 748 } |
746 | 749 |
747 if (AutoConfirmPrompt(delegate_)) | 750 if (AutoConfirmPrompt(delegate_)) |
748 return; | 751 return; |
749 | 752 |
750 if (show_dialog_callback_.is_null()) | 753 if (show_dialog_callback_.is_null()) |
751 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); | 754 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); |
752 else | 755 else |
753 show_dialog_callback_.Run(show_params_, delegate_, prompt_); | 756 show_dialog_callback_.Run(show_params_, delegate_, prompt_); |
754 } | 757 } |
OLD | NEW |