diff options
-rw-r--r-- | app/gtk_util.cc | 5 | ||||
-rw-r--r-- | base/base.gyp | 2 | ||||
-rw-r--r-- | base/base.gypi | 10 | ||||
-rw-r--r-- | base/base_paths_linux.cc (renamed from base/base_paths_posix.cc) | 20 | ||||
-rw-r--r-- | base/nix/xdg_util.cc (renamed from base/xdg_util.cc) | 4 | ||||
-rw-r--r-- | base/nix/xdg_util.h (renamed from base/xdg_util.h) | 20 | ||||
-rw-r--r-- | base/nix/xdg_util_unittest.cc (renamed from base/xdg_util_unittest.cc) | 26 | ||||
-rw-r--r-- | chrome/browser/background_mode_manager.cc | 4 | ||||
-rw-r--r-- | chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc | 16 | ||||
-rw-r--r-- | chrome/browser/gtk/gconf_titlebar_listener.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/gtk_theme_provider.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/options/advanced_contents_gtk.cc | 16 | ||||
-rw-r--r-- | chrome/browser/profile_impl.cc | 20 | ||||
-rw-r--r-- | chrome/common/chrome_paths_linux.cc | 12 | ||||
-rw-r--r-- | net/proxy/proxy_config_service_linux.cc | 18 |
15 files changed, 103 insertions, 84 deletions
diff --git a/app/gtk_util.cc b/app/gtk_util.cc index 5eade5b..e56656f 100644 --- a/app/gtk_util.cc +++ b/app/gtk_util.cc @@ -10,7 +10,7 @@ #include "base/environment.h" #include "base/logging.h" #include "base/string_number_conversions.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" namespace gtk_util { @@ -98,7 +98,8 @@ void ApplyMessageDialogQuirks(GtkWidget* dialog) { if (gtk_window_get_modal(GTK_WINDOW(dialog))) { // Work around a KDE 3 window manager bug. scoped_ptr<base::Environment> env(base::Environment::Create()); - if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get())) + if (base::nix::DESKTOP_ENVIRONMENT_KDE3 == + base::nix::GetDesktopEnvironment(env.get())) gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE); } } diff --git a/base/base.gyp b/base/base.gyp index dee0040..e432815 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -189,7 +189,7 @@ 'worker_pool_linux_unittest.cc', ], 'sources': [ - 'xdg_util_unittest.cc', + 'nix/xdg_util_unittest.cc', ], 'dependencies': [ '../build/linux/system.gyp:gtk', diff --git a/base/base.gypi b/base/base.gypi index fee14af..b608e82 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -31,7 +31,7 @@ 'base_paths.h', 'base_paths_mac.h', 'base_paths_mac.mm', - 'base_paths_posix.cc', + 'base_paths_linux.cc', 'base_paths_win.cc', 'base_paths_win.h', 'base_switches.cc', @@ -315,8 +315,8 @@ 'worker_pool_mac.h', 'worker_pool_mac.mm', 'worker_pool_win.cc', - 'xdg_util.h', - 'xdg_util.cc', + 'nix/xdg_util.h', + 'nix/xdg_util.cc', ], 'include_dirs': [ '..', @@ -331,13 +331,11 @@ 'conditions': [ [ 'OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris"', { 'sources/': [ - ['exclude', '/xdg_[^/]*\\.cc$'], + ['exclude', '^nix/'], ], 'sources!': [ 'atomicops_internals_x86_gcc.cc', - 'base_paths_posix.cc', 'message_pump_glib.cc', - 'xdg_util.cc', ], }], [ 'OS != "linux"', { diff --git a/base/base_paths_posix.cc b/base/base_paths_linux.cc index 45b397e..6d837f2 100644 --- a/base/base_paths_posix.cc +++ b/base/base_paths_linux.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This is really Posix minus Mac. Mac code is in base_paths_mac.mm. - #include "base/base_paths.h" #include <unistd.h> @@ -19,7 +17,7 @@ #include "base/path_service.h" #include "base/scoped_ptr.h" #include "base/sys_string_conversions.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" namespace base { @@ -29,6 +27,10 @@ const char kSelfExe[] = "/proc/self/exe"; const char kSelfExe[] = getexecname(); #endif +// The name of this file relative to the source root. This is used for checking +// that the source checkout is in the correct place. +static const char kThisSourceFile[] = "base/base_paths_linux.cc"; + bool PathProviderPosix(int key, FilePath* result) { FilePath path; switch (key) { @@ -65,7 +67,7 @@ bool PathProviderPosix(int key, FilePath* result) { std::string cr_source_root; if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) { path = FilePath(cr_source_root); - if (file_util::PathExists(path.Append("base/base_paths_posix.cc"))) { + if (file_util::PathExists(path.Append(kThisSourceFile))) { *result = path; return true; } else { @@ -77,7 +79,7 @@ bool PathProviderPosix(int key, FilePath* result) { // For example: sconsbuild/{Debug|Release}/net_unittest if (PathService::Get(base::DIR_EXE, &path)) { path = path.DirName().DirName(); - if (file_util::PathExists(path.Append("base/base_paths_posix.cc"))) { + if (file_util::PathExists(path.Append(kThisSourceFile))) { *result = path; return true; } @@ -87,7 +89,7 @@ bool PathProviderPosix(int key, FilePath* result) { // for DIR_SOURCE_ROOT. if (PathService::Get(base::DIR_EXE, &path)) { path = path.DirName().DirName().Append("WebKit/chromium"); - if (file_util::PathExists(path.Append("base/base_paths_posix.cc"))) { + if (file_util::PathExists(path.Append(kThisSourceFile))) { *result = path; return true; } @@ -95,7 +97,7 @@ bool PathProviderPosix(int key, FilePath* result) { // If that failed (maybe the build output is symlinked to a different // drive) try assuming the current directory is the source root. if (file_util::GetCurrentDirectory(&path) && - file_util::PathExists(path.Append("base/base_paths_posix.cc"))) { + file_util::PathExists(path.Append(kThisSourceFile))) { *result = path; return true; } @@ -105,8 +107,8 @@ bool PathProviderPosix(int key, FilePath* result) { } case base::DIR_USER_CACHE: scoped_ptr<base::Environment> env(base::Environment::Create()); - FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", - ".cache")); + FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", + ".cache")); *result = cache_dir; return true; } diff --git a/base/xdg_util.cc b/base/nix/xdg_util.cc index 017ae7a..b39a07d 100644 --- a/base/xdg_util.cc +++ b/base/nix/xdg_util.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "base/environment.h" #include "base/file_path.h" @@ -10,6 +10,7 @@ #include "base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h" namespace base { +namespace nix { FilePath GetXDGDirectory(Environment* env, const char* env_name, const char* fallback_dir) { @@ -80,4 +81,5 @@ const char* GetDesktopEnvironmentName(Environment* env) { return GetDesktopEnvironmentName(GetDesktopEnvironment(env)); } +} // namespace nix } // namespace base diff --git a/base/xdg_util.h b/base/nix/xdg_util.h index c0788c8e..5e711d5 100644 --- a/base/xdg_util.h +++ b/base/nix/xdg_util.h @@ -2,13 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef BASE_XDG_UTIL_H_ -#define BASE_XDG_UTIL_H_ +#ifndef BASE_NIX_XDG_UTIL_H_ +#define BASE_NIX_XDG_UTIL_H_ #pragma once // XDG refers to http://en.wikipedia.org/wiki/Freedesktop.org . -// This file contains utilities found across free desktop -// environments. +// This file contains utilities found across free desktop environments. +// +// TODO(brettw) this file should be in app/x11, but is currently used by +// net. We should have a net API to allow the embedder to specify the behavior +// that it uses XDG for, and then move this file. + +#ifdef nix +#error asdf +#endif class FilePath; @@ -16,6 +23,8 @@ namespace base { class Environment; +namespace nix { + // Utility function for getting XDG directories. // |env_name| is the name of an environment variable that we want to use to get // a directory path. |fallback_dir| is the directory relative to $HOME that we @@ -52,6 +61,7 @@ const char* GetDesktopEnvironmentName(DesktopEnvironment env); // Convenience wrapper that calls GetDesktopEnvironment() first. const char* GetDesktopEnvironmentName(Environment* env); +} // namespace nix } // namespace base -#endif // BASE_XDG_UTIL_H_ +#endif // BASE_NIX_XDG_UTIL_H_ diff --git a/base/xdg_util_unittest.cc b/base/nix/xdg_util_unittest.cc index c33fca5..2fc9d4c 100644 --- a/base/xdg_util_unittest.cc +++ b/base/nix/xdg_util_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "base/environment.h" #include "testing/gmock/include/gmock/gmock.h" @@ -13,9 +13,12 @@ using ::testing::Return; using ::testing::SetArgumentPointee; using ::testing::StrEq; +namespace base { +namespace nix { + namespace { -class MockEnvironment : public base::Environment { +class MockEnvironment : public Environment { public: MOCK_METHOD2(GetVar, bool(const char*, std::string* result)); MOCK_METHOD2(SetVar, bool(const char*, const std::string& new_value)); @@ -35,8 +38,8 @@ TEST(XDGUtilTest, GetDesktopEnvironmentGnome) { EXPECT_CALL(getter, GetVar(StrEq("DESKTOP_SESSION"), _)) .WillOnce(DoAll(SetArgumentPointee<1>(kGnome), Return(true))); - EXPECT_EQ(base::DESKTOP_ENVIRONMENT_GNOME, - base::GetDesktopEnvironment(&getter)); + EXPECT_EQ(DESKTOP_ENVIRONMENT_GNOME, + GetDesktopEnvironment(&getter)); } TEST(XDGUtilTest, GetDesktopEnvironmentKDE4) { @@ -45,8 +48,8 @@ TEST(XDGUtilTest, GetDesktopEnvironmentKDE4) { EXPECT_CALL(getter, GetVar(StrEq("DESKTOP_SESSION"), _)) .WillOnce(DoAll(SetArgumentPointee<1>(kKDE4), Return(true))); - EXPECT_EQ(base::DESKTOP_ENVIRONMENT_KDE4, - base::GetDesktopEnvironment(&getter)); + EXPECT_EQ(DESKTOP_ENVIRONMENT_KDE4, + GetDesktopEnvironment(&getter)); } TEST(XDGUtilTest, GetDesktopEnvironmentKDE3) { @@ -55,8 +58,8 @@ TEST(XDGUtilTest, GetDesktopEnvironmentKDE3) { EXPECT_CALL(getter, GetVar(StrEq("DESKTOP_SESSION"), _)) .WillOnce(DoAll(SetArgumentPointee<1>(kKDE), Return(true))); - EXPECT_EQ(base::DESKTOP_ENVIRONMENT_KDE3, - base::GetDesktopEnvironment(&getter)); + EXPECT_EQ(DESKTOP_ENVIRONMENT_KDE3, + GetDesktopEnvironment(&getter)); } TEST(XDGUtilTest, GetDesktopEnvironmentXFCE) { @@ -65,6 +68,9 @@ TEST(XDGUtilTest, GetDesktopEnvironmentXFCE) { EXPECT_CALL(getter, GetVar(StrEq("DESKTOP_SESSION"), _)) .WillOnce(DoAll(SetArgumentPointee<1>(kXFCE), Return(true))); - EXPECT_EQ(base::DESKTOP_ENVIRONMENT_XFCE, - base::GetDesktopEnvironment(&getter)); + EXPECT_EQ(DESKTOP_ENVIRONMENT_XFCE, + GetDesktopEnvironment(&getter)); } + +} // namespace nix +} // namespace base diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc index d7999da..ef16b49 100644 --- a/chrome/browser/background_mode_manager.cc +++ b/chrome/browser/background_mode_manager.cc @@ -34,7 +34,7 @@ #include "base/file_util.h" #include "base/task.h" #include "base/utf_string_conversions.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "chrome/common/chrome_version_info.h" #endif @@ -66,7 +66,7 @@ namespace { FilePath GetAutostartDirectory(base::Environment* environment) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); FilePath result = - base::GetXDGDirectory(environment, kXdgConfigHome, kConfig); + base::nix::GetXDGDirectory(environment, kXdgConfigHome, kConfig); result = result.Append(kAutostart); return result; } diff --git a/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc b/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc index 22d1639..094701e 100644 --- a/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc +++ b/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc @@ -12,7 +12,7 @@ #include "base/environment.h" #include "base/process_util.h" #include "base/string_tokenizer.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/process_watcher.h" @@ -80,8 +80,8 @@ void AdvancedOptionsUtilities::ShowNetworkProxySettings( ProxyConfigCommand command; bool found_command = false; - switch (base::GetDesktopEnvironment(env.get())) { - case base::DESKTOP_ENVIRONMENT_GNOME: { + switch (base::nix::GetDesktopEnvironment(env.get())) { + case base::nix::DESKTOP_ENVIRONMENT_GNOME: { size_t index; ProxyConfigCommand commands[2]; commands[0].argv = kGNOMEProxyConfigCommand; @@ -92,25 +92,25 @@ void AdvancedOptionsUtilities::ShowNetworkProxySettings( break; } - case base::DESKTOP_ENVIRONMENT_KDE3: + case base::nix::DESKTOP_ENVIRONMENT_KDE3: command.argv = kKDE3ProxyConfigCommand; found_command = SearchPATH(&command, 1, NULL); break; - case base::DESKTOP_ENVIRONMENT_KDE4: + case base::nix::DESKTOP_ENVIRONMENT_KDE4: command.argv = kKDE4ProxyConfigCommand; found_command = SearchPATH(&command, 1, NULL); break; - case base::DESKTOP_ENVIRONMENT_XFCE: - case base::DESKTOP_ENVIRONMENT_OTHER: + case base::nix::DESKTOP_ENVIRONMENT_XFCE: + case base::nix::DESKTOP_ENVIRONMENT_OTHER: break; } if (found_command) { StartProxyConfigUtil(command); } else { - const char* name = base::GetDesktopEnvironmentName(env.get()); + const char* name = base::nix::GetDesktopEnvironmentName(env.get()); if (name) LOG(ERROR) << "Could not find " << name << " network settings in $PATH"; tab_contents->OpenURL(GURL(kLinuxProxyConfigUrl), GURL(), diff --git a/chrome/browser/gtk/gconf_titlebar_listener.cc b/chrome/browser/gtk/gconf_titlebar_listener.cc index b33ab17..671c197b 100644 --- a/chrome/browser/gtk/gconf_titlebar_listener.cc +++ b/chrome/browser/gtk/gconf_titlebar_listener.cc @@ -8,7 +8,7 @@ #include "base/scoped_ptr.h" #include "base/environment.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "chrome/browser/gtk/browser_titlebar.h" namespace { @@ -46,8 +46,8 @@ void GConfTitlebarListener::RemoveObserver(BrowserTitlebar* titlebar) { GConfTitlebarListener::GConfTitlebarListener() : client_(NULL) { scoped_ptr<base::Environment> env(base::Environment::Create()); - if (base::GetDesktopEnvironment(env.get()) == - base::DESKTOP_ENVIRONMENT_GNOME) { + if (base::nix::GetDesktopEnvironment(env.get()) == + base::nix::DESKTOP_ENVIRONMENT_GNOME) { client_ = gconf_client_get_default(); // If we fail to get a context, that's OK, since we'll just fallback on // not receiving gconf keys. diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc index 5bcd8a3..4a6b0c9 100644 --- a/chrome/browser/gtk/gtk_theme_provider.cc +++ b/chrome/browser/gtk/gtk_theme_provider.cc @@ -12,7 +12,7 @@ #include "app/resource_bundle.h" #include "base/environment.h" #include "base/stl_util-inl.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "chrome/browser/gtk/cairo_cached_surface.h" #include "chrome/browser/gtk/gtk_chrome_button.h" #include "chrome/browser/gtk/hover_controller_gtk.h" @@ -552,9 +552,9 @@ GdkPixbuf* GtkThemeProvider::GetDefaultFavicon(bool native) { bool GtkThemeProvider::DefaultUsesSystemTheme() { scoped_ptr<base::Environment> env(base::Environment::Create()); - switch (base::GetDesktopEnvironment(env.get())) { - case base::DESKTOP_ENVIRONMENT_GNOME: - case base::DESKTOP_ENVIRONMENT_XFCE: + switch (base::nix::GetDesktopEnvironment(env.get())) { + case base::nix::DESKTOP_ENVIRONMENT_GNOME: + case base::nix::DESKTOP_ENVIRONMENT_XFCE: return true; default: return false; diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc index 343f9bd..fa1c1c9 100644 --- a/chrome/browser/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc @@ -20,7 +20,7 @@ #include "base/path_service.h" #include "base/process_util.h" #include "base/string_tokenizer.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_manager.h" @@ -429,8 +429,8 @@ void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button, ProxyConfigCommand command; bool found_command = false; - switch (base::GetDesktopEnvironment(env.get())) { - case base::DESKTOP_ENVIRONMENT_GNOME: { + switch (base::nix::GetDesktopEnvironment(env.get())) { + case base::nix::DESKTOP_ENVIRONMENT_GNOME: { size_t index; ProxyConfigCommand commands[2]; commands[0].argv = kGNOMEProxyConfigCommand; @@ -441,25 +441,25 @@ void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button, break; } - case base::DESKTOP_ENVIRONMENT_KDE3: + case base::nix::DESKTOP_ENVIRONMENT_KDE3: command.argv = kKDE3ProxyConfigCommand; found_command = SearchPATH(&command, 1, NULL); break; - case base::DESKTOP_ENVIRONMENT_KDE4: + case base::nix::DESKTOP_ENVIRONMENT_KDE4: command.argv = kKDE4ProxyConfigCommand; found_command = SearchPATH(&command, 1, NULL); break; - case base::DESKTOP_ENVIRONMENT_XFCE: - case base::DESKTOP_ENVIRONMENT_OTHER: + case base::nix::DESKTOP_ENVIRONMENT_XFCE: + case base::nix::DESKTOP_ENVIRONMENT_OTHER: break; } if (found_command) { StartProxyConfigUtil(section->profile(), command); } else { - const char* name = base::GetDesktopEnvironmentName(env.get()); + const char* name = base::nix::GetDesktopEnvironmentName(env.get()); if (name) LOG(ERROR) << "Could not find " << name << " network settings in $PATH"; browser::ShowOptionsURL(section->profile(), GURL(kLinuxProxyConfigUrl)); diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc index 18ac330..4ed055b 100644 --- a/chrome/browser/profile_impl.cc +++ b/chrome/browser/profile_impl.cc @@ -98,7 +98,7 @@ #elif defined(OS_CHROMEOS) #include "chrome/browser/chromeos/proxy_config_service_impl.h" #elif defined(OS_POSIX) && !defined(OS_CHROMEOS) -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #if defined(USE_GNOME_KEYRING) #include "chrome/browser/password_manager/native_backend_gnome_x.h" #endif @@ -929,28 +929,28 @@ void ProfileImpl::CreatePasswordStore() { // On POSIX systems, we try to use the "native" password management system of // the desktop environment currently running, allowing GNOME Keyring in XFCE. // (In all cases we fall back on the default store in case of failure.) - base::DesktopEnvironment desktop_env; + base::nix::DesktopEnvironment desktop_env; std::string store_type = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kPasswordStore); if (store_type == "kwallet") { - desktop_env = base::DESKTOP_ENVIRONMENT_KDE4; + desktop_env = base::nix::DESKTOP_ENVIRONMENT_KDE4; } else if (store_type == "gnome") { - desktop_env = base::DESKTOP_ENVIRONMENT_GNOME; + desktop_env = base::nix::DESKTOP_ENVIRONMENT_GNOME; } else if (store_type == "detect") { scoped_ptr<base::Environment> env(base::Environment::Create()); - desktop_env = base::GetDesktopEnvironment(env.get()); + desktop_env = base::nix::GetDesktopEnvironment(env.get()); LOG(INFO) << "Password storage detected desktop environment: " << - base::GetDesktopEnvironmentName(desktop_env); + base::nix::GetDesktopEnvironmentName(desktop_env); } else { // TODO(mdm): If the flag is not given, or has an unknown value, use the // default store for now. Once we're confident in the other stores, we can // default to detecting the desktop environment instead. - desktop_env = base::DESKTOP_ENVIRONMENT_OTHER; + desktop_env = base::nix::DESKTOP_ENVIRONMENT_OTHER; } scoped_ptr<PasswordStoreX::NativeBackend> backend; - if (desktop_env == base::DESKTOP_ENVIRONMENT_KDE4) { + if (desktop_env == base::nix::DESKTOP_ENVIRONMENT_KDE4) { // KDE3 didn't use DBus, which our KWallet store uses. LOG(INFO) << "Trying KWallet for password storage."; backend.reset(new NativeBackendKWallet()); @@ -958,8 +958,8 @@ void ProfileImpl::CreatePasswordStore() { LOG(INFO) << "Using KWallet for password storage."; else backend.reset(); - } else if (desktop_env == base::DESKTOP_ENVIRONMENT_GNOME || - desktop_env == base::DESKTOP_ENVIRONMENT_XFCE) { + } else if (desktop_env == base::nix::DESKTOP_ENVIRONMENT_GNOME || + desktop_env == base::nix::DESKTOP_ENVIRONMENT_XFCE) { #if defined(USE_GNOME_KEYRING) LOG(INFO) << "Trying GNOME keyring for password storage."; backend.reset(new NativeBackendGnome()); diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc index f0ff3fb..42c6ae7 100644 --- a/chrome/common/chrome_paths_linux.cc +++ b/chrome/common/chrome_paths_linux.cc @@ -7,7 +7,7 @@ #include "base/environment.h" #include "base/file_util.h" #include "base/scoped_ptr.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" namespace chrome { @@ -19,7 +19,7 @@ namespace chrome { bool GetDefaultUserDataDirectory(FilePath* result) { scoped_ptr<base::Environment> env(base::Environment::Create()); FilePath config_dir( - base::GetXDGDirectory(env.get(), "XDG_CONFIG_HOME", ".config")); + base::nix::GetXDGDirectory(env.get(), "XDG_CONFIG_HOME", ".config")); #if defined(GOOGLE_CHROME_BUILD) *result = config_dir.Append("google-chrome"); #else @@ -31,7 +31,7 @@ bool GetDefaultUserDataDirectory(FilePath* result) { bool GetChromeFrameUserDataDirectory(FilePath* result) { scoped_ptr<base::Environment> env(base::Environment::Create()); FilePath config_dir( - base::GetXDGDirectory(env.get(), "XDG_CONFIG_HOME", ".config")); + base::nix::GetXDGDirectory(env.get(), "XDG_CONFIG_HOME", ".config")); #if defined(GOOGLE_CHROME_BUILD) *result = config_dir.Append("google-chrome-frame"); #else @@ -42,7 +42,7 @@ bool GetChromeFrameUserDataDirectory(FilePath* result) { bool GetUserDocumentsDirectory(FilePath* result) { scoped_ptr<base::Environment> env(base::Environment::Create()); - *result = base::GetXDGUserDirectory(env.get(), "DOCUMENTS", "Documents"); + *result = base::nix::GetXDGUserDirectory(env.get(), "DOCUMENTS", "Documents"); return true; } @@ -50,7 +50,7 @@ bool GetUserDocumentsDirectory(FilePath* result) { // ~ or their desktop directory, in which case we default to ~/Downloads. bool GetUserDownloadsDirectory(FilePath* result) { scoped_ptr<base::Environment> env(base::Environment::Create()); - *result = base::GetXDGUserDirectory(env.get(), "DOWNLOAD", "Downloads"); + *result = base::nix::GetXDGUserDirectory(env.get(), "DOWNLOAD", "Downloads"); FilePath home = file_util::GetHomeDir(); if (*result == home) { @@ -69,7 +69,7 @@ bool GetUserDownloadsDirectory(FilePath* result) { bool GetUserDesktop(FilePath* result) { scoped_ptr<base::Environment> env(base::Environment::Create()); - *result = base::GetXDGUserDirectory(env.get(), "DESKTOP", "Desktop"); + *result = base::nix::GetXDGUserDirectory(env.get(), "DESKTOP", "Desktop"); return true; } diff --git a/net/proxy/proxy_config_service_linux.cc b/net/proxy/proxy_config_service_linux.cc index fe82e24..3d8c3ce 100644 --- a/net/proxy/proxy_config_service_linux.cc +++ b/net/proxy/proxy_config_service_linux.cc @@ -25,7 +25,7 @@ #include "base/string_util.h" #include "base/task.h" #include "base/timer.h" -#include "base/xdg_util.h" +#include "base/nix/xdg_util.h" #include "googleurl/src/url_canon.h" #include "net/base/net_errors.h" #include "net/http/http_util.h" @@ -442,8 +442,8 @@ class GConfSettingGetterImplKDE if (!env_var_getter->GetVar(base::env_vars::kHome, &home)) // User has no $HOME? Give up. Later we'll report the failure. return; - if (base::GetDesktopEnvironment(env_var_getter) == - base::DESKTOP_ENVIRONMENT_KDE3) { + if (base::nix::GetDesktopEnvironment(env_var_getter) == + base::nix::DESKTOP_ENVIRONMENT_KDE3) { // KDE3 always uses .kde for its configuration. FilePath kde_path = FilePath(home).Append(".kde"); kde_config_dir_ = KDEHomeToConfigPath(kde_path); @@ -1062,16 +1062,16 @@ ProxyConfigServiceLinux::Delegate::Delegate(base::Environment* env_var_getter) : env_var_getter_(env_var_getter), glib_default_loop_(NULL), io_loop_(NULL) { // Figure out which GConfSettingGetterImpl to use, if any. - switch (base::GetDesktopEnvironment(env_var_getter)) { - case base::DESKTOP_ENVIRONMENT_GNOME: + switch (base::nix::GetDesktopEnvironment(env_var_getter)) { + case base::nix::DESKTOP_ENVIRONMENT_GNOME: gconf_getter_.reset(new GConfSettingGetterImplGConf()); break; - case base::DESKTOP_ENVIRONMENT_KDE3: - case base::DESKTOP_ENVIRONMENT_KDE4: + case base::nix::DESKTOP_ENVIRONMENT_KDE3: + case base::nix::DESKTOP_ENVIRONMENT_KDE4: gconf_getter_.reset(new GConfSettingGetterImplKDE(env_var_getter)); break; - case base::DESKTOP_ENVIRONMENT_XFCE: - case base::DESKTOP_ENVIRONMENT_OTHER: + case base::nix::DESKTOP_ENVIRONMENT_XFCE: + case base::nix::DESKTOP_ENVIRONMENT_OTHER: break; } } |