summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/shell_integration_linux.cc19
-rwxr-xr-xchrome/tools/build/linux/chrome-wrapper3
2 files changed, 17 insertions, 5 deletions
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index 2d2cb05..814ceff 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -14,11 +14,22 @@
#include "base/process_util.h"
+static const char* GetDesktopName() {
#if defined(GOOGLE_CHROME_BUILD)
-#define DESKTOP_APP_NAME "google-chrome.desktop"
+ return "google-chrome.desktop";
#else // CHROMIUM_BUILD
-#define DESKTOP_APP_NAME "chromium-browser.desktop"
+ static const char* name = NULL;
+ if (!name) {
+ // Allow $CHROME_DESKTOP to override the built-in value, so that development
+ // versions can set themselves as the default without interfering with
+ // non-official, packaged versions using the built-in value.
+ name = getenv("CHROME_DESKTOP");
+ if (!name)
+ name = "chromium-browser.desktop";
+ }
+ return name;
#endif
+}
// We delegate the difficult of setting the default browser in Linux desktop
// environments to a new xdg utility, xdg-settings. We'll have to include a copy
@@ -30,7 +41,7 @@ bool ShellIntegration::SetAsDefaultBrowser() {
argv.push_back("xdg-settings");
argv.push_back("set");
argv.push_back("default-web-browser");
- argv.push_back(DESKTOP_APP_NAME);
+ argv.push_back(GetDesktopName());
// xdg-settings internally runs xdg-mime, which uses mv to move newly-created
// files on top of originals after making changes to them. In the event that
@@ -77,7 +88,7 @@ bool ShellIntegration::IsDefaultBrowser() {
// Allow for an optional newline at the end.
if (browser.length() > 0 && browser[browser.length() - 1] == '\n')
browser.resize(browser.length() - 1);
- return !browser.compare(DESKTOP_APP_NAME);
+ return !browser.compare(GetDesktopName());
}
bool ShellIntegration::IsFirefoxDefaultBrowser() {
diff --git a/chrome/tools/build/linux/chrome-wrapper b/chrome/tools/build/linux/chrome-wrapper
index 7792e9b..72a3e3e 100755
--- a/chrome/tools/build/linux/chrome-wrapper
+++ b/chrome/tools/build/linux/chrome-wrapper
@@ -7,7 +7,7 @@
# Running Chromium via this script makes it possible to set Chromium as the
# default browser directly out of a compile, without needing to package it.
-DESKTOP="chromium-browser"
+DESKTOP="chromium-devel"
TITLE="Chromium"
# Check to see if there is a desktop file of the given name
@@ -44,6 +44,7 @@ EOF
# Let the wrapped binary know that it has been run through the wrapper
export CHROME_WRAPPER="`readlink -f "$0"`"
+export CHROME_DESKTOP="$DESKTOP.desktop"
HERE="`dirname "$CHROME_WRAPPER"`"