diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 03:00:50 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 03:00:50 +0000 |
commit | 76b90d310def447b7b5f10d92a69813308150778 (patch) | |
tree | 24c61fdccf94360913bfa8f7ac67c24a27bcfb38 /chrome/browser/shell_integration_linux.cc | |
parent | 7f2a9dbe56bfa6189271af808c53ccaee193a961 (diff) | |
download | chromium_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/shell_integration_linux.cc')
-rw-r--r-- | chrome/browser/shell_integration_linux.cc | 22 |
1 files changed, 11 insertions, 11 deletions
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); |