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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 ExtensionInstallPrompt::Prompt::~Prompt() { | 160 ExtensionInstallPrompt::Prompt::~Prompt() { |
161 } | 161 } |
162 | 162 |
163 void ExtensionInstallPrompt::Prompt::SetPermissions( | 163 void ExtensionInstallPrompt::Prompt::SetPermissions( |
164 const PermissionMessages& permissions, | 164 const PermissionMessages& permissions, |
165 PermissionsType permissions_type) { | 165 PermissionsType permissions_type) { |
166 InstallPromptPermissions& install_permissions = | 166 InstallPromptPermissions& install_permissions = |
167 GetPermissionsForType(permissions_type); | 167 GetPermissionsForType(permissions_type); |
168 | 168 |
169 install_permissions.permissions.clear(); | |
170 install_permissions.details.clear(); | |
171 install_permissions.is_showing_details.clear(); | |
172 | |
173 for (const PermissionMessage& msg : permissions) { | 169 for (const PermissionMessage& msg : permissions) { |
174 install_permissions.permissions.push_back(msg.message()); | 170 install_permissions.permissions.push_back(msg.message()); |
175 // Add a dash to the front of each permission detail. | 171 // Add a dash to the front of each permission detail. |
176 base::string16 details; | 172 base::string16 details; |
177 if (!msg.submessages().empty()) { | 173 if (!msg.submessages().empty()) { |
178 std::vector<base::string16> detail_lines_with_bullets; | 174 std::vector<base::string16> detail_lines_with_bullets; |
179 for (const auto& detail_line : msg.submessages()) { | 175 for (const auto& detail_line : msg.submessages()) { |
180 detail_lines_with_bullets.push_back(base::ASCIIToUTF16("- ") + | 176 detail_lines_with_bullets.push_back(base::ASCIIToUTF16("- ") + |
181 detail_line); | 177 detail_line); |
182 } | 178 } |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 | 816 |
821 if (AutoConfirmPrompt(&done_callback_)) | 817 if (AutoConfirmPrompt(&done_callback_)) |
822 return; | 818 return; |
823 | 819 |
824 if (show_dialog_callback_.is_null()) | 820 if (show_dialog_callback_.is_null()) |
825 show_dialog_callback_ = GetDefaultShowDialogCallback(); | 821 show_dialog_callback_ = GetDefaultShowDialogCallback(); |
826 base::ResetAndReturn(&show_dialog_callback_) | 822 base::ResetAndReturn(&show_dialog_callback_) |
827 .Run(show_params_.get(), base::ResetAndReturn(&done_callback_), | 823 .Run(show_params_.get(), base::ResetAndReturn(&done_callback_), |
828 std::move(prompt_)); | 824 std::move(prompt_)); |
829 } | 825 } |
OLD | NEW |