Chromium Code Reviews| 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..9670d8b51771d571bff87c198bad2704ae045803 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,10 @@ 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)) { |
| binding_.set_connection_error_handler(std::move(on_connection_closed)); |
| } |
| @@ -25,9 +32,15 @@ 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); |
| + } |
| + } |
| + |
| + std::move(on_prompt_user_) |
| + .Run(std::move(files_to_delete), std::move(callback)); |
|
Joe Mason
2017/05/19 22:02:26
Need to check if on_prompt_user_ is still valid he
alito
2017/05/22 23:26:31
Good catch! Done.
|
| } |
| } // namespace safe_browsing |