fix: dictionaries download path should be in userdata (#22448)

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
trop[bot]
2020-02-28 15:58:33 -08:00
committed by GitHub
parent 69598ae5c6
commit de2e12343e
2 changed files with 6 additions and 0 deletions

View File

@@ -882,6 +882,9 @@ void App::SetPath(gin_helper::ErrorThrower thrower,
if (key == DIR_USER_DATA) {
succeed |= base::PathService::OverrideAndCreateIfNeeded(
chrome::DIR_USER_DATA, path, true, false);
succeed |= base::PathService::Override(
chrome::DIR_APP_DICTIONARIES,
path.Append(base::FilePath::FromUTF8Unsafe("Dictionaries")));
}
}
if (!succeed)

View File

@@ -118,6 +118,9 @@ ElectronBrowserContext::ElectronBrowserContext(
path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
base::PathService::Override(DIR_USER_DATA, path_);
base::PathService::Override(chrome::DIR_USER_DATA, path_);
base::PathService::Override(
chrome::DIR_APP_DICTIONARIES,
path_.Append(base::FilePath::FromUTF8Unsafe("Dictionaries")));
}
if (!in_memory && !partition.empty())