From 5389ab0359a0708645156da4aabf6e37114cd375 Mon Sep 17 00:00:00 2001 From: Simon Hong Date: Thu, 15 Nov 2018 14:55:22 +0900 Subject: [PATCH] Make brave browser set as a default browser in linux With this PR, all channel except nightly can be a default browser. --- ...e-browser-shell_integration_linux.cc.patch | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/patches/chrome-browser-shell_integration_linux.cc.patch b/patches/chrome-browser-shell_integration_linux.cc.patch index e7e52dc02428..7a37ec4e7c4f 100644 --- a/patches/chrome-browser-shell_integration_linux.cc.patch +++ b/patches/chrome-browser-shell_integration_linux.cc.patch @@ -1,8 +1,25 @@ diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc -index bfd0f1c16666ef8071b00e9a1f85e80b9806ed87..dcfff5e3b9fd84ad852fcb4de180f9631b9a4a28 100644 +index bfd0f1c16666ef8071b00e9a1f85e80b9806ed87..031127a027327ce98355e7166b0d0633f4263519 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc -@@ -431,7 +431,7 @@ std::string GetDesktopName(base::Environment* env) { +@@ -425,13 +425,24 @@ std::string GetDesktopName(base::Environment* env) { + return "google-chrome.desktop"; + } + #else // CHROMIUM_BUILD ++#if defined(OFFICIAL_BUILD) ++ version_info::Channel product_channel(chrome::GetChannel()); ++ switch (product_channel) { ++ case version_info::Channel::DEV: ++ return "brave-browser-dev.desktop"; ++ case version_info::Channel::BETA: ++ return "brave-browser-beta.desktop"; ++ default: ++ return "brave-browser.desktop"; ++ } ++#endif // defined(OFFICIAL_BUILD) + // 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. std::string name; if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) return name; @@ -11,7 +28,7 @@ index bfd0f1c16666ef8071b00e9a1f85e80b9806ed87..dcfff5e3b9fd84ad852fcb4de180f963 #endif } -@@ -439,7 +439,7 @@ std::string GetIconName() { +@@ -439,7 +450,7 @@ std::string GetIconName() { #if defined(GOOGLE_CHROME_BUILD) return "google-chrome"; #else // CHROMIUM_BUILD