diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 12 | ||||
-rw-r--r-- | chrome/common/chrome_paths_linux.cc | 21 |
2 files changed, 25 insertions, 8 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 29429d0..3df817b 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -36,7 +36,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/main_function_params.h" -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(OS_LINUX) #include "chrome/common/resource_bundle.h" #endif #include "chrome/common/sandbox_init_wrapper.h" @@ -166,13 +166,15 @@ void EnableHeapProfiler(const CommandLine& parsed_command_line) { } void CommonSubprocessInit() { -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(OS_LINUX) // Initialize ResourceBundle which handles files loaded from external // sources. The language should have been passed in to us from the // browser process as a command line flag. - // TODO(port): enable when we figure out resource bundle issues + // TODO(port-mac): enable when we figure out resource bundle issues ResourceBundle::InitSharedInstance(std::wstring()); +#endif +#if defined(OS_WIN) // HACK: Let Windows know that we have started. This is needed to suppress // the IDC_APPSTARTING cursor from being displayed for a prolonged period // while a subprocess is starting. @@ -315,8 +317,8 @@ int ChromeMain(int argc, const char** argv) { } if (!process_type.empty()) { -#if defined(OS_WIN) - // TODO(port): enable when we figure out resource bundle issues +#if defined(OS_WIN) || defined(OS_LINUX) + // TODO(port-mac): enable when we figure out resource bundle issues ResourceBundle::CleanupSharedInstance(); #endif } diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc index c2654bb..9cbde97 100644 --- a/chrome/common/chrome_paths_linux.cc +++ b/chrome/common/chrome_paths_linux.cc @@ -4,14 +4,29 @@ #include "chrome/common/chrome_paths_internal.h" +#include <glib.h> +#include "base/file_path.h" #include "base/logging.h" namespace chrome { +// Use ~/.chromium/ for Chromium and ~/.google/chrome for official builds. We +// use ~/.google/chrome because ~/.google/ is already used by other Google +// Linux apps. bool GetDefaultUserDataDirectory(FilePath* result) { - // TODO(port): Decide what to do on linux. - NOTIMPLEMENTED(); - return false; + // The glib documentation says that g_get_home_dir doesn't honor HOME so we + // should try that first. + const char* home_dir = g_getenv("HOME"); + if (!home_dir) + home_dir = g_get_home_dir(); + *result = FilePath(home_dir); +#if defined(GOOGLE_CHROME_BUILD) + *result = result->Append(".google"); + *result = result->Append("chrome"); +#else + *result = result->Append(".chromium"); +#endif + return true; } bool GetUserDocumentsDirectory(FilePath* result) { |