Skip to content

Commit

Permalink
fix: dictionaries download path should be in userdata (electron#22444)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored Feb 28, 2020
1 parent 2c97491 commit ced4874
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shell/browser/api/electron_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,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)
Expand Down
3 changes: 3 additions & 0 deletions shell/browser/electron_browser_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ ElectronBrowserContext::ElectronBrowserContext(const std::string& partition,
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())
Expand Down

0 comments on commit ced4874

Please sign in to comment.