| 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 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/common/extensions/feature_switch.h" | 29 #include "chrome/common/extensions/feature_switch.h" |
| 30 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 30 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 31 #include "chrome/common/extensions/permissions/permission_set.h" | 31 #include "chrome/common/extensions/permissions/permission_set.h" |
| 32 #include "chrome/common/extensions/permissions/permissions_data.h" | 32 #include "chrome/common/extensions/permissions/permissions_data.h" |
| 33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
| 34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/browser/web_contents_view.h" | 35 #include "content/public/browser/web_contents_view.h" |
| 36 #include "extensions/common/extension_resource.h" | 36 #include "extensions/common/extension_resource.h" |
| 37 #include "extensions/common/manifest.h" | 37 #include "extensions/common/manifest.h" |
| 38 #include "extensions/common/manifest_constants.h" | 38 #include "extensions/common/manifest_constants.h" |
| 39 #include "extensions/common/permissions/permission_message_provider.h" |
| 39 #include "extensions/common/url_pattern.h" | 40 #include "extensions/common/url_pattern.h" |
| 40 #include "grit/chromium_strings.h" | 41 #include "grit/chromium_strings.h" |
| 41 #include "grit/generated_resources.h" | 42 #include "grit/generated_resources.h" |
| 42 #include "grit/theme_resources.h" | 43 #include "grit/theme_resources.h" |
| 43 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
| 44 #include "ui/base/resource/resource_bundle.h" | 45 #include "ui/base/resource/resource_bundle.h" |
| 45 #include "ui/gfx/image/image.h" | 46 #include "ui/gfx/image/image.h" |
| 46 | 47 |
| 47 using extensions::BundleInstaller; | 48 using extensions::BundleInstaller; |
| 48 using extensions::Extension; | 49 using extensions::Extension; |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 } | 799 } |
| 799 | 800 |
| 800 void ExtensionInstallPrompt::ShowConfirmation() { | 801 void ExtensionInstallPrompt::ShowConfirmation() { |
| 801 if (permissions_.get() && | 802 if (permissions_.get() && |
| 802 (!extension_ || | 803 (!extension_ || |
| 803 !extensions::PermissionsData::ShouldSkipPermissionWarnings( | 804 !extensions::PermissionsData::ShouldSkipPermissionWarnings( |
| 804 extension_))) { | 805 extension_))) { |
| 805 Manifest::Type extension_type = extension_ ? | 806 Manifest::Type extension_type = extension_ ? |
| 806 extension_->GetType() : Manifest::TYPE_UNKNOWN; | 807 extension_->GetType() : Manifest::TYPE_UNKNOWN; |
| 807 prompt_.SetPermissions( | 808 prompt_.SetPermissions( |
| 808 permissions_->GetWarningMessages(extension_type)); | 809 extensions::PermissionMessageProvider::Get(extension_type)-> |
| 810 GetWarningMessages(permissions_)); |
| 809 prompt_.SetPermissionsDetails( | 811 prompt_.SetPermissionsDetails( |
| 810 permissions_->GetWarningMessagesDetails(extension_type)); | 812 extensions::PermissionMessageProvider::Get(extension_type)-> |
| 813 GetWarningMessagesDetails(permissions_)); |
| 811 } | 814 } |
| 812 | 815 |
| 813 switch (prompt_.type()) { | 816 switch (prompt_.type()) { |
| 814 case PERMISSIONS_PROMPT: | 817 case PERMISSIONS_PROMPT: |
| 815 case RE_ENABLE_PROMPT: | 818 case RE_ENABLE_PROMPT: |
| 816 case DEFAULT_INSTALL_FIRST_RUN_PROMPT: | 819 case DEFAULT_INSTALL_FIRST_RUN_PROMPT: |
| 817 case INLINE_INSTALL_PROMPT: | 820 case INLINE_INSTALL_PROMPT: |
| 818 case EXTERNAL_INSTALL_PROMPT: | 821 case EXTERNAL_INSTALL_PROMPT: |
| 819 case INSTALL_PROMPT: | 822 case INSTALL_PROMPT: |
| 820 case POST_INSTALL_PERMISSIONS_PROMPT: { | 823 case POST_INSTALL_PERMISSIONS_PROMPT: { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 832 } | 835 } |
| 833 | 836 |
| 834 if (AutoConfirmPrompt(delegate_)) | 837 if (AutoConfirmPrompt(delegate_)) |
| 835 return; | 838 return; |
| 836 | 839 |
| 837 if (show_dialog_callback_.is_null()) | 840 if (show_dialog_callback_.is_null()) |
| 838 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); | 841 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); |
| 839 else | 842 else |
| 840 show_dialog_callback_.Run(show_params_, delegate_, prompt_); | 843 show_dialog_callback_.Run(show_params_, delegate_, prompt_); |
| 841 } | 844 } |
| OLD | NEW |