Commit 3d494500 authored by Jesse Schettler's avatar Jesse Schettler Committed by Commit Bot

scanning: Remove TODO and combine if statements

The default scan-to path is the active user's My files folder. Remove
the TODO that states the check for this path should be removed and
combine the various checks into a single if statement.

Bug: 1059779
Change-Id: I1ad09b67e5fd7d80a6fe711bec22673a43d3eb43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2510860Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823294}
parent 093a29f9
...@@ -22,8 +22,8 @@ namespace { ...@@ -22,8 +22,8 @@ namespace {
namespace mojo_ipc = scanning::mojom; namespace mojo_ipc = scanning::mojom;
// Path to the user's "My files" folder. // Path to the active user's "My files" folder.
constexpr char kMyFilesPath[] = "/home/chronos/user/MyFiles"; constexpr char kActiveUserMyFilesPath[] = "/home/chronos/user/MyFiles";
} // namespace } // namespace
...@@ -156,13 +156,11 @@ void ScanService::OnScanCompleted(ScanCallback callback, bool success) { ...@@ -156,13 +156,11 @@ void ScanService::OnScanCompleted(ScanCallback callback, bool success) {
} }
bool ScanService::FilePathSupported(const base::FilePath& file_path) { bool ScanService::FilePathSupported(const base::FilePath& file_path) {
// TODO(jschettler): Remove this check once the path is selected by the user. if (file_path == base::FilePath(kActiveUserMyFilesPath) ||
if (file_path == base::FilePath(kMyFilesPath)) file_path == my_files_path_ ||
return true; (!file_path.ReferencesParent() &&
(my_files_path_.IsParent(file_path) ||
if (!file_path.ReferencesParent() && google_drive_path_.IsParent(file_path)))) {
(file_path == my_files_path_ || my_files_path_.IsParent(file_path) ||
google_drive_path_.IsParent(file_path))) {
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment