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:
Jeremy Rose 2021-06-14 17:32:56 -07:00 committed by GitHub
parent 8b945cb296
commit ebf54d7cc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 115 additions and 108 deletions

3
shell/browser/browser.cc Executable file → Normal file
View file

@ -14,6 +14,7 @@
#include "base/run_loop.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/common/chrome_paths.h"
#include "shell/browser/browser_observer.h"
#include "shell/browser/electron_browser_main_parts.h"
#include "shell/browser/login_handler.h"
@ -187,7 +188,7 @@ void Browser::DidFinishLaunching(base::DictionaryValue launch_info) {
// Make sure the userData directory is created.
base::ThreadRestrictions::ScopedAllowIO allow_io;
base::FilePath user_data;
if (base::PathService::Get(DIR_USER_DATA, &user_data))
if (base::PathService::Get(chrome::DIR_USER_DATA, &user_data))
base::CreateDirectoryAndGetError(user_data, nullptr);
is_ready_ = true;