| 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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 } | 921 } |
| 922 | 922 |
| 923 if (permissions_to_display.get() && | 923 if (permissions_to_display.get() && |
| 924 (!extension_ || | 924 (!extension_ || |
| 925 !extensions::PermissionsData::ShouldSkipPermissionWarnings( | 925 !extensions::PermissionsData::ShouldSkipPermissionWarnings( |
| 926 extension_->id()))) { | 926 extension_->id()))) { |
| 927 Manifest::Type type = | 927 Manifest::Type type = |
| 928 extension_ ? extension_->GetType() : Manifest::TYPE_UNKNOWN; | 928 extension_ ? extension_->GetType() : Manifest::TYPE_UNKNOWN; |
| 929 const extensions::PermissionMessageProvider* message_provider = | 929 const extensions::PermissionMessageProvider* message_provider = |
| 930 extensions::PermissionMessageProvider::Get(); | 930 extensions::PermissionMessageProvider::Get(); |
| 931 prompt_->SetPermissions(message_provider->GetWarningMessages( | 931 prompt_->SetPermissions(message_provider->GetLegacyWarningMessages( |
| 932 permissions_to_display.get(), type), | 932 permissions_to_display.get(), type), |
| 933 REGULAR_PERMISSIONS); | 933 REGULAR_PERMISSIONS); |
| 934 prompt_->SetPermissionsDetails(message_provider->GetWarningMessagesDetails( | 934 prompt_->SetPermissionsDetails( |
| 935 permissions_to_display.get(), type), | 935 message_provider->GetLegacyWarningMessagesDetails( |
| 936 REGULAR_PERMISSIONS); | 936 permissions_to_display.get(), type), |
| 937 REGULAR_PERMISSIONS); |
| 937 | 938 |
| 938 scoped_refptr<const extensions::PermissionSet> withheld = | 939 scoped_refptr<const extensions::PermissionSet> withheld = |
| 939 extension_->permissions_data()->withheld_permissions(); | 940 extension_->permissions_data()->withheld_permissions(); |
| 940 if (!withheld->IsEmpty()) { | 941 if (!withheld->IsEmpty()) { |
| 941 prompt_->SetPermissions( | 942 prompt_->SetPermissions( |
| 942 message_provider->GetWarningMessages(withheld.get(), type), | 943 message_provider->GetLegacyWarningMessages(withheld.get(), type), |
| 943 PermissionsType::WITHHELD_PERMISSIONS); | 944 PermissionsType::WITHHELD_PERMISSIONS); |
| 944 prompt_->SetPermissionsDetails( | 945 prompt_->SetPermissionsDetails( |
| 945 message_provider->GetWarningMessagesDetails(withheld.get(), type), | 946 message_provider->GetLegacyWarningMessagesDetails(withheld.get(), |
| 947 type), |
| 946 PermissionsType::WITHHELD_PERMISSIONS); | 948 PermissionsType::WITHHELD_PERMISSIONS); |
| 947 } | 949 } |
| 948 } | 950 } |
| 949 | 951 |
| 950 switch (prompt_->type()) { | 952 switch (prompt_->type()) { |
| 951 case PERMISSIONS_PROMPT: | 953 case PERMISSIONS_PROMPT: |
| 952 case RE_ENABLE_PROMPT: | 954 case RE_ENABLE_PROMPT: |
| 953 case INLINE_INSTALL_PROMPT: | 955 case INLINE_INSTALL_PROMPT: |
| 954 case EXTERNAL_INSTALL_PROMPT: | 956 case EXTERNAL_INSTALL_PROMPT: |
| 955 case INSTALL_PROMPT: | 957 case INSTALL_PROMPT: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 980 if (show_params_->WasParentDestroyed()) { | 982 if (show_params_->WasParentDestroyed()) { |
| 981 delegate_->InstallUIAbort(false); | 983 delegate_->InstallUIAbort(false); |
| 982 return; | 984 return; |
| 983 } | 985 } |
| 984 | 986 |
| 985 if (show_dialog_callback_.is_null()) | 987 if (show_dialog_callback_.is_null()) |
| 986 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); | 988 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); |
| 987 else | 989 else |
| 988 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); | 990 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); |
| 989 } | 991 } |
| OLD | NEW |