Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux support #205

Merged
merged 9 commits into from
Jul 5, 2018
Merged

Linux support #205

merged 9 commits into from
Jul 5, 2018

Conversation

simonhong
Copy link
Member

@simonhong simonhong commented Jun 29, 2018

  • Use brave app icon on all channel.
  • Add nightly channel support on linux
  • Cleanup channel info related code

Issue: brave/brave-browser#10
Close brave/brave-browser#340
Close brave/brave-browser#461

TODO: image files should be checked by design team.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

Test Plan:

yarn test brave_browser_tests --filter=BraveResourcesBrowserTest.*
yarn test brave_browser_tests --filter=BraveViewsDelegateLinuxBrowserTest.*
yarn test brave_unit_tests --filter=BraveChannelInfoTest.*

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

@simonhong simonhong self-assigned this Jun 29, 2018
@simonhong simonhong requested a review from darkdh June 29, 2018 05:43
@simonhong simonhong changed the title Apply brave's beta and dev app icon in official build Apply brave's beta and dev app icon in linux official build Jun 29, 2018
@simonhong simonhong changed the title Apply brave's beta and dev app icon in linux official build Change app icon and cleanup channel info code on linux Jun 30, 2018
simonhong referenced this pull request Jul 2, 2018
Brave support four different user dir depends on channel.
* Brave-Browser for stable release
* Brave-Browser-Beta for beta release
* Brave-Browser-Dev for dev release
* Brave-Development for unofficial build

Canary channel isn't supported on linux.

Channel suffixes are determined from $CHROME_VERSION_EXTRA, which is
passed by the launch wrapper script.
For more detail, see src/docs/user_data_dir.md#Linux
@simonhong simonhong requested a review from bridiver July 2, 2018 23:09
+#include "brave/common/brave_channel_info_linux.h"
+#endif
+
namespace chrome {

using base::nix::GetXDGDirectory;
@@ -87,10 +91,18 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) {
@@ -87,10 +91,14 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do a method override here instead of patch as discussed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -16,11 +17,18 @@ std::string GetChannelSuffixForDataDir() {

// Chrome doesn't support canary channel on linux.
if (modifier == "unstable") // linux version of "dev"
modifier = "dev";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use defines in a gni config as suggested https://github.com/brave/brave-core/pull/208/files#r199649672 we can remove some or all of this logic and just return the value from the gn define

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise I'm concerned about the two getting out of sync

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many unit test and browser test that uses this modifier.
So, if someone make inconsistency between c++ and gn, it can be easily detected. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unified all linux channel infos to brave/build/linux and used it in c++.
PTAL.

@simonhong simonhong force-pushed the app_icon_linux branch 3 times, most recently from 13dd130 to 0486495 Compare July 3, 2018 07:19
@simonhong simonhong changed the title Change app icon and cleanup channel info code on linux WIP: Change app icon and cleanup channel info code on linux Jul 3, 2018
@simonhong simonhong force-pushed the app_icon_linux branch 2 times, most recently from cf3b194 to 031183a Compare July 3, 2018 14:26
@simonhong simonhong changed the title WIP: Change app icon and cleanup channel info code on linux Change app icon and cleanup channel info code on linux Jul 4, 2018
@simonhong simonhong force-pushed the app_icon_linux branch 3 times, most recently from 5de783a to 5e65f49 Compare July 4, 2018 03:02
@simonhong simonhong changed the title Change app icon and cleanup channel info code on linux Linux support Jul 4, 2018
@simonhong
Copy link
Member Author

simonhong commented Jul 4, 2018

Sorry, additional nightly channel support commit is added to this PR because nightly supports depends on this PR.
So, this PR's title is changed to a little bit general.
Please check each commit's message.

@simonhong
Copy link
Member Author

I think preparing nightly build release is almost done with this PR.

Channel determining logic is unified to brave::GetChannelImpl().
…Linux

They are subclass of ChromeViewsDelegate and
ChromeBrowserMainExtraPartsViewsLinux.
They are introduced to override ChromeViewsDelegate::GetWindowIcon() in
chrome_views_delegate_linux.cc.
BraveViewsDelegateLinuxBrowserTest.GetDefaultWindowIconTest checks
whether proper image is returned from ViewsDelegate::GetDefaultWindowIcon()
linux_channel_stable = "stable"
linux_channel_beta = "beta"
linux_channel_dev = "unstable"
linux_channel_nightly = "nightly"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change this to brave_linux_channel_nightly which is not in upstream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

linux_channel_nightly = "nightly"

# Our channel name and upstream linux channel name is different.
linux_channel_name = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. forgot to delete. done.

Define channel in brave/build/linux/BUILD.gn and use it in C++ world.
Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@simonhong simonhong merged commit 6cd4cdf into master Jul 5, 2018
@simonhong simonhong deleted the app_icon_linux branch July 5, 2018 21:58
#include "chrome/services/file_util/public/mojom/constants.mojom.h"
#endif

+#if defined(BRAVE_CHROMIUM_BUILD) && defined(OS_LINUX)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonhong can you remove these patches in a follow-up? The chromium_src subclass override I mentioned on slack would work well here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact in this case you subclass the ViewsDelegateLinux and you won't even need BraveBrowserMainExtraPartsViewLinux

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #230

linux_package("unstable") {
channel = "unstable"
}
+linux_package("nightly") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be added in a brave build file or does it have to be here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add this in a brave build, we need to copy linux_package template in here to us.
So, I added this here to avoid copy.

@@ -25,3 +25,13 @@ index 261faeaf26f34f2e89229579ae7933e23e4299e6..201aacd532ea70067279ec970134f3b2
mv "$RPMBUILD_DIR/RPMS/$ARCHITECTURE/${PKGNAME}.${ARCHITECTURE}.rpm" \
"${OUTPUTDIR}"
# Make sure the package is world-readable, otherwise it causes problems when
@@ -146,6 +150,9 @@ verify_channel() {
unstable|dev|alpha )
CHANNEL=unstable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually can we use unstable as nightly or do we need both?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need both - linux uses unstable and dev both for dev channel.

fmarier pushed a commit that referenced this pull request Oct 29, 2019
petemill pushed a commit that referenced this pull request Jul 27, 2020
petemill pushed a commit that referenced this pull request Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants