refactor: use PathProvider for user-data-dir and others (#29649)
* refactor: use PathProvider for user-data-dir and others * consolidate logic for DIR_RECENT and DIR_APP_LOGS into path provider * fix bad include * remove debugging code * fix build on mac * fix build on win * create app logs dir on both mac and non-mac
This commit is contained in:
parent
8b945cb296
commit
ebf54d7cc0
16 changed files with 115 additions and 108 deletions
|
@ -117,14 +117,10 @@ ElectronBrowserContext::ElectronBrowserContext(const std::string& partition,
|
|||
base::StringToInt(command_line->GetSwitchValueASCII(switches::kDiskCacheSize),
|
||||
&max_cache_size_);
|
||||
|
||||
if (!base::PathService::Get(DIR_USER_DATA, &path_)) {
|
||||
if (!base::PathService::Get(chrome::DIR_USER_DATA, &path_)) {
|
||||
base::PathService::Get(DIR_APP_DATA, &path_);
|
||||
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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue