summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 03:00:50 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 03:00:50 +0000
commit76b90d310def447b7b5f10d92a69813308150778 (patch)
tree24c61fdccf94360913bfa8f7ac67c24a27bcfb38 /chrome/browser
parent7f2a9dbe56bfa6189271af808c53ccaee193a961 (diff)
downloadchromium_src-76b90d310def447b7b5f10d92a69813308150778.zip
chromium_src-76b90d310def447b7b5f10d92a69813308150778.tar.gz
chromium_src-76b90d310def447b7b5f10d92a69813308150778.tar.bz2
base: Rename EnvVarGetter to Environment.
Now EnvVarGetter do much more than getting environment variables. Per suggestion from Pawel in http://codereview.chromium.org/3043018/. BUG=None TEST=trybots Signed-off-by: Thiago Farina <tfarina@chromium.org> Review URL: http://codereview.chromium.org/3052034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_init.cc4
-rw-r--r--chrome/browser/dom_ui/advanced_options_utils_gtk.cc8
-rw-r--r--chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc6
-rw-r--r--chrome/browser/gtk/gconf_titlebar_listener.cc6
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.cc6
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc8
-rw-r--r--chrome/browser/locale_tests_uitest.cc4
-rw-r--r--chrome/browser/net/url_fixer_upper.cc2
-rw-r--r--chrome/browser/profile.cc1
-rw-r--r--chrome/browser/profile_impl.cc6
-rw-r--r--chrome/browser/renderer_host/audio_renderer_host_unittest.cc4
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc4
-rw-r--r--chrome/browser/shell_integration.h4
-rw-r--r--chrome/browser/shell_integration_linux.cc22
-rw-r--r--chrome/browser/shell_integration_unittest.cc26
-rw-r--r--chrome/browser/web_applications/web_app.cc6
-rw-r--r--chrome/browser/zygote_host_linux.cc4
17 files changed, 60 insertions, 61 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 66c8b35..c5d8355 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -8,7 +8,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/event_recorder.h"
#include "base/histogram.h"
#include "base/path_service.h"
@@ -312,7 +312,7 @@ LaunchMode GetLaunchShortcutKind() {
// The windows quick launch path is not localized.
if (shortcut.find(L"\\Quick Launch\\") != std::wstring::npos)
return LM_SHORTCUT_QUICKLAUNCH;
- scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
std::string appdata_path;
env->GetEnv("USERPROFILE", &appdata_path);
if (!appdata_path.empty() &&
diff --git a/chrome/browser/dom_ui/advanced_options_utils_gtk.cc b/chrome/browser/dom_ui/advanced_options_utils_gtk.cc
index 6cbf8d6..95c4824 100644
--- a/chrome/browser/dom_ui/advanced_options_utils_gtk.cc
+++ b/chrome/browser/dom_ui/advanced_options_utils_gtk.cc
@@ -9,7 +9,7 @@
#include "app/gtk_signal.h"
#include "app/gtk_util.h"
#include "base/file_util.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/process_util.h"
#include "base/string_tokenizer.h"
#include "base/xdg_util.h"
@@ -81,11 +81,11 @@ static void StartProxyConfigUtil(const ProxyConfigCommand& command) {
void AdvancedOptionsUtilities::ShowNetworkProxySettings(
TabContents* tab_contents) {
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
ProxyConfigCommand command;
bool found_command = false;
- switch (base::GetDesktopEnvironment(env_getter.get())) {
+ switch (base::GetDesktopEnvironment(env.get())) {
case base::DESKTOP_ENVIRONMENT_GNOME: {
size_t index;
ProxyConfigCommand commands[2];
@@ -115,7 +115,7 @@ void AdvancedOptionsUtilities::ShowNetworkProxySettings(
if (found_command) {
StartProxyConfigUtil(command);
} else {
- const char* name = base::GetDesktopEnvironmentName(env_getter.get());
+ const char* name = base::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/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
index 41eebda8..0d41355 100644
--- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
+++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc
@@ -8,7 +8,7 @@
#include "app/gtk_util.h"
#include "app/l10n_util.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/gtk/gtk_util.h"
#include "chrome/browser/shell_integration.h"
@@ -187,10 +187,10 @@ void CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut(
const ShellIntegration::ShortcutInfo& shortcut_info) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
std::string shortcut_template;
- if (ShellIntegration::GetDesktopShortcutTemplate(env_getter.get(),
+ if (ShellIntegration::GetDesktopShortcutTemplate(env.get(),
&shortcut_template)) {
ShellIntegration::CreateDesktopShortcut(shortcut_info,
shortcut_template);
diff --git a/chrome/browser/gtk/gconf_titlebar_listener.cc b/chrome/browser/gtk/gconf_titlebar_listener.cc
index 109ed996..b33ab17 100644
--- a/chrome/browser/gtk/gconf_titlebar_listener.cc
+++ b/chrome/browser/gtk/gconf_titlebar_listener.cc
@@ -7,7 +7,7 @@
#include <gtk/gtk.h>
#include "base/scoped_ptr.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/xdg_util.h"
#include "chrome/browser/gtk/browser_titlebar.h"
@@ -45,8 +45,8 @@ void GConfTitlebarListener::RemoveObserver(BrowserTitlebar* titlebar) {
// Private:
GConfTitlebarListener::GConfTitlebarListener() : client_(NULL) {
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
- if (base::GetDesktopEnvironment(env_getter.get()) ==
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ if (base::GetDesktopEnvironment(env.get()) ==
base::DESKTOP_ENVIRONMENT_GNOME) {
client_ = gconf_client_get_default();
// If we fail to get a context, that's OK, since we'll just fallback on
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc
index 9a982d0..577c6d1 100644
--- a/chrome/browser/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/gtk/gtk_theme_provider.cc
@@ -10,7 +10,7 @@
#include "app/gtk_signal_registrar.h"
#include "app/resource_bundle.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/stl_util-inl.h"
#include "base/xdg_util.h"
#include "chrome/browser/metrics/user_metrics.h"
@@ -563,9 +563,9 @@ GdkPixbuf* GtkThemeProvider::GetDefaultFavicon(bool native) {
// static
bool GtkThemeProvider::DefaultUsesSystemTheme() {
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
- switch (base::GetDesktopEnvironment(env_getter.get())) {
+ switch (base::GetDesktopEnvironment(env.get())) {
case base::DESKTOP_ENVIRONMENT_GNOME:
case base::DESKTOP_ENVIRONMENT_XFCE:
return true;
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index 1c12391..15650b2 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -14,7 +14,7 @@
#include "app/gtk_util.h"
#include "app/l10n_util.h"
#include "base/basictypes.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/process_util.h"
@@ -421,11 +421,11 @@ void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button,
section->UserMetricsRecordAction(UserMetricsAction("Options_ChangeProxies"),
NULL);
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
ProxyConfigCommand command;
bool found_command = false;
- switch (base::GetDesktopEnvironment(env_getter.get())) {
+ switch (base::GetDesktopEnvironment(env.get())) {
case base::DESKTOP_ENVIRONMENT_GNOME: {
size_t index;
ProxyConfigCommand commands[2];
@@ -455,7 +455,7 @@ void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button,
if (found_command) {
StartProxyConfigUtil(command);
} else {
- const char* name = base::GetDesktopEnvironmentName(env_getter.get());
+ const char* name = base::GetDesktopEnvironmentName(env.get());
if (name)
LOG(ERROR) << "Could not find " << name << " network settings in $PATH";
BrowserList::GetLastActive()->
diff --git a/chrome/browser/locale_tests_uitest.cc b/chrome/browser/locale_tests_uitest.cc
index d5cb994..94cefdb 100644
--- a/chrome/browser/locale_tests_uitest.cc
+++ b/chrome/browser/locale_tests_uitest.cc
@@ -4,7 +4,7 @@
#include "chrome/test/ui/ui_test.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "build/build_config.h"
class LocaleTestsBase : public UITest {
@@ -15,7 +15,7 @@ class LocaleTestsBase : public UITest {
protected:
void RestoreLcAllEnvironment() {
#if defined(OS_LINUX)
- scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
if (old_lc_all_) {
env->SetEnv("LC_ALL", old_lc_all_);
} else {
diff --git a/chrome/browser/net/url_fixer_upper.cc b/chrome/browser/net/url_fixer_upper.cc
index 92b69db..3aad8f2 100644
--- a/chrome/browser/net/url_fixer_upper.cc
+++ b/chrome/browser/net/url_fixer_upper.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_util.h"
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index f2cd905..02ac436 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -6,7 +6,6 @@
#include "app/resource_bundle.h"
#include "base/command_line.h"
-#include "base/env_var.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index 6c085f7..7e8f133 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -6,7 +6,7 @@
#include "app/resource_bundle.h"
#include "base/command_line.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -863,8 +863,8 @@ void ProfileImpl::CreatePasswordStore() {
} else if (store_type == L"gnome") {
desktop_env = base::DESKTOP_ENVIRONMENT_GNOME;
} else if (store_type == L"detect") {
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
- desktop_env = base::GetDesktopEnvironment(env_getter.get());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ desktop_env = base::GetDesktopEnvironment(env.get());
LOG(INFO) << "Password storage detected desktop environment: " <<
base::GetDesktopEnvironmentName(desktop_env);
} else {
diff --git a/chrome/browser/renderer_host/audio_renderer_host_unittest.cc b/chrome/browser/renderer_host/audio_renderer_host_unittest.cc
index 0af6cd2..6a428d4 100644
--- a/chrome/browser/renderer_host/audio_renderer_host_unittest.cc
+++ b/chrome/browser/renderer_host/audio_renderer_host_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/env_var.h"
+#include "base/environment.h"
#include "base/message_loop.h"
#include "base/process_util.h"
#include "base/scoped_ptr.h"
@@ -29,7 +29,7 @@ static const int kRouteId = 200;
static const int kStreamId = 50;
static bool IsRunningHeadless() {
- scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
if (env->HasEnv("CHROME_HEADLESS"))
return true;
return false;
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 3e9d5db..886c805 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "base/base64.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/file_version_info.h"
#include "base/histogram.h"
#include "base/logging.h"
@@ -418,7 +418,7 @@ bool SafeBrowsingProtocolManager::HandleServiceResponse(const GURL& url,
void SafeBrowsingProtocolManager::Initialize() {
// Don't want to hit the safe browsing servers on build/chrome bots.
- scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
if (env->HasEnv(env_vars::kHeadless))
return;
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 1080c30..23d0701 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -18,7 +18,7 @@ class FilePath;
#if defined(USE_X11)
namespace base {
-class EnvVarGetter;
+class Environment;
}
#endif
@@ -78,7 +78,7 @@ class ShellIntegration {
const string16& extension_app_id);
#if defined(USE_X11)
- static bool GetDesktopShortcutTemplate(base::EnvVarGetter* env_getter,
+ static bool GetDesktopShortcutTemplate(base::Environment* env,
std::string* output);
// Returns filename for .desktop file based on |url|, sanitized for security.
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index 95b3e85..27b5a9b 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -15,7 +15,7 @@
#include "base/command_line.h"
#include "base/eintr_wrapper.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/i18n/file_util_icu.h"
@@ -41,7 +41,7 @@
namespace {
-std::string GetDesktopName(base::EnvVarGetter* env_getter) {
+std::string GetDesktopName(base::Environment* env) {
#if defined(GOOGLE_CHROME_BUILD)
return "google-chrome.desktop";
#else // CHROMIUM_BUILD
@@ -49,7 +49,7 @@ std::string GetDesktopName(base::EnvVarGetter* 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->GetEnv("CHROME_DESKTOP", &name) && !name.empty())
return name;
return "chromium-browser.desktop";
#endif
@@ -201,13 +201,13 @@ void CreateShortcutInApplicationsMenu(const FilePath& shortcut_filename,
// static
bool ShellIntegration::SetAsDefaultBrowser() {
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
std::vector<std::string> argv;
argv.push_back("xdg-settings");
argv.push_back("set");
argv.push_back("default-web-browser");
- argv.push_back(GetDesktopName(env_getter.get()));
+ argv.push_back(GetDesktopName(env.get()));
return LaunchXdgUtility(argv);
}
@@ -215,13 +215,13 @@ bool ShellIntegration::SetAsDefaultBrowser() {
ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
std::vector<std::string> argv;
argv.push_back("xdg-settings");
argv.push_back("check");
argv.push_back("default-web-browser");
- argv.push_back(GetDesktopName(env_getter.get()));
+ argv.push_back(GetDesktopName(env.get()));
std::string reply;
if (!base::GetAppOutput(CommandLine(argv), &reply)) {
@@ -248,19 +248,19 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() {
// static
bool ShellIntegration::GetDesktopShortcutTemplate(
- base::EnvVarGetter* env_getter, std::string* output) {
+ base::Environment* env, 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->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->GetEnv("XDG_DATA_DIRS", &xdg_data_dirs) &&
!xdg_data_dirs.empty()) {
StringTokenizer tokenizer(xdg_data_dirs, ":");
while (tokenizer.GetNext()) {
@@ -275,7 +275,7 @@ bool ShellIntegration::GetDesktopShortcutTemplate(
search_paths.push_back(FilePath("/usr/share/applications"));
search_paths.push_back(FilePath("/usr/local/share/applications"));
- std::string template_filename(GetDesktopName(env_getter));
+ std::string template_filename(GetDesktopName(env));
for (std::vector<FilePath>::const_iterator i = search_paths.begin();
i != search_paths.end(); ++i) {
FilePath path = (*i).Append(template_filename);
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index dbaa290..708bf3c 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -21,7 +21,7 @@
#if defined(OS_WIN)
#include "chrome/installer/util/browser_distribution.h"
#elif defined(OS_LINUX)
-#include "base/env_var.h"
+#include "base/environment.h"
#endif // defined(OS_LINUX)
#define FPL FILE_PATH_LITERAL
@@ -30,9 +30,9 @@
namespace {
// Provides mock environment variables values based on a stored map.
-class MockEnvVarGetter : public base::EnvVarGetter {
+class MockEnvironment : public base::Environment {
public:
- MockEnvVarGetter() {}
+ MockEnvironment() {}
void Set(const std::string& name, const std::string& value) {
variables_[name] = value;
@@ -60,7 +60,7 @@ class MockEnvVarGetter : public base::EnvVarGetter {
private:
std::map<std::string, std::string> variables_;
- DISALLOW_COPY_AND_ASSIGN(MockEnvVarGetter);
+ DISALLOW_COPY_AND_ASSIGN(MockEnvironment);
};
} // namespace
@@ -82,13 +82,13 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- MockEnvVarGetter env_getter;
- env_getter.Set("XDG_DATA_HOME", temp_dir.path().value());
+ MockEnvironment env;
+ env.Set("XDG_DATA_HOME", temp_dir.path().value());
ASSERT_TRUE(file_util::WriteFile(
temp_dir.path().AppendASCII(kTemplateFilename),
kTestData1, strlen(kTestData1)));
std::string contents;
- ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env_getter,
+ ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env,
&contents));
EXPECT_EQ(kTestData1, contents);
}
@@ -97,8 +97,8 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- MockEnvVarGetter env_getter;
- env_getter.Set("XDG_DATA_DIRS", temp_dir.path().value());
+ MockEnvironment env;
+ env.Set("XDG_DATA_DIRS", temp_dir.path().value());
ASSERT_TRUE(file_util::CreateDirectory(
temp_dir.path().AppendASCII("applications")));
ASSERT_TRUE(file_util::WriteFile(
@@ -106,7 +106,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
.AppendASCII(kTemplateFilename),
kTestData2, strlen(kTestData2)));
std::string contents;
- ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env_getter,
+ ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env,
&contents));
EXPECT_EQ(kTestData2, contents);
}
@@ -115,8 +115,8 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- MockEnvVarGetter env_getter;
- env_getter.Set("XDG_DATA_DIRS", temp_dir.path().value() + ":" +
+ MockEnvironment env;
+ env.Set("XDG_DATA_DIRS", temp_dir.path().value() + ":" +
temp_dir.path().AppendASCII("applications").value());
ASSERT_TRUE(file_util::CreateDirectory(
temp_dir.path().AppendASCII("applications")));
@@ -128,7 +128,7 @@ TEST(ShellIntegrationTest, GetDesktopShortcutTemplate) {
.AppendASCII(kTemplateFilename),
kTestData2, strlen(kTestData2)));
std::string contents;
- ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env_getter,
+ ASSERT_TRUE(ShellIntegration::GetDesktopShortcutTemplate(&env,
&contents));
EXPECT_EQ(kTestData1, contents);
}
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index df01bd5..dea6f74 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -33,7 +33,7 @@
#include "webkit/glue/dom_operations.h"
#if defined(OS_LINUX)
-#include "base/env_var.h"
+#include "base/environment.h"
#endif // defined(OS_LINUX)
#if defined(OS_WIN)
@@ -259,10 +259,10 @@ bool CreateShortcutTask::CreateShortcut() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
#if defined(OS_LINUX)
- scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
std::string shortcut_template;
- if (!ShellIntegration::GetDesktopShortcutTemplate(env_getter.get(),
+ if (!ShellIntegration::GetDesktopShortcutTemplate(env.get(),
&shortcut_template)) {
return false;
}
diff --git a/chrome/browser/zygote_host_linux.cc b/chrome/browser/zygote_host_linux.cc
index 4d9189f..4ede333 100644
--- a/chrome/browser/zygote_host_linux.cc
+++ b/chrome/browser/zygote_host_linux.cc
@@ -11,7 +11,7 @@
#include "base/command_line.h"
#include "base/eintr_wrapper.h"
-#include "base/env_var.h"
+#include "base/environment.h"
#include "base/linux_util.h"
#include "base/logging.h"
#include "base/path_service.h"
@@ -40,7 +40,7 @@ static void SaveSUIDUnsafeEnvironmentVariables() {
if (!saved_envvar)
continue;
- scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
std::string value;
if (env->GetEnv(envvar, &value))
env->SetEnv(saved_envvar, value);