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

This commit is contained in:
Samuel Attard 2020-02-28 15:37:53 -08:00 committed by GitHub
parent 2c974915a3
commit ced487467c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

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

View file

@ -119,6 +119,9 @@ ElectronBrowserContext::ElectronBrowserContext(const std::string& partition,
path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName())); path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
base::PathService::Override(DIR_USER_DATA, path_); base::PathService::Override(DIR_USER_DATA, path_);
base::PathService::Override(chrome::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()) if (!in_memory && !partition.empty())