Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3959)

Unified Diff: chrome/browser/safe_browsing/chrome_cleaner/srt_chrome_prompt_impl.cc

Issue 2890023005: Chrome Cleaner UI: reporter no longer uses mojo. (Closed)
Patch Set: Nits Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bf936a4eb1715e855b8bfa9c3c13488d75a48f78 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,16 @@ 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) {
+ files_to_delete->insert(uws_ptr->files_to_delete.begin(),
+ uws_ptr->files_to_delete.end());
+ }
+
+ if (on_prompt_user_) {
+ std::move(on_prompt_user_)
+ .Run(std::move(files_to_delete), std::move(callback));
+ }
}
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698