diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 19:46:13 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 19:46:13 +0000 |
commit | 37723eca52eba4113e70b8ff390990345ed1c05c (patch) | |
tree | 5fb296dcaa37d65e640b9c33ca7f9c755eb35f21 /chrome | |
parent | a3153c47d3b5308e7a55c0924a0baa1a6e02dcd0 (diff) | |
download | chromium_src-37723eca52eba4113e70b8ff390990345ed1c05c.zip chromium_src-37723eca52eba4113e70b8ff390990345ed1c05c.tar.gz chromium_src-37723eca52eba4113e70b8ff390990345ed1c05c.tar.bz2 |
Fix some obvious not implemented linux bits so we can crash later
in Hammer/chrome.
Now we crash in message loop code.
Review URL: http://codereview.chromium.org/21033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9162 0039d316-1c4b-4281-b951-d872f2087c98
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) { |