diff options
author | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 12:35:56 +0000 |
---|---|---|
committer | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-27 12:35:56 +0000 |
commit | fcd21d329f97f83b9cf04155b763741d42f4c400 (patch) | |
tree | 87f76e7c3f71ef8b991781a579540ea8a69afe44 /chrome/browser/shell_integration_linux.cc | |
parent | 0f691261f33a2aff625b6b984446ce86a16cf166 (diff) | |
download | chromium_src-fcd21d329f97f83b9cf04155b763741d42f4c400.zip chromium_src-fcd21d329f97f83b9cf04155b763741d42f4c400.tar.gz chromium_src-fcd21d329f97f83b9cf04155b763741d42f4c400.tar.bz2 |
Linux app shortcuts execute the Chrome wrapper script, not the binary directly.
Fixes a regression in SVN 197857.
BUG=247574
TEST=Run Chromium with chrome-wrapper or Chrome with google-chrome wrapper
script, then create an app shortcut. The .desktop file should link to
chrome-wrapper or google-chrome.
TEST=Run Chromium or Chrome with chrome binary directly, then create an app
shortcut. The .desktop file should link to chrome.
Review URL: https://chromiumcodereview.appspot.com/17839002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208897 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_linux.cc')
-rw-r--r-- | chrome/browser/shell_integration_linux.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index b843abc..bb20550 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -438,6 +438,22 @@ bool GetNoDisplayFromDesktopFile(const std::string& shortcut_contents) { return nodisplay; } +// Gets the path to the Chrome executable or wrapper script. +// Returns an empty path if the executable path could not be found. +base::FilePath GetChromeExePath() { + // Try to get the name of the wrapper script that launched Chrome. + scoped_ptr<base::Environment> environment(base::Environment::Create()); + std::string wrapper_script; + if (environment->GetVar("CHROME_WRAPPER", &wrapper_script)) { + return base::FilePath(wrapper_script); + } + + // Just return the name of the executable path for Chrome. + base::FilePath chrome_exe_path; + PathService::Get(base::FILE_EXE, &chrome_exe_path); + return chrome_exe_path; +} + } // namespace // static @@ -786,9 +802,8 @@ bool CreateDesktopShortcut( bool success = true; - // Get the path to the Chrome executable. - base::FilePath chrome_exe_path; - if (!PathService::Get(base::FILE_EXE, &chrome_exe_path)) { + base::FilePath chrome_exe_path = GetChromeExePath(); + if (chrome_exe_path.empty()) { LOG(WARNING) << "Could not get executable path."; return false; } |