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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 extensions::PermissionMessageProvider::Get(); | 930 extensions::PermissionMessageProvider::Get(); |
931 prompt_->SetPermissions(message_provider->GetLegacyWarningMessages( | 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( | 934 prompt_->SetPermissionsDetails( |
935 message_provider->GetLegacyWarningMessagesDetails( | 935 message_provider->GetLegacyWarningMessagesDetails( |
936 permissions_to_display.get(), type), | 936 permissions_to_display.get(), type), |
937 REGULAR_PERMISSIONS); | 937 REGULAR_PERMISSIONS); |
938 | 938 |
939 scoped_refptr<const extensions::PermissionSet> withheld = | 939 scoped_refptr<const extensions::PermissionSet> withheld = |
940 extension_->permissions_data()->withheld_permissions(); | 940 extension_ ? extension_->permissions_data()->withheld_permissions() |
941 if (!withheld->IsEmpty()) { | 941 : nullptr; |
| 942 if (withheld && !withheld->IsEmpty()) { |
942 prompt_->SetPermissions( | 943 prompt_->SetPermissions( |
943 message_provider->GetLegacyWarningMessages(withheld.get(), type), | 944 message_provider->GetLegacyWarningMessages(withheld.get(), type), |
944 PermissionsType::WITHHELD_PERMISSIONS); | 945 PermissionsType::WITHHELD_PERMISSIONS); |
945 prompt_->SetPermissionsDetails( | 946 prompt_->SetPermissionsDetails( |
946 message_provider->GetLegacyWarningMessagesDetails(withheld.get(), | 947 message_provider->GetLegacyWarningMessagesDetails(withheld.get(), |
947 type), | 948 type), |
948 PermissionsType::WITHHELD_PERMISSIONS); | 949 PermissionsType::WITHHELD_PERMISSIONS); |
949 } | 950 } |
950 } | 951 } |
951 | 952 |
(...skipping 30 matching lines...) Expand all Loading... |
982 if (show_params_->WasParentDestroyed()) { | 983 if (show_params_->WasParentDestroyed()) { |
983 delegate_->InstallUIAbort(false); | 984 delegate_->InstallUIAbort(false); |
984 return; | 985 return; |
985 } | 986 } |
986 | 987 |
987 if (show_dialog_callback_.is_null()) | 988 if (show_dialog_callback_.is_null()) |
988 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); | 989 GetDefaultShowDialogCallback().Run(show_params_.get(), delegate_, prompt_); |
989 else | 990 else |
990 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); | 991 show_dialog_callback_.Run(show_params_.get(), delegate_, prompt_); |
991 } | 992 } |
OLD | NEW |