Index: chrome/browser/safe_browsing/chrome_cleaner/srt_chrome_prompt_impl.cc |
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/srt_chrome_prompt_impl.cc b/chrome/browser/safe_browsing/chrome_cleaner/srt_chrome_prompt_impl.cc |
index 6d20cda9b8e431b4f828a840982e15937fcefec0..5cd4486cb42c131c7b989ab159895443d3d3cbfa 100644 |
--- a/chrome/browser/safe_browsing/chrome_cleaner/srt_chrome_prompt_impl.cc |
+++ b/chrome/browser/safe_browsing/chrome_cleaner/srt_chrome_prompt_impl.cc |
@@ -4,7 +4,12 @@ |
#include "chrome/browser/safe_browsing/chrome_cleaner/srt_chrome_prompt_impl.h" |
+#include <utility> |
+ |
+#include "base/location.h" |
#include "base/logging.h" |
+#include "base/memory/ptr_util.h" |
+#include "content/public/browser/browser_thread.h" |
namespace safe_browsing { |
@@ -15,8 +20,11 @@ using chrome_cleaner::mojom::PromptAcceptance; |
using chrome_cleaner::mojom::UwSPtr; |
ChromePromptImpl::ChromePromptImpl(ChromePromptRequest request, |
- base::Closure on_connection_closed) |
- : binding_(this, std::move(request)) { |
+ base::Closure on_connection_closed, |
+ OnPromptUser on_prompt_user) |
+ : binding_(this, std::move(request)), |
+ on_prompt_user_(std::move(on_prompt_user)) { |
+ DCHECK(on_prompt_user_); |
binding_.set_connection_error_handler(std::move(on_connection_closed)); |
} |
@@ -25,9 +33,17 @@ ChromePromptImpl::~ChromePromptImpl() {} |
void ChromePromptImpl::PromptUser(std::vector<UwSPtr> removable_uws_found, |
ElevationStatus elevation_status, |
ChromePrompt::PromptUserCallback callback) { |
- // Placeholder. The actual implementation will show the prompt dialog to the |
- // user and invoke this callback depending on the user's response. |
- std::move(callback).Run(PromptAcceptance::DENIED); |
+ auto files_to_delete = base::MakeUnique<std::set<base::FilePath>>(); |
+ for (const UwSPtr& uws_ptr : removable_uws_found) { |
+ for (const base::FilePath& filepath : uws_ptr->files_to_delete) { |
+ files_to_delete->insert(filepath); |
+ } |
+ } |
+ |
+ if (on_prompt_user_) { |
+ std::move(on_prompt_user_) |
+ .Run(std::move(files_to_delete), std::move(callback)); |
+ } |
} |
} // namespace safe_browsing |