summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/gtk_util.cc4
-rw-r--r--base/base.gypi18
-rw-r--r--base/base_paths_posix.cc6
-rw-r--r--base/env_var.cc80
-rw-r--r--base/env_var.h33
-rw-r--r--base/linux_util.cc70
-rw-r--r--base/linux_util.h35
-rw-r--r--base/sys_info.h6
-rw-r--r--chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc9
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.cc7
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc7
-rw-r--r--chrome/browser/shell_integration.h16
-rw-r--r--chrome/browser/shell_integration_linux.cc20
-rw-r--r--chrome/browser/shell_integration_unittest.cc18
-rw-r--r--chrome/browser/web_applications/web_app.cc7
-rw-r--r--chrome/common/chrome_paths_linux.cc18
-rw-r--r--net/proxy/proxy_config_service_linux.cc32
-rw-r--r--net/proxy/proxy_config_service_linux.h15
-rw-r--r--net/proxy/proxy_config_service_linux_unittest.cc20
19 files changed, 242 insertions, 179 deletions
diff --git a/app/gtk_util.cc b/app/gtk_util.cc
index b2aab1a..7d18e6f 100644
--- a/app/gtk_util.cc
+++ b/app/gtk_util.cc
@@ -7,6 +7,7 @@
#include <gtk/gtk.h>
#include "app/l10n_util.h"
+#include "base/env_var.h"
#include "base/linux_util.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -56,8 +57,7 @@ void GetWidgetSizeFromCharacters(
void ApplyMessageDialogQuirks(GtkWidget* dialog) {
if (gtk_window_get_modal(GTK_WINDOW(dialog))) {
// Work around a KDE 3 window manager bug.
- scoped_ptr<base::EnvironmentVariableGetter> env(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
if (base::DESKTOP_ENVIRONMENT_KDE3 == GetDesktopEnvironment(env.get()))
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dialog), FALSE);
}
diff --git a/base/base.gypi b/base/base.gypi
index 153f827..df96e51 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -21,12 +21,12 @@
'third_party/icu/icu_utf.h',
'third_party/nspr/prtime.cc',
'third_party/nspr/prtime.h',
- 'atomicops_internals_x86_gcc.cc',
'at_exit.cc',
'at_exit.h',
'atomic_ref_count.h',
'atomic_sequence_num.h',
'atomicops.h',
+ 'atomicops_internals_x86_gcc.cc',
'atomicops_internals_x86_msvc.h',
'base_paths.cc',
'base_paths.h',
@@ -41,8 +41,8 @@
'bits.h',
'bzip2_error_handler.cc',
'callback.h',
- 'cancellation_flag.h',
'cancellation_flag.cc',
+ 'cancellation_flag.h',
'chrome_application_mac.h',
'chrome_application_mac.mm',
'cocoa_protocols_mac.h',
@@ -64,6 +64,8 @@
'dir_reader_fallback.h',
'dir_reader_linux.h',
'dir_reader_posix.h',
+ 'env_var.cc',
+ 'env_var.h',
'event_trace_consumer_win.h',
'event_trace_controller_win.cc',
'event_trace_controller_win.h',
@@ -84,8 +86,8 @@
'fix_wp64.h',
'float_util.h',
'foundation_utils_mac.h',
- 'global_descriptors_posix.h',
'global_descriptors_posix.cc',
+ 'global_descriptors_posix.h',
'hash_tables.h',
'histogram.cc',
'histogram.h',
@@ -104,8 +106,8 @@
'lock_impl_posix.cc',
'lock_impl_win.cc',
'logging.cc',
- 'logging_win.cc',
'logging.h',
+ 'logging_win.cc',
'mac_util.h',
'mac_util.mm',
'mach_ipc_mac.h',
@@ -140,15 +142,13 @@
'pickle.cc',
'pickle.h',
'platform_file.h',
- 'platform_file_win.cc',
'platform_file_posix.cc',
+ 'platform_file_win.cc',
'platform_thread.h',
'platform_thread_mac.mm',
'platform_thread_posix.cc',
'platform_thread_win.cc',
'port.h',
- 'profiler.cc',
- 'profiler.h',
'process.h',
'process_linux.cc',
'process_posix.cc',
@@ -158,6 +158,8 @@
'process_util_posix.cc',
'process_util_win.cc',
'process_win.cc',
+ 'profiler.cc',
+ 'profiler.h',
'rand_util.cc',
'rand_util.h',
'rand_util_posix.cc',
@@ -247,13 +249,13 @@
'tracked_objects.cc',
'tracked_objects.h',
'tuple.h',
+ 'unix_domain_socket_posix.cc',
'utf_offset_string_conversions.cc',
'utf_offset_string_conversions.h',
'utf_string_conversion_utils.cc',
'utf_string_conversion_utils.h',
'utf_string_conversions.cc',
'utf_string_conversions.h',
- 'unix_domain_socket_posix.cc',
'values.cc',
'values.h',
'waitable_event.h',
diff --git a/base/base_paths_posix.cc b/base/base_paths_posix.cc
index 51bb593..e44028e 100644
--- a/base/base_paths_posix.cc
+++ b/base/base_paths_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include <unistd.h>
+#include "base/env_var.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/linux_util.h"
@@ -62,8 +63,7 @@ bool PathProviderPosix(int key, FilePath* result) {
<< "Try running from your chromium/src directory.";
return false;
case base::DIR_USER_CACHE:
- scoped_ptr<base::EnvironmentVariableGetter> env(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME",
".cache"));
*result = cache_dir;
diff --git a/base/env_var.cc b/base/env_var.cc
new file mode 100644
index 0000000..3075fda
--- /dev/null
+++ b/base/env_var.cc
@@ -0,0 +1,80 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/env_var.h"
+
+#if defined(OS_POSIX)
+#include <stdlib.h>
+#elif defined(OS_WIN)
+#include <windows.h>
+#endif
+
+#include "base/string_util.h"
+
+#if defined(OS_WIN)
+#include "base/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
+#endif
+
+namespace {
+
+class EnvVarGetterImpl
+ : public base::EnvVarGetter {
+ public:
+ virtual bool GetEnv(const char* variable_name, std::string* result) {
+ if (GetEnvImpl(variable_name, result))
+ return true;
+
+ // Some commonly used variable names are uppercase while others
+ // are lowercase, which is inconsistent. Let's try to be helpful
+ // and look for a variable name with the reverse case.
+ // I.e. HTTP_PROXY may be http_proxy for some users/systems.
+ char first_char = variable_name[0];
+ std::string alternate_case_var;
+ if (first_char >= 'a' && first_char <= 'z')
+ alternate_case_var = StringToUpperASCII(std::string(variable_name));
+ else if (first_char >= 'A' && first_char <= 'Z')
+ alternate_case_var = StringToLowerASCII(std::string(variable_name));
+ else
+ return false;
+ return GetEnvImpl(alternate_case_var.c_str(), result);
+ }
+ private:
+ bool GetEnvImpl(const char* variable_name, std::string* result) {
+#if defined(OS_POSIX)
+ const char* env_value = getenv(variable_name);
+ if (!env_value)
+ return false;
+ // Note that the variable may be defined but empty.
+ if (result)
+ *result = env_value;
+ return true;
+#elif defined(OS_WIN)
+ DWORD value_length = ::GetEnvironmentVariable(
+ UTF8ToWide(variable_name).c_str(), NULL, 0);
+ if (value_length == 0)
+ return false;
+ if (result) {
+ scoped_array<wchar_t> value(new wchar_t[value_length]);
+ ::GetEnvironmentVariable(UTF8ToWide(variable_name).c_str(), value.get(),
+ value_length);
+ *result = WideToUTF8(value.get());
+ }
+ return true;
+#else
+#error need to port
+#endif
+ }
+};
+
+} // namespace
+
+namespace base {
+
+// static
+EnvVarGetter* EnvVarGetter::Create() {
+ return new EnvVarGetterImpl();
+}
+
+} // namespace base
diff --git a/base/env_var.h b/base/env_var.h
new file mode 100644
index 0000000..af1ec79
--- /dev/null
+++ b/base/env_var.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_ENV_VAR_H_
+#define BASE_ENV_VAR_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+namespace base {
+
+// These are used to derive mocks for unittests.
+class EnvVarGetter {
+ public:
+ virtual ~EnvVarGetter() {}
+ // Gets an environment variable's value and stores it in |result|.
+ // Returns false if the key is unset.
+ virtual bool GetEnv(const char* variable_name, std::string* result) = 0;
+
+ // Syntactic sugar for GetEnv(variable_name, NULL);
+ virtual bool HasEnv(const char* variable_name) {
+ return GetEnv(variable_name, NULL);
+ }
+
+ // Create an instance of EnvVarGetter
+ static EnvVarGetter* Create();
+};
+
+} // namespace base
+
+#endif // BASE_ENV_VAR_H_
diff --git a/base/linux_util.cc b/base/linux_util.cc
index e49a01f..b552b93 100644
--- a/base/linux_util.cc
+++ b/base/linux_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,6 +14,7 @@
#include <vector>
#include "base/command_line.h"
+#include "base/env_var.h"
#include "base/lock.h"
#include "base/path_service.h"
#include "base/process_util.h"
@@ -23,36 +24,6 @@
namespace {
-class EnvironmentVariableGetterImpl
- : public base::EnvironmentVariableGetter {
- public:
- virtual bool Getenv(const char* variable_name, std::string* result) {
- const char* env_value = ::getenv(variable_name);
- if (env_value) {
- // Note that the variable may be defined but empty.
- *result = env_value;
- return true;
- }
- // Some commonly used variable names are uppercase while others
- // are lowercase, which is inconsistent. Let's try to be helpful
- // and look for a variable name with the reverse case.
- char first_char = variable_name[0];
- std::string alternate_case_var;
- if (first_char >= 'a' && first_char <= 'z')
- alternate_case_var = StringToUpperASCII(std::string(variable_name));
- else if (first_char >= 'A' && first_char <= 'Z')
- alternate_case_var = StringToLowerASCII(std::string(variable_name));
- else
- return false;
- env_value = ::getenv(alternate_case_var.c_str());
- if (env_value) {
- *result = env_value;
- return true;
- }
- return false;
- }
-};
-
// Not needed for OS_CHROMEOS.
#if defined(OS_LINUX)
enum LinuxDistroState {
@@ -148,7 +119,7 @@ bool ProcPathGetInode(ino_t* inode_out, const char* path, bool log = false) {
return true;
}
-} // anonymous namespace
+} // namespace
namespace base {
@@ -181,9 +152,9 @@ std::string linux_distro =
"Unknown";
#endif
-FilePath GetHomeDir(EnvironmentVariableGetter* env) {
+FilePath GetHomeDir(EnvVarGetter* env) {
std::string home_dir;
- if (env->Getenv("HOME", &home_dir) && !home_dir.empty())
+ if (env->GetEnv("HOME", &home_dir) && !home_dir.empty())
return FilePath(home_dir);
home_dir = g_get_home_dir();
@@ -236,16 +207,16 @@ std::string GetLinuxDistro() {
#endif
}
-FilePath GetXDGDirectory(EnvironmentVariableGetter* env,
- const char* env_name, const char* fallback_dir) {
+FilePath GetXDGDirectory(EnvVarGetter* env, const char* env_name,
+ const char* fallback_dir) {
std::string env_value;
- if (env->Getenv(env_name, &env_value) && !env_value.empty())
+ if (env->GetEnv(env_name, &env_value) && !env_value.empty())
return FilePath(env_value);
return GetHomeDir(env).Append(fallback_dir);
}
-FilePath GetXDGUserDirectory(EnvironmentVariableGetter* env,
- const char* dir_name, const char* fallback_dir) {
+FilePath GetXDGUserDirectory(EnvVarGetter* env, const char* dir_name,
+ const char* fallback_dir) {
char* xdg_dir = xdg_user_dir_lookup(dir_name);
if (xdg_dir) {
FilePath rv(xdg_dir);
@@ -255,22 +226,16 @@ FilePath GetXDGUserDirectory(EnvironmentVariableGetter* env,
return GetHomeDir(env).Append(fallback_dir);
}
-// static
-EnvironmentVariableGetter* EnvironmentVariableGetter::Create() {
- return new EnvironmentVariableGetterImpl();
-}
-
-DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env) {
+DesktopEnvironment GetDesktopEnvironment(EnvVarGetter* env) {
std::string desktop_session;
- if (env->Getenv("DESKTOP_SESSION", &desktop_session)) {
+ if (env->GetEnv("DESKTOP_SESSION", &desktop_session)) {
if (desktop_session == "gnome")
return DESKTOP_ENVIRONMENT_GNOME;
else if (desktop_session == "kde4")
return DESKTOP_ENVIRONMENT_KDE4;
else if (desktop_session == "kde") {
// This may mean KDE4 on newer systems, so we have to check.
- std::string dummy;
- if (env->Getenv("KDE_SESSION_VERSION", &dummy))
+ if (env->HasEnv("KDE_SESSION_VERSION"))
return DESKTOP_ENVIRONMENT_KDE4;
return DESKTOP_ENVIRONMENT_KDE3;
}
@@ -280,11 +245,10 @@ DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env) {
// Fall back on some older environment variables.
// Useful particularly in the DESKTOP_SESSION=default case.
- std::string dummy;
- if (env->Getenv("GNOME_DESKTOP_SESSION_ID", &dummy)) {
+ if (env->HasEnv("GNOME_DESKTOP_SESSION_ID")) {
return DESKTOP_ENVIRONMENT_GNOME;
- } else if (env->Getenv("KDE_FULL_SESSION", &dummy)) {
- if (env->Getenv("KDE_SESSION_VERSION", &dummy))
+ } else if (env->HasEnv("KDE_FULL_SESSION")) {
+ if (env->HasEnv("KDE_SESSION_VERSION"))
return DESKTOP_ENVIRONMENT_KDE4;
return DESKTOP_ENVIRONMENT_KDE3;
}
@@ -308,7 +272,7 @@ const char* GetDesktopEnvironmentName(DesktopEnvironment env) {
return NULL;
}
-const char* GetDesktopEnvironmentName(EnvironmentVariableGetter* env) {
+const char* GetDesktopEnvironmentName(EnvVarGetter* env) {
return GetDesktopEnvironmentName(GetDesktopEnvironment(env));
}
diff --git a/base/linux_util.h b/base/linux_util.h
index 2139746..370a65e 100644
--- a/base/linux_util.h
+++ b/base/linux_util.h
@@ -1,15 +1,16 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_LINUX_UTIL_H__
-#define BASE_LINUX_UTIL_H__
+#ifndef BASE_LINUX_UTIL_H_
+#define BASE_LINUX_UTIL_H_
#include <stdint.h>
#include <sys/types.h>
#include <string>
+class EnvVarGetter;
class FilePath;
namespace base {
@@ -25,34 +26,22 @@ uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride);
// GetWinVersion() in base/win_util.h.
std::string GetLinuxDistro();
-// These are used to derive mocks for unittests.
-class EnvironmentVariableGetter {
- public:
- virtual ~EnvironmentVariableGetter() {}
- // Gets an environment variable's value and stores it in
- // result. Returns false if the key is unset.
- virtual bool Getenv(const char* variable_name, std::string* result) = 0;
-
- // Create an instance of EnvironmentVariableGetter
- static EnvironmentVariableGetter* Create();
-};
-
// Get the home directory.
-FilePath GetHomeDir(EnvironmentVariableGetter* env);
+FilePath GetHomeDir(EnvVarGetter* env);
// 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
// use if |env_name| cannot be found or is empty. |fallback_dir| may be NULL.
// Examples of |env_name| are XDG_CONFIG_HOME and XDG_DATA_HOME.
-FilePath GetXDGDirectory(EnvironmentVariableGetter* env,
- const char* env_name, const char* fallback_dir);
+FilePath GetXDGDirectory(EnvVarGetter* env, const char* env_name,
+ const char* fallback_dir);
// Wrapper around xdg_user_dir_lookup() from src/base/third_party/xdg-user-dirs
// This looks up "well known" user directories like the desktop and music
// folder. Examples of |dir_name| are DESKTOP and MUSIC.
-FilePath GetXDGUserDirectory(EnvironmentVariableGetter* env,
- const char* dir_name, const char* fallback_dir);
+FilePath GetXDGUserDirectory(EnvVarGetter* env, const char* dir_name,
+ const char* fallback_dir);
enum DesktopEnvironment {
DESKTOP_ENVIRONMENT_OTHER,
@@ -68,13 +57,13 @@ enum DesktopEnvironment {
// of which desktop environment we're using. We use this to know when
// to attempt to use preferences from the desktop environment --
// proxy settings, password manager, etc.
-DesktopEnvironment GetDesktopEnvironment(EnvironmentVariableGetter* env);
+DesktopEnvironment GetDesktopEnvironment(EnvVarGetter* env);
// Return a string representation of the given desktop environment.
// May return NULL in the case of DESKTOP_ENVIRONMENT_OTHER.
const char* GetDesktopEnvironmentName(DesktopEnvironment env);
// Convenience wrapper that calls GetDesktopEnvironment() first.
-const char* GetDesktopEnvironmentName(EnvironmentVariableGetter* env);
+const char* GetDesktopEnvironmentName(EnvVarGetter* env);
// Return the inode number for the UNIX domain socket |fd|.
bool FileDescriptorGetInode(ino_t* inode_out, int fd);
@@ -85,4 +74,4 @@ bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode);
} // namespace base
-#endif // BASE_LINUX_UTIL_H__
+#endif // BASE_LINUX_UTIL_H_
diff --git a/base/sys_info.h b/base/sys_info.h
index 415dc81..0f27aa7 100644
--- a/base/sys_info.h
+++ b/base/sys_info.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -31,12 +31,12 @@ class SysInfo {
static int64 AmountOfFreeDiskSpace(const FilePath& path);
// Return true if the given environment variable is defined.
- // TODO: find a better place for HasEnvVar.
+ // DEPRECATED in favor of EnvVarGetter in base/env_var.h.
static bool HasEnvVar(const wchar_t* var);
// Return the value of the given environment variable
// or an empty string if not defined.
- // TODO: find a better place for GetEnvVar.
+ // DEPRECATED in favor of EnvVarGetter in base/env_var.h.
static std::wstring GetEnvVar(const wchar_t* var);
// Returns the name of the host operating system.
diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
index 1391e64..3a54f09 100644
--- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
+++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
@@ -1,11 +1,13 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h"
+#include <string>
+
#include "app/l10n_util.h"
-#include "base/linux_util.h"
+#include "base/env_var.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/gtk/gtk_util.h"
#include "chrome/browser/shell_integration.h"
@@ -124,8 +126,7 @@ void CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut(
const ShellIntegration::ShortcutInfo& shortcut_info) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- scoped_ptr<base::EnvironmentVariableGetter> env_getter(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
std::string shortcut_template;
if (ShellIntegration::GetDesktopShortcutTemplate(env_getter.get(),
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc
index 6494657..7fee05a6 100644
--- a/chrome/browser/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/gtk/gtk_theme_provider.cc
@@ -6,7 +6,10 @@
#include <gtk/gtk.h>
+#include <set>
+
#include "app/resource_bundle.h"
+#include "base/env_var.h"
#include "base/linux_util.h"
#include "base/stl_util-inl.h"
#include "chrome/browser/metrics/user_metrics.h"
@@ -400,13 +403,11 @@ GdkPixbuf* GtkThemeProvider::GetDefaultFavicon(bool native) {
static GdkPixbuf* default_bookmark_icon_ = rb.GetPixbufNamed(
IDR_DEFAULT_FAVICON);
return default_bookmark_icon_;
-
}
// static
bool GtkThemeProvider::DefaultUsesSystemTheme() {
- scoped_ptr<base::EnvironmentVariableGetter> env_getter(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
switch (base::GetDesktopEnvironment(env_getter.get())) {
case base::DESKTOP_ENVIRONMENT_GNOME:
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index 356fa42..e3eaa79 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -7,10 +7,14 @@
#include <sys/types.h>
#include <sys/wait.h>
+#include <string>
+#include <vector>
+
#include "app/gtk_signal.h"
#include "app/gtk_util.h"
#include "app/l10n_util.h"
#include "base/basictypes.h"
+#include "base/env_var.h"
#include "base/file_util.h"
#include "base/linux_util.h"
#include "base/path_service.h"
@@ -392,8 +396,7 @@ void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button,
section->UserMetricsRecordAction(UserMetricsAction("Options_ChangeProxies"),
NULL);
- scoped_ptr<base::EnvironmentVariableGetter> env_getter(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
ProxyConfigCommand command;
bool found_command = false;
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 42adfd6..7465e11 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SHELL_INTEGRATION_H__
-#define CHROME_BROWSER_SHELL_INTEGRATION_H__
+#ifndef CHROME_BROWSER_SHELL_INTEGRATION_H_
+#define CHROME_BROWSER_SHELL_INTEGRATION_H_
#include <string>
@@ -15,9 +15,11 @@
class FilePath;
+#if defined(USE_X11)
namespace base {
-class EnvironmentVariableGetter;
+class EnvVarGetter;
}
+#endif
class ShellIntegration {
public:
@@ -73,8 +75,8 @@ class ShellIntegration {
const string16& extension_app_id);
#if defined(USE_X11)
- static bool GetDesktopShortcutTemplate(
- base::EnvironmentVariableGetter* env_getter, std::string* output);
+ static bool GetDesktopShortcutTemplate(base::EnvVarGetter* env_getter,
+ std::string* output);
// Returns filename for .desktop file based on |url|, sanitized for security.
static FilePath GetDesktopShortcutFilename(const GURL& url);
@@ -169,4 +171,4 @@ class ShellIntegration {
};
};
-#endif // CHROME_BROWSER_SHELL_INTEGRATION_H__
+#endif // CHROME_BROWSER_SHELL_INTEGRATION_H_
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index 2a03f75..19d1730 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,10 +15,10 @@
#include "base/command_line.h"
#include "base/eintr_wrapper.h"
+#include "base/env_var.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/i18n/file_util_icu.h"
-#include "base/linux_util.h"
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/process_util.h"
@@ -38,7 +38,7 @@
namespace {
-std::string GetDesktopName(base::EnvironmentVariableGetter* env_getter) {
+std::string GetDesktopName(base::EnvVarGetter* env_getter) {
#if defined(GOOGLE_CHROME_BUILD)
return "google-chrome.desktop";
#else // CHROMIUM_BUILD
@@ -46,7 +46,7 @@ std::string GetDesktopName(base::EnvironmentVariableGetter* env_getter) {
// versions can set themselves as the default without interfering with
// non-official, packaged versions using the built-in value.
std::string name;
- if (env_getter->Getenv("CHROME_DESKTOP", &name) && !name.empty())
+ if (env_getter->GetEnv("CHROME_DESKTOP", &name) && !name.empty())
return name;
return "chromium-browser.desktop";
#endif
@@ -195,8 +195,7 @@ void CreateShortcutInApplicationsMenu(const FilePath& shortcut_filename,
// static
bool ShellIntegration::SetAsDefaultBrowser() {
- scoped_ptr<base::EnvironmentVariableGetter> env_getter(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
std::vector<std::string> argv;
argv.push_back("xdg-settings");
@@ -208,8 +207,7 @@ bool ShellIntegration::SetAsDefaultBrowser() {
// static
ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() {
- scoped_ptr<base::EnvironmentVariableGetter> env_getter(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
std::vector<std::string> argv;
argv.push_back("xdg-settings");
@@ -242,19 +240,19 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() {
// static
bool ShellIntegration::GetDesktopShortcutTemplate(
- base::EnvironmentVariableGetter* env_getter, std::string* output) {
+ base::EnvVarGetter* env_getter, std::string* output) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
std::vector<FilePath> search_paths;
std::string xdg_data_home;
- if (env_getter->Getenv("XDG_DATA_HOME", &xdg_data_home) &&
+ if (env_getter->GetEnv("XDG_DATA_HOME", &xdg_data_home) &&
!xdg_data_home.empty()) {
search_paths.push_back(FilePath(xdg_data_home));
}
std::string xdg_data_dirs;
- if (env_getter->Getenv("XDG_DATA_DIRS", &xdg_data_dirs) &&
+ if (env_getter->GetEnv("XDG_DATA_DIRS", &xdg_data_dirs) &&
!xdg_data_dirs.empty()) {
StringTokenizer tokenizer(xdg_data_dirs, ":");
while (tokenizer.GetNext()) {
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index bbda7fc..4776d8d 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,7 +19,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_LINUX)
-#include "base/linux_util.h"
+#include "base/env_var.h"
#endif // defined(OS_LINUX)
#define FPL FILE_PATH_LITERAL
@@ -28,16 +28,16 @@
namespace {
// Provides mock environment variables values based on a stored map.
-class MockEnvironmentVariableGetter : public base::EnvironmentVariableGetter {
+class MockEnvVarGetter : public base::EnvVarGetter {
public:
- MockEnvironmentVariableGetter() {
+ MockEnvVarGetter() {
}
void Set(const std::string& name, const std::string& value) {
variables_[name] = value;
}
- virtual bool Getenv(const char* variable_name, std::string* result) {
+ virtual bool GetEnv(const char* variable_name, std::string* result) {
if (ContainsKey(variables_, variable_name)) {
*result = variables_[variable_name];
return true;
@@ -49,7 +49,7 @@ class MockEnvironmentVariableGetter : public base::EnvironmentVariableGetter {
private:
std::map<std::string, std::string> variables_;
- DISALLOW_COPY_AND_ASSIGN(MockEnvironmentVariableGetter);
+ DISALLOW_COPY_AND_ASSIGN(MockEnvVarGetter);
};
} // namespace
@@ -71,7 +71,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- MockEnvironmentVariableGetter env_getter;
+ MockEnvVarGetter env_getter;
env_getter.Set("XDG_DATA_HOME", temp_dir.path().value());
ASSERT_TRUE(file_util::WriteFile(
temp_dir.path().AppendASCII(kTemplateFilename),
@@ -86,7 +86,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- MockEnvironmentVariableGetter env_getter;
+ MockEnvVarGetter env_getter;
env_getter.Set("XDG_DATA_DIRS", temp_dir.path().value());
ASSERT_TRUE(file_util::CreateDirectory(
temp_dir.path().AppendASCII("applications")));
@@ -104,7 +104,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- MockEnvironmentVariableGetter env_getter;
+ MockEnvVarGetter env_getter;
env_getter.Set("XDG_DATA_DIRS", temp_dir.path().value() + ":" +
temp_dir.path().AppendASCII("applications").value());
ASSERT_TRUE(file_util::CreateDirectory(
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index b5714b2..0674c0d 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -33,7 +33,7 @@
#include "webkit/glue/dom_operations.h"
#if defined(OS_LINUX)
-#include "base/linux_util.h"
+#include "base/env_var.h"
#endif // defined(OS_LINUX)
#if defined(OS_WIN)
@@ -261,8 +261,7 @@ bool CreateShortcutTask::CreateShortcut() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
#if defined(OS_LINUX)
- scoped_ptr<base::EnvironmentVariableGetter> env_getter(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
std::string shortcut_template;
if (!ShellIntegration::GetDesktopShortcutTemplate(env_getter.get(),
diff --git a/chrome/common/chrome_paths_linux.cc b/chrome/common/chrome_paths_linux.cc
index 5a880e1..7568179 100644
--- a/chrome/common/chrome_paths_linux.cc
+++ b/chrome/common/chrome_paths_linux.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/chrome_paths_internal.h"
+#include "base/env_var.h"
#include "base/linux_util.h"
#include "base/scoped_ptr.h"
@@ -15,8 +16,7 @@ namespace chrome {
// ~/.config/google-chrome/ for official builds.
// (This also helps us sidestep issues with other apps grabbing ~/.chromium .)
bool GetDefaultUserDataDirectory(FilePath* result) {
- scoped_ptr<base::EnvironmentVariableGetter> env(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
FilePath config_dir(
base::GetXDGDirectory(env.get(), "XDG_CONFIG_HOME", ".config"));
#if defined(GOOGLE_CHROME_BUILD)
@@ -28,8 +28,7 @@ bool GetDefaultUserDataDirectory(FilePath* result) {
}
bool GetChromeFrameUserDataDirectory(FilePath* result) {
- scoped_ptr<base::EnvironmentVariableGetter> env(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
FilePath config_dir(
base::GetXDGDirectory(env.get(), "XDG_CONFIG_HOME", ".config"));
#if defined(GOOGLE_CHROME_BUILD)
@@ -41,8 +40,7 @@ bool GetChromeFrameUserDataDirectory(FilePath* result) {
}
bool GetUserDocumentsDirectory(FilePath* result) {
- scoped_ptr<base::EnvironmentVariableGetter> env(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
*result = base::GetXDGUserDirectory(env.get(), "DOCUMENTS", "Documents");
return true;
}
@@ -50,8 +48,7 @@ bool GetUserDocumentsDirectory(FilePath* result) {
// We respect the user's preferred download location, unless it is
// ~ or their desktop directory, in which case we default to ~/Downloads.
bool GetUserDownloadsDirectory(FilePath* result) {
- scoped_ptr<base::EnvironmentVariableGetter> env(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
*result = base::GetXDGUserDirectory(env.get(), "DOWNLOAD", "Downloads");
FilePath home = base::GetHomeDir(env.get());
@@ -70,8 +67,7 @@ bool GetUserDownloadsDirectory(FilePath* result) {
}
bool GetUserDesktop(FilePath* result) {
- scoped_ptr<base::EnvironmentVariableGetter> env(
- base::EnvironmentVariableGetter::Create());
+ scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
*result = base::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 a43a7e8..163b39d 100644
--- a/net/proxy/proxy_config_service_linux.cc
+++ b/net/proxy/proxy_config_service_linux.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -13,8 +13,11 @@
#include <sys/inotify.h>
#include <unistd.h>
+#include <map>
+
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/linux_util.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_tokenizer.h"
@@ -78,7 +81,7 @@ bool ProxyConfigServiceLinux::Delegate::GetProxyFromEnvVarForScheme(
const char* variable, ProxyServer::Scheme scheme,
ProxyServer* result_server) {
std::string env_value;
- if (env_var_getter_->Getenv(variable, &env_value)) {
+ if (env_var_getter_->GetEnv(variable, &env_value)) {
if (!env_value.empty()) {
env_value = FixupProxyHostScheme(scheme, env_value);
ProxyServer proxy_server =
@@ -106,7 +109,7 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromEnv(ProxyConfig* config) {
// extension has ever used this, but it still sounds like a good
// idea.
std::string auto_proxy;
- if (env_var_getter_->Getenv("auto_proxy", &auto_proxy)) {
+ if (env_var_getter_->GetEnv("auto_proxy", &auto_proxy)) {
if (auto_proxy.empty()) {
// Defined and empty => autodetect
config->set_auto_detect(true);
@@ -146,7 +149,7 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromEnv(ProxyConfig* config) {
// If the above were not defined, try for socks.
ProxyServer::Scheme scheme = ProxyServer::SCHEME_SOCKS4;
std::string env_version;
- if (env_var_getter_->Getenv("SOCKS_VERSION", &env_version)
+ if (env_var_getter_->GetEnv("SOCKS_VERSION", &env_version)
&& env_version == "5")
scheme = ProxyServer::SCHEME_SOCKS5;
if (GetProxyFromEnvVarForScheme("SOCKS_SERVER", scheme, &proxy_server)) {
@@ -156,7 +159,7 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromEnv(ProxyConfig* config) {
}
// Look for the proxy bypass list.
std::string no_proxy;
- env_var_getter_->Getenv("no_proxy", &no_proxy);
+ env_var_getter_->GetEnv("no_proxy", &no_proxy);
if (config->proxy_rules().empty()) {
// Having only "no_proxy" set, presumably to "*", makes it
// explicit that env vars do specify a configuration: having no
@@ -408,15 +411,14 @@ class GConfSettingGetterImplKDE
: public ProxyConfigServiceLinux::GConfSettingGetter,
public base::MessagePumpLibevent::Watcher {
public:
- explicit GConfSettingGetterImplKDE(
- base::EnvironmentVariableGetter* env_var_getter)
+ explicit GConfSettingGetterImplKDE(base::EnvVarGetter* env_var_getter)
: inotify_fd_(-1), notify_delegate_(NULL), indirect_manual_(false),
auto_no_pac_(false), reversed_exception_(false), file_loop_(NULL) {
// We don't save the env var getter for later use since we don't own it.
// Instead we use it here and save the result we actually care about.
std::string kde_home;
- if (!env_var_getter->Getenv("KDE_HOME", &kde_home)) {
- if (!env_var_getter->Getenv("HOME", &kde_home))
+ if (!env_var_getter->GetEnv("KDE_HOME", &kde_home)) {
+ if (!env_var_getter->GetEnv("HOME", &kde_home))
// User has no $HOME? Give up. Later we'll report the failure.
return;
kde_home = FilePath(kde_home).Append(FILE_PATH_LITERAL(".kde")).value();
@@ -961,8 +963,7 @@ bool ProxyConfigServiceLinux::Delegate::GetConfigFromGConf(
return true;
}
-ProxyConfigServiceLinux::Delegate::Delegate(
- base::EnvironmentVariableGetter* env_var_getter)
+ProxyConfigServiceLinux::Delegate::Delegate(base::EnvVarGetter* env_var_getter)
: env_var_getter_(env_var_getter),
glib_default_loop_(NULL), io_loop_(NULL) {
// Figure out which GConfSettingGetterImpl to use, if any.
@@ -980,8 +981,7 @@ ProxyConfigServiceLinux::Delegate::Delegate(
}
}
-ProxyConfigServiceLinux::Delegate::Delegate(
- base::EnvironmentVariableGetter* env_var_getter,
+ProxyConfigServiceLinux::Delegate::Delegate(base::EnvVarGetter* env_var_getter,
GConfSettingGetter* gconf_getter)
: env_var_getter_(env_var_getter), gconf_getter_(gconf_getter),
glib_default_loop_(NULL), io_loop_(NULL) {
@@ -1119,16 +1119,16 @@ void ProxyConfigServiceLinux::Delegate::OnDestroy() {
}
ProxyConfigServiceLinux::ProxyConfigServiceLinux()
- : delegate_(new Delegate(base::EnvironmentVariableGetter::Create())) {
+ : delegate_(new Delegate(base::EnvVarGetter::Create())) {
}
ProxyConfigServiceLinux::ProxyConfigServiceLinux(
- base::EnvironmentVariableGetter* env_var_getter)
+ base::EnvVarGetter* env_var_getter)
: delegate_(new Delegate(env_var_getter)) {
}
ProxyConfigServiceLinux::ProxyConfigServiceLinux(
- base::EnvironmentVariableGetter* env_var_getter,
+ base::EnvVarGetter* env_var_getter,
GConfSettingGetter* gconf_getter)
: delegate_(new Delegate(env_var_getter, gconf_getter)) {
}
diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h
index a55ba35..904441d 100644
--- a/net/proxy/proxy_config_service_linux.h
+++ b/net/proxy/proxy_config_service_linux.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,7 +9,7 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/linux_util.h"
+#include "base/env_var.h"
#include "base/message_loop.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
@@ -105,10 +105,10 @@ class ProxyConfigServiceLinux : public ProxyConfigService {
public:
// Constructor receives env var getter implementation to use, and
// takes ownership of it. This is the normal constructor.
- explicit Delegate(base::EnvironmentVariableGetter* env_var_getter);
+ explicit Delegate(base::EnvVarGetter* env_var_getter);
// Constructor receives gconf and env var getter implementations
// to use, and takes ownership of them. Used for testing.
- Delegate(base::EnvironmentVariableGetter* env_var_getter,
+ Delegate(base::EnvVarGetter* env_var_getter,
GConfSettingGetter* gconf_getter);
// Synchronously obtains the proxy configuration. If gconf is
// used, also enables gconf notification for setting
@@ -168,7 +168,7 @@ class ProxyConfigServiceLinux : public ProxyConfigService {
// carry the new config information.
void SetNewProxyConfig(const ProxyConfig& new_config);
- scoped_ptr<base::EnvironmentVariableGetter> env_var_getter_;
+ scoped_ptr<base::EnvVarGetter> env_var_getter_;
scoped_ptr<GConfSettingGetter> gconf_getter_;
// Cached proxy configuration, to be returned by
@@ -203,9 +203,8 @@ class ProxyConfigServiceLinux : public ProxyConfigService {
// Usual constructor
ProxyConfigServiceLinux();
// For testing: take alternate gconf and env var getter implementations.
- explicit ProxyConfigServiceLinux(
- base::EnvironmentVariableGetter* env_var_getter);
- ProxyConfigServiceLinux(base::EnvironmentVariableGetter* env_var_getter,
+ explicit ProxyConfigServiceLinux(base::EnvVarGetter* env_var_getter);
+ ProxyConfigServiceLinux(base::EnvVarGetter* env_var_getter,
GConfSettingGetter* gconf_getter);
virtual ~ProxyConfigServiceLinux() {
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index 689b8b6..e6afb43 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -77,9 +77,9 @@ struct SettingsTable {
map_type settings;
};
-class MockEnvironmentVariableGetter : public base::EnvironmentVariableGetter {
+class MockEnvVarGetter : public base::EnvVarGetter {
public:
- MockEnvironmentVariableGetter() {
+ MockEnvVarGetter() {
#define ENTRY(x) table.settings[#x] = &values.x
ENTRY(DESKTOP_SESSION);
ENTRY(KDE_HOME);
@@ -101,7 +101,7 @@ class MockEnvironmentVariableGetter : public base::EnvironmentVariableGetter {
values = zero_values;
}
- virtual bool Getenv(const char* variable_name, std::string* result) {
+ virtual bool GetEnv(const char* variable_name, std::string* result) {
const char* env_value = table.Get(variable_name);
if (env_value) {
// Note that the variable may be defined but empty.
@@ -576,8 +576,7 @@ TEST_F(ProxyConfigServiceLinuxTest, BasicGConfTest) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i,
tests[i].description.c_str()));
- MockEnvironmentVariableGetter* env_getter =
- new MockEnvironmentVariableGetter;
+ MockEnvVarGetter* env_getter = new MockEnvVarGetter;
MockGConfSettingGetter* gconf_getter = new MockGConfSettingGetter;
SynchConfigGetter sync_config_getter(
new ProxyConfigServiceLinux(env_getter, gconf_getter));
@@ -844,8 +843,7 @@ TEST_F(ProxyConfigServiceLinuxTest, BasicEnvTest) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i,
tests[i].description.c_str()));
- MockEnvironmentVariableGetter* env_getter =
- new MockEnvironmentVariableGetter;
+ MockEnvVarGetter* env_getter = new MockEnvVarGetter;
MockGConfSettingGetter* gconf_getter = new MockGConfSettingGetter;
SynchConfigGetter sync_config_getter(
new ProxyConfigServiceLinux(env_getter, gconf_getter));
@@ -861,8 +859,7 @@ TEST_F(ProxyConfigServiceLinuxTest, BasicEnvTest) {
}
TEST_F(ProxyConfigServiceLinuxTest, GconfNotification) {
- MockEnvironmentVariableGetter* env_getter =
- new MockEnvironmentVariableGetter;
+ MockEnvVarGetter* env_getter = new MockEnvVarGetter;
MockGConfSettingGetter* gconf_getter = new MockGConfSettingGetter;
ProxyConfigServiceLinux* service =
new ProxyConfigServiceLinux(env_getter, gconf_getter);
@@ -1166,8 +1163,7 @@ TEST_F(ProxyConfigServiceLinuxTest, KDEConfigParser) {
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i,
tests[i].description.c_str()));
- MockEnvironmentVariableGetter* env_getter =
- new MockEnvironmentVariableGetter;
+ MockEnvVarGetter* env_getter = new MockEnvVarGetter;
// Force the KDE getter to be used and tell it where the test is.
env_getter->values.DESKTOP_SESSION = "kde4";
env_getter->values.KDE_HOME = kde_home_.value().c_str();