summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_applications
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 10:29:04 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 10:29:04 +0000
commitaf71d648c150826278086efb7a718a9da5728cde (patch)
tree14cbfdd65ac3d7ac0caaa583a0293d2abba2fbe8 /chrome/browser/web_applications
parentceefd3dc54b0126bec1298a129b0ca4361e7ab7b (diff)
downloadchromium_src-af71d648c150826278086efb7a718a9da5728cde.zip
chromium_src-af71d648c150826278086efb7a718a9da5728cde.tar.gz
chromium_src-af71d648c150826278086efb7a718a9da5728cde.tar.bz2
Add missing tests for Linux desktop shortcuts logic.
This also makes the code use EnvironmentVariableGetter instead of calling getenv directly because we need the control in tests. This is a follow-up after http://codereview.chromium.org/607001 TEST=ShellIntegrationTest.GetDesktopShortcutTemplate BUG=30785 Review URL: http://codereview.chromium.org/798002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_applications')
-rw-r--r--chrome/browser/web_applications/web_app.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index 0a9f582..3767616 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -14,6 +14,7 @@
#include "base/callback.h"
#include "base/file_util.h"
+#include "base/linux_util.h"
#include "base/md5.h"
#include "base/message_loop.h"
#include "base/path_service.h"
@@ -256,9 +257,14 @@ bool CreateShortcutTask::CreateShortcut() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
#if defined(OS_LINUX)
+ scoped_ptr<base::EnvironmentVariableGetter> env_getter(
+ base::EnvironmentVariableGetter::Create());
+
std::string shortcut_template;
- if (!ShellIntegration::GetDesktopShortcutTemplate(&shortcut_template))
+ if (!ShellIntegration::GetDesktopShortcutTemplate(env_getter.get(),
+ &shortcut_template)) {
return false;
+ }
ShellIntegration::CreateDesktopShortcut(shortcut_info_, shortcut_template);
return true; // assuming always success.
#elif defined(OS_WIN)