From c620d0de05832d1723ccc195432ab4f7e5331bf8 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 28 Sep 2017 23:03:01 -0400 Subject: [PATCH] move overrides into the appropriate namespace --- brightray/browser/browser_main_parts.cc | 43 +++++++++++++------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index e939eda1db..8e7e684032 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -94,27 +94,6 @@ void OverrideLinuxAppDataPath() { PathService::Override(DIR_APP_DATA, path); } -void OverrideWinAppLogsPath() { - std::string appName = GetApplicationName(); - std::string logPath = "%HOMEDRIVE%%HOMEPATH%\\AppData\\Roaming\\"; - std::string appLogPath = logPath + appName + "\\logs"; - - int status = mkdir(appLogPath.c_str(), S_IRWXU | S_IRGRP | S_IROTH); - - PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath)); -} - -void OverrideLinuxAppLogsPath() { - std::string appName = GetApplicationName(); - std::string homePath = std::string(getenv("HOME")); - std::string appLogPath = homePath + "/.config/" + appName + "/logs"; - - int status = mkdir(appLogPath.c_str(), S_IRWXU | S_IRGRP | S_IROTH); - - PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath)); - return; -} - int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { if (!g_in_x11_io_error_handler) { base::ThreadTaskRunnerHandle::Get()->PostTask( @@ -184,6 +163,28 @@ BrowserMainParts::BrowserMainParts() { BrowserMainParts::~BrowserMainParts() { } +void OverrideWinAppLogsPath() { + int status; + std::string appName = GetApplicationName(); + std::string logPath = "%HOMEDRIVE%%HOMEPATH%\\AppData\\Roaming\\"; + std::string appLogPath = logPath + appName + "\\logs"; + + status = mkdir(appLogPath.c_str(), S_IRWXU | S_IRGRP | S_IROTH); + + PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath)); +} + +void OverrideLinuxAppLogsPath() { + int status; + std::string appName = GetApplicationName(); + std::string homePath = std::string(getenv("HOME")); + std::string appLogPath = homePath + "/.config/" + appName + "/logs"; + + status = mkdir(appLogPath.c_str(), S_IRWXU | S_IRGRP | S_IROTH); + + PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath)); +} + void BrowserMainParts::PreEarlyInitialization() { std::unique_ptr feature_list(new base::FeatureList); feature_list->InitializeFromCommandLine("", "");