Commit 8c022dcb authored by Allen Vicencio's avatar Allen Vicencio Committed by Commit Bot

Use SmbUrl to parse mount path

Uses SmbUrl to parse the path passed to Mount and resolve the URL using
SmbShareFinder

Bug: 757625
Change-Id: I4d5ca6aa0fbc6c59728c650804b189b275faaf30
Reviewed-on: https://chromium-review.googlesource.com/1097710
Commit-Queue: Allen Vicencio <allenvic@chromium.org>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567346}
parent d367e8d6
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "chrome/browser/chromeos/smb_client/smb_provider.h" #include "chrome/browser/chromeos/smb_client/smb_provider.h"
#include "chrome/browser/chromeos/smb_client/smb_service_factory.h" #include "chrome/browser/chromeos/smb_client/smb_service_factory.h"
#include "chrome/browser/chromeos/smb_client/smb_service_helper.h" #include "chrome/browser/chromeos/smb_client/smb_service_helper.h"
#include "chrome/browser/chromeos/smb_client/smb_url.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/smb_provider_client.h" #include "chromeos/dbus/smb_provider_client.h"
...@@ -124,13 +125,16 @@ void SmbService::CallMount(const file_system_provider::MountOptions& options, ...@@ -124,13 +125,16 @@ void SmbService::CallMount(const file_system_provider::MountOptions& options,
} }
} }
// TODO(allenvic): Add URL parsing here once SmbUrl can be used without adding SmbUrl parsed_url(share_path.value());
// a standard scheme. if (!parsed_url.IsValid()) {
std::move(callback).Run(
TranslateErrorToMountResult(base::File::Error::FILE_ERROR_INVALID_URL));
return;
}
// TODO(allenvic): Resolve parsed_url here using NetworkScanner once name const base::FilePath mount_path(share_finder_->GetResolvedUrl(parsed_url));
// resolution is wired up.
GetSmbProviderClient()->Mount( GetSmbProviderClient()->Mount(
share_path, workgroup, username, mount_path, workgroup, username,
temp_file_manager_->WritePasswordToFile(password), temp_file_manager_->WritePasswordToFile(password),
base::BindOnce(&SmbService::OnMountResponse, AsWeakPtr(), base::BindOnce(&SmbService::OnMountResponse, AsWeakPtr(),
base::Passed(&callback), options, share_path)); base::Passed(&callback), options, share_path));
......
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