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

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

Issue 2932703006: Chrome Cleaner: Remove indirect base::FilePath mojo dependency. (Closed)
Patch Set: Created 3 years, 6 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 826657780c9f28dcd187bb542f3c39cc23389da6..94782ca307f993fa93be1648ddf24fa7df2d6712 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
@@ -14,6 +14,14 @@
namespace safe_browsing {
+namespace {
+
+base::FilePath CastUInt16ToFilePath(const uint16_t* string) {
+ return base::FilePath(reinterpret_cast<const wchar_t*>(string));
+}
+
+} // namespace
+
using chrome_cleaner::mojom::ChromePrompt;
using chrome_cleaner::mojom::ChromePromptRequest;
using chrome_cleaner::mojom::PromptAcceptance;
@@ -34,12 +42,19 @@ ChromePromptImpl::~ChromePromptImpl() {
}
void ChromePromptImpl::PromptUser(
- const std::vector<base::FilePath>& files_to_delete,
+ std::vector<chrome_cleaner::mojom::FilePathPtr> files_to_delete,
ChromePrompt::PromptUserCallback callback) {
+ std::vector<base::FilePath> file_paths;
Fabio Tirelo 2017/06/12 14:04:50 Instead of creating this vector to later copy all
proberge 2017/06/12 17:49:30 Done.
+ for (const chrome_cleaner::mojom::FilePathPtr& file_path_ptr :
+ files_to_delete) {
Fabio Tirelo 2017/06/12 14:04:50 Please move this to inside the conditional in line
proberge 2017/06/12 17:49:30 Done.
+ file_paths.push_back(
+ CastUInt16ToFilePath(file_path_ptr.get()->value.data()));
+ }
+
if (on_prompt_user_) {
std::move(on_prompt_user_)
- .Run(base::MakeUnique<std::set<base::FilePath>>(files_to_delete.begin(),
- files_to_delete.end()),
+ .Run(base::MakeUnique<std::set<base::FilePath>>(file_paths.begin(),
+ file_paths.end()),
std::move(callback));
}
}

Powered by Google App Engine
This is Rietveld 408576698