| 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 const extensions::PermissionMessageProvider* message_provider = | 935 const extensions::PermissionMessageProvider* message_provider = |
| 936 extensions::PermissionMessageProvider::Get(); | 936 extensions::PermissionMessageProvider::Get(); |
| 937 prompt_->SetPermissions(message_provider->GetWarningMessages( | 937 prompt_->SetPermissions(message_provider->GetWarningMessages( |
| 938 permissions_to_display.get(), type), | 938 permissions_to_display.get(), type), |
| 939 REGULAR_PERMISSIONS); | 939 REGULAR_PERMISSIONS); |
| 940 prompt_->SetPermissionsDetails(message_provider->GetWarningMessagesDetails( | 940 prompt_->SetPermissionsDetails(message_provider->GetWarningMessagesDetails( |
| 941 permissions_to_display.get(), type), | 941 permissions_to_display.get(), type), |
| 942 REGULAR_PERMISSIONS); | 942 REGULAR_PERMISSIONS); |
| 943 | 943 |
| 944 scoped_refptr<const extensions::PermissionSet> withheld = | 944 scoped_refptr<const extensions::PermissionSet> withheld = |
| 945 extension_->permissions_data()->withheld_permissions(); | 945 extension_ ? extension_->permissions_data()->withheld_permissions() |
| 946 if (!withheld->IsEmpty()) { | 946 : nullptr; |
| 947 if (withheld && !withheld->IsEmpty()) { |
| 947 prompt_->SetPermissions( | 948 prompt_->SetPermissions( |
| 948 message_provider->GetWarningMessages(withheld.get(), type), | 949 message_provider->GetWarningMessages(withheld.get(), type), |
| 949 PermissionsType::WITHHELD_PERMISSIONS); | 950 PermissionsType::WITHHELD_PERMISSIONS); |
| 950 prompt_->SetPermissionsDetails( | 951 prompt_->SetPermissionsDetails( |
| 951 message_provider->GetWarningMessagesDetails(withheld.get(), type), | 952 message_provider->GetWarningMessagesDetails(withheld.get(), type), |
| 952 PermissionsType::WITHHELD_PERMISSIONS); | 953 PermissionsType::WITHHELD_PERMISSIONS); |
| 953 } | 954 } |
| 954 } | 955 } |
| 955 | 956 |
| 956 switch (prompt_->type()) { | 957 switch (prompt_->type()) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 986 if (show_params_->WasParentDestroyed()) { | 987 if (show_params_->WasParentDestroyed()) { |
| 987 delegate_->InstallUIAbort(false); | 988 delegate_->InstallUIAbort(false); |
| 988 return; | 989 return; |
| 989 } | 990 } |
| 990 | 991 |
| 991 if (show_dialog_callback_.is_null()) | 992 if (show_dialog_callback_.is_null()) |
| 992 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); | 993 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); |
| 993 else | 994 else |
| 994 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); | 995 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); |
| 995 } | 996 } |
| OLD | NEW |