diff --git a/BUILD.gn b/BUILD.gn index 321476b612d9..9d269046c13d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -6,6 +6,11 @@ import("//third_party/icu/config.gni") import("//build/config/locales.gni") import("//media/cdm/library_cdm/cdm_paths.gni") +if (is_mac) { + import("//build/config/mac/rules.gni") + import("//brave/build/mac/tweak_info_plist.gni") +} + group("child_dependencies") { public_deps = [ "//brave/renderer", @@ -351,3 +356,59 @@ action("create_dist_zips") { "--output=$rebase_output", ] } + +if (is_mac) { + brave_tweak_info_plist("brave_app_plist") { + info_plist = "$root_gen_dir/chrome/chrome_app_plist_tweaked.plist" + + args = [ + "--brave_channel=" + brave_channel, + "--brave_feed_url=" + brave_feed_url, + "--brave_dsa_file=" + brave_dsa_file, + ] + + deps = [ + "//chrome:chrome_app_plist", + ] + } + + mac_app_bundle("chrome_app") { + output_name = chrome_product_full_name + + info_plist_target = ":brave_app_plist" + + extra_substitutions = [ + "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", + "CHROMIUM_SHORT_NAME=$chrome_product_short_name", + "CHROMIUM_CREATOR=$chrome_mac_creator_code", + ] + + sources = [ + "//chrome/app/chrome_exe_main_mac.cc", + ] + + extra_configs = [ "//build/config/compiler:wexit_time_destructors" ] + + deps = [ + "//brave/vendor/sparkle:sparkle_resources_bundle_data", + "//chrome:chrome_app_strings_bundle_data", + "//chrome:chrome_resources", + "//chrome:chrome_versioned_bundle_data", + "//build/config:exe_and_shlib_deps", + "//chrome/common:version_header", + ] + + if (is_chrome_branded) { + deps += [ "chrome:chrome_helpers" ] + } + + # Remove the default strip configuration (which strips all symbols) so that + # a saves file can be specified. + if (enable_stripping) { + remove_configs = [ "//build/config/mac:strip_all" ] + + ldflags = + [ "-Wcrl,strip,-s," + rebase_path("//chrome/app/app.saves", root_build_dir) ] + } + } +} diff --git a/DEPS b/DEPS index 7ce6b8765170..0d7f55dfd957 100644 --- a/DEPS +++ b/DEPS @@ -9,6 +9,7 @@ deps = { "vendor/requests": "https://github.com/kennethreitz/requests@e4d59bedfd3c7f4f254f4f5d036587bcd8152458", "vendor/boto": "https://github.com/boto/boto@f7574aa6cc2c819430c1f05e9a1a1a666ef8169b", "vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403", + "vendor/sparkle": "https://github.com/brave/Sparkle.git@c0759cce415d7c0feae45005c8a013b1898711f0", } hooks = [ diff --git a/app/mac/BUILD.gn b/app/mac/BUILD.gn index 30306c02772c..60fa2751ec12 100644 --- a/app/mac/BUILD.gn +++ b/app/mac/BUILD.gn @@ -49,7 +49,7 @@ action("generate_breakpad_symbols") { ] deps = [ - "//chrome:chrome_app", + "//brave:chrome_app", "//chrome:chrome_framework", "//chrome:chrome_helper_app", "//chrome:chrome_dump_syms", diff --git a/brave_init_settings.gni b/brave_init_settings.gni index 07e6778c0129..af8be8d10a18 100644 --- a/brave_init_settings.gni +++ b/brave_init_settings.gni @@ -7,4 +7,11 @@ declare_args() { # "canary" for canary channel release. # "" for stable channel release. brave_channel = "" + + # Update feed url on MacOS + # TODO(simonhong): This url is stub. Replace with real update server or your + # test server. + brave_feed_url = "http://localhost:9090" + + brave_dsa_file = "dsa_pub.pem" } diff --git a/browser/BUILD.gn b/browser/BUILD.gn index 490463f3d621..dd5aff6dae62 100644 --- a/browser/BUILD.gn +++ b/browser/BUILD.gn @@ -25,6 +25,10 @@ source_set("browser_process") { "importer/brave_profile_writer.h", "importer/chrome_profile_lock.cc", "importer/chrome_profile_lock.h", + "brave_app_controller_mac.mm", + "brave_app_controller_mac.h", + "sparkle_glue_mac.mm", + "sparkle_glue_mac.h", ] deps = [ @@ -53,4 +57,10 @@ source_set("browser") { "net", "ui", ] + + if (is_mac) { + deps += [ + "//brave/vendor/sparkle:sparkle_framework_bundle_data" + ] + } } diff --git a/browser/brave_app_controller_mac.h b/browser/brave_app_controller_mac.h new file mode 100644 index 000000000000..fe748c086b8d --- /dev/null +++ b/browser/brave_app_controller_mac.h @@ -0,0 +1,18 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_BROWSER_BRAVE_APP_CONTROLLER_MAC_H_ +#define BRAVE_BROWSER_BRAVE_APP_CONTROLLER_MAC_H_ + +#if defined(__OBJC__) + +#import "chrome/browser/app_controller_mac.h" + +@interface BraveAppController : AppController + +@end + +#endif // __OBJC__ + +#endif // BRAVE_BROWSER_BRAVE_APP_CONTROLLER_MAC_H_ diff --git a/browser/brave_app_controller_mac.mm b/browser/brave_app_controller_mac.mm new file mode 100644 index 000000000000..f8f0dd5fd4d0 --- /dev/null +++ b/browser/brave_app_controller_mac.mm @@ -0,0 +1,124 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#import "brave/browser/brave_app_controller_mac.h" + +#include + +#import "brave/browser/sparkle_glue_mac.h" +#include "base/command_line.h" +#include "base/strings/sys_string_conversions.h" +#include "brave/common/brave_switches.h" + +namespace { + +BOOL UpdateEnabled() { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableBraveUpdateTest); +} + +std::string GetDescriptionFromAppcastItem(id item) { + return [SparkleGlue descriptionFromAppcastItem:item]; +} + +} + +@implementation BraveAppController +{ + SparkleGlue* sparkle_glue_; +} + +- (void)applicationWillFinishLaunching:(NSNotification*)notification { + [super applicationWillFinishLaunching:notification]; + + if (!UpdateEnabled()) + return; + + [self initializeBraveUpdater]; +} + +- (BOOL)validateUserInterfaceItem:(id)item { + if ([super validateUserInterfaceItem:item]) + return YES; + + return [item action] == @selector(updateBrave:) ? UpdateEnabled() : NO; +} + +- (IBAction)updateBrave:(id)sender { + DCHECK(UpdateEnabled()); + + [sparkle_glue_ checkForUpdates:sender]; +} + +- (void)initializeBraveUpdater { + DCHECK(UpdateEnabled()); + + sparkle_glue_ = [SparkleGlue sharedSparkleGlue]; + [sparkle_glue_ setDelegate:self]; +} + +#pragma mark - SUUpdaterDelegate + +- (void)updater:(id)updater didFinishLoadingAppcast:(id)appcast { + VLOG(0) << "brave update: did finish loading appcast"; +} + +- (void)updater:(id)updater didFindValidUpdate:(id)item { + VLOG(0) << "brave update: did finish valid update with " + + GetDescriptionFromAppcastItem(item); +} + +- (void)updaterDidNotFindUpdate:(id)updater { + VLOG(0) << "brave update: did not find update"; +} + +- (void)updater:(id)updater + willDownloadUpdate:(id)item + withRequest:(NSMutableURLRequest *)request { + VLOG(0) << "brave update: willDownloadUpdate with " + + GetDescriptionFromAppcastItem(item); +} + +- (void)updater:(id)updater + failedToDownloadUpdate:(id)item + error:(NSError *)error { + VLOG(0) << "brave update: failed to download update with " + + GetDescriptionFromAppcastItem(item) + + " with error - " + [[error description] UTF8String]; +} + +- (void)userDidCancelDownload:(id)updater { + VLOG(0) << "brave update: user did cancel download"; +} + +- (void)updater:(id)updater willInstallUpdate:(id)item { + VLOG(0) << "brave update: will install update with " + + GetDescriptionFromAppcastItem(item); +} + +- (void)updaterWillRelaunchApplication:(id)updater { + VLOG(0) << "brave update: will relaunch application"; +} + +- (void)updaterDidRelaunchApplication:(id)updater { + VLOG(0) << "brave update: did relaunch application"; +} + +- (void)updater:(id)updater + willInstallUpdateOnQuit:(id)item + immediateInstallationInvocation:(NSInvocation *)invocation { + VLOG(0) << "brave update: will install update on quit with " + + GetDescriptionFromAppcastItem(item); +} + +- (void)updater:(id)updater didCancelInstallUpdateOnQuit:(id)item { + VLOG(0) << "brave update: did cancel install update on quit with " + + GetDescriptionFromAppcastItem(item); +} + +- (void)updater:(id)updater didAbortWithError:(NSError *)error { + VLOG(0) << [[error description] UTF8String]; +} + +@end // @implementation BraveAppController diff --git a/browser/sparkle_glue_mac.h b/browser/sparkle_glue_mac.h new file mode 100644 index 000000000000..558096a5a27b --- /dev/null +++ b/browser/sparkle_glue_mac.h @@ -0,0 +1,29 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_BROWSER_SPARKLE_GLUE_MAC_H_ +#define BRAVE_BROWSER_SPARKLE_GLUE_MAC_H_ + +#include + +#if defined(__OBJC__) + +#import + +@interface SparkleGlue : NSObject + ++ (instancetype)sharedSparkleGlue; + ++ (std::string)descriptionFromAppcastItem:(id)item; + +- (instancetype)init; + +- (void)setDelegate:(id)delegate; +- (void)checkForUpdates:(id)sender; + +@end // @interface SparkleGlue + +#endif // __OBJC__ + +#endif // BRAVE_BROWSER_SPARKLE_GLUE_MAC_H_ diff --git a/browser/sparkle_glue_mac.mm b/browser/sparkle_glue_mac.mm new file mode 100644 index 000000000000..06da2a48c2ba --- /dev/null +++ b/browser/sparkle_glue_mac.mm @@ -0,0 +1,62 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#import "brave/browser/sparkle_glue_mac.h" + +#include "base/mac/bundle_locations.h" + +namespace { + +id GetSUUpdater() { + NSString* sparkle_path = + [[base::mac::FrameworkBundle() privateFrameworksPath] + stringByAppendingPathComponent:@"Sparkle.framework"]; + + NSBundle* sparkle_bundle = [NSBundle bundleWithPath:sparkle_path]; + [sparkle_bundle load]; + + Class sparkle_class = [sparkle_bundle classNamed:@"SUUpdater"]; + return [sparkle_class performSelector:NSSelectorFromString(@"sharedUpdater")]; +} + +} + +@implementation SparkleGlue +{ + id su_updater_; +} + ++ (instancetype)sharedSparkleGlue { + static SparkleGlue* shared; + if (shared == nil) + shared = [[SparkleGlue alloc] init]; + return shared; +} + ++ (std::string)descriptionFromAppcastItem:(id)item { + NSString* description = + [NSString stringWithFormat:@"AppcastItem(Date: %@, Version: %@)", + [item performSelector:NSSelectorFromString(@"dateString")], + [item performSelector:NSSelectorFromString(@"versionString")]]; + return [description UTF8String]; +} + +- (instancetype)init { + if (self = [super init]) { + su_updater_ = GetSUUpdater(); + return self; + } else { + return nil; + } +} + +- (void)setDelegate:(id)delegate { + [su_updater_ setDelegate:delegate]; +} + +- (void)checkForUpdates:(id)sender { + [su_updater_ checkForUpdates:sender]; +} + +@end diff --git a/build/mac/tweak_info_plist.gni b/build/mac/tweak_info_plist.gni new file mode 100644 index 000000000000..e2591a2c6f2d --- /dev/null +++ b/build/mac/tweak_info_plist.gni @@ -0,0 +1,51 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. + +# Template to run the tweak_info_plist.py script on a plist. +# +# Arguments: +# +# info_plist: +# (optional), string, the plist to tweak. +# +# args: +# (optional), list of string, the arguments to pass to the +# tweak_info_plist.py script. +# +# Callers should use get_target_outputs() to get the output name. One of +# info_plist or info_plists must be specified. +template("brave_tweak_info_plist") { + _output_name = "$target_gen_dir/${target_name}_tweaked.plist" + + assert(defined(invoker.info_plist), + "The info_plist must be specified in $target_name") + + _source_name = invoker.info_plist + _deps = invoker.deps + + action(target_name) { + forward_variables_from(invoker, + [ + "args", + "testonly", + ]) + script = "//brave/build/mac/tweak_info_plist.py" + sources = [ + _source_name, + ] + outputs = [ + _output_name, + ] + if (!defined(args)) { + args = [] + } + args += [ + "--plist", + rebase_path(_source_name, root_build_dir), + "--output", + rebase_path(_output_name, root_build_dir), + ] + deps = _deps + } +} diff --git a/build/mac/tweak_info_plist.py b/build/mac/tweak_info_plist.py new file mode 100644 index 000000000000..c35e0c6df895 --- /dev/null +++ b/build/mac/tweak_info_plist.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. + +# +# Xcode supports build variable substitutions and CPP; sadly, that doesn't work +# because: +# +# 1. Xcode wants to do the Info.plist work before it runs any build phases, +# this means if we were to generate a .h file for INFOPLIST_PREFIX_HEADER +# we'd have to put it in another target so it runs in time. +# 2. Xcode also doesn't check to see if the header being used as a prefix for +# the Info.plist has changed. So even if we updated it, it's only looking +# at the modtime of the info.plist to see if that's changed. +# +# So, we work around all of this by making a script build phase that will run +# during the app build, and simply update the info.plist in place. This way +# by the time the app target is done, the info.plist is correct. +# + +import optparse +import os +import plistlib +import re +import subprocess +import sys +import tempfile + +def _ConvertPlist(source_plist, output_plist, fmt): + """Convert |source_plist| to |fmt| and save as |output_plist|.""" + return subprocess.call( + ['plutil', '-convert', fmt, '-o', output_plist, source_plist]) + + +def _RemoveKeys(plist, *keys): + """Removes a varargs of keys from the plist.""" + for key in keys: + try: + del plist[key] + except KeyError: + pass + + +def Main(argv): + parser = optparse.OptionParser('%prog [options]') + parser.add_option('--plist', dest='plist_path', action='store', + type='string', default=None, help='The path of the plist to tweak.') + parser.add_option('--output', dest='plist_output', action='store', + type='string', default=None, help='If specified, the path to output ' + \ + 'the tweaked plist, rather than overwriting the input.') + parser.add_option('--brave_channel', dest='brave_channel', action='store', + type='string', default=None, help='Channel (beta, dev, canary)') + parser.add_option('--brave_feed_url', dest='brave_feed_url', action='store', + type='string', default=None, help='Target url for update feed') + parser.add_option('--brave_dsa_file', dest='brave_dsa_file', action='store', + type='string', default=None, help='Public DSA file for update') + parser.add_option('--format', choices=('binary1', 'xml1', 'json'), + default='xml1', help='Format to use when writing property list ' + '(default: %(default)s)') + (options, args) = parser.parse_args(argv) + + if len(args) > 0: + print >>sys.stderr, parser.get_usage() + return 1 + + if not options.plist_path: + print >>sys.stderr, 'No --plist specified.' + return 1 + + # Read the plist into its parsed format. Convert the file to 'xml1' as + # plistlib only supports that format in Python 2.7. + with tempfile.NamedTemporaryFile() as temp_info_plist: + retcode = _ConvertPlist(options.plist_path, temp_info_plist.name, 'xml1') + if retcode != 0: + return retcode + plist = plistlib.readPlist(temp_info_plist.name) + + output_path = options.plist_path + if options.plist_output is not None: + output_path = options.plist_output + + if options.brave_channel: + plist['KSChannelID'] = options.brave_channel + + if options.brave_feed_url: + plist['SUFeedURL'] = options.brave_feed_url + + if options.brave_dsa_file: + plist['SUPublicDSAKeyFile'] = options.brave_dsa_file + + # Explicitly disable profiling + plist['SUEnableSystemProfiling'] = False + + # Now that all keys have been mutated, rewrite the file. + with tempfile.NamedTemporaryFile() as temp_info_plist: + plistlib.writePlist(plist, temp_info_plist.name) + + # Convert Info.plist to the format requested by the --format flag. Any + # format would work on Mac but iOS requires specific format. + return _ConvertPlist(temp_info_plist.name, output_path, options.format) + + +if __name__ == '__main__': + sys.exit(Main(sys.argv[1:])) diff --git a/common/brave_switches.cc b/common/brave_switches.cc index 773ff8b7a0ed..d1ad3f4ea289 100644 --- a/common/brave_switches.cc +++ b/common/brave_switches.cc @@ -11,4 +11,13 @@ namespace switches { // in debug mode with auto-reloading. const char kDisableBraveExtension[] = "disable-brave-extension"; +// This switch enables update module(Sparkle). +// When you use this flag for update test, make sure to fix the feed URL +// |brave_feed_url| in brave/brave_init_settings.gni. +// This switch is introduced for update feature development. +// When update test is fininshed, update module should be enabled only in +// official build. +// TODO(shong): Remove this switch when update development is done. +const char kEnableBraveUpdateTest[] = "enable-brave-update-test"; + } // namespace switches diff --git a/common/brave_switches.h b/common/brave_switches.h index 58b659e171cf..b85984b87605 100644 --- a/common/brave_switches.h +++ b/common/brave_switches.h @@ -11,6 +11,8 @@ namespace switches { // alongside the definition of their values in the .cc file. extern const char kDisableBraveExtension[]; +extern const char kEnableBraveUpdateTest[]; + } // namespace switches #endif // BRAVE_COMMON_BRAVE_SWITCHES_H_ diff --git a/patches/build-mac-tweak_info_plist.py.patch b/patches/build-mac-tweak_info_plist.py.patch deleted file mode 100644 index 72d4f6b1768c..000000000000 --- a/patches/build-mac-tweak_info_plist.py.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/build/mac/tweak_info_plist.py b/build/mac/tweak_info_plist.py -index 9ea794b1517fa2e65ac2c6a38b3176ec52a7b544..353081e3035cdd0d4dc5ebf347dbdb5ab8ef48c7 100755 ---- a/build/mac/tweak_info_plist.py -+++ b/build/mac/tweak_info_plist.py -@@ -248,6 +248,9 @@ def Main(argv): - default=True, help='Add SCM metadata [1 or 0]') - parser.add_option('--branding', dest='branding', action='store', - type='string', default=None, help='The branding of the binary') -+ # BRAVE(shong): Add channel support -+ parser.add_option('--brave_channel', dest='brave_channel', action='store', -+ type='string', default=None, help='Channel (beta, dev, canary)') - parser.add_option('--bundle_id', dest='bundle_identifier', - action='store', type='string', default=None, - help='The bundle id of the binary') -@@ -353,6 +356,10 @@ def Main(argv): - if options.plist_output is not None: - output_path = options.plist_output - -+ # BRAVE(shong): Add channel support -+ if options.brave_channel: -+ plist['KSChannelID'] = options.brave_channel -+ - # Now that all keys have been mutated, rewrite the file. - with tempfile.NamedTemporaryFile() as temp_info_plist: - plistlib.writePlist(plist, temp_info_plist.name) diff --git a/patches/chrome-BUILD.gn.patch b/patches/chrome-BUILD.gn.patch index 527f9b19ceb8..dc21eed2a417 100644 --- a/patches/chrome-BUILD.gn.patch +++ b/patches/chrome-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8f55aac9f 100644 +index fbcf20cd0411d39a99642acf2674bf7de2804608..c5037cd38a8495f28f28917aab05bbefb2b0c2b0 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -182,6 +182,15 @@ if (!is_android && !is_mac) { @@ -65,20 +65,29 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 group("chrome") { deps = [ -@@ -595,6 +612,12 @@ if (is_win) { - "--scm=1", - "--bundle_id=$chrome_mac_bundle_id", +@@ -597,6 +614,13 @@ if (is_win) { ] -+ -+ if (brave_chromium_build) { -+ args += [ -+ "--brave_channel=" + brave_channel, -+ ] -+ } } ++if (brave_chromium_build) { ++ group("chrome_app") { ++ deps = [ ++ "//brave:chrome_app", ++ ] ++ } ++} else { mac_app_bundle("chrome_app") { -@@ -663,7 +686,7 @@ if (is_win) { + output_name = chrome_product_full_name + +@@ -634,6 +658,7 @@ if (is_win) { + [ "-Wcrl,strip,-s," + rebase_path("app/app.saves", root_build_dir) ] + } + } ++} + + compiled_action("chrome_app_strings") { + tool = "//chrome/tools/build/mac:infoplist_strings_tool" +@@ -663,7 +688,7 @@ if (is_win) { args = [ "-b", @@ -87,7 +96,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 "-v", rebase_path(chrome_version_file, root_build_dir), "-g", -@@ -712,6 +735,23 @@ if (is_win) { +@@ -712,6 +737,23 @@ if (is_win) { "app/theme/$branding_path_component/mac/document.icns", "browser/ui/cocoa/applescript/scripting.sdef", ] @@ -111,7 +120,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}", ] -@@ -1207,6 +1247,8 @@ if (is_win) { +@@ -1207,6 +1249,8 @@ if (is_win) { "app/chrome_main.cc", "app/chrome_main_delegate.cc", "app/chrome_main_delegate.h", @@ -120,7 +129,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 "app/chrome_main_mac.h", "app/chrome_main_mac.mm", ] -@@ -1271,6 +1313,7 @@ if (is_win) { +@@ -1271,6 +1315,7 @@ if (is_win) { public_deps = [ ":chrome_dll", @@ -128,7 +137,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 ] deps = [ -@@ -1446,6 +1489,7 @@ if (is_win) { +@@ -1446,6 +1491,7 @@ if (is_win) { group("browser_dependencies") { public_deps = [ @@ -136,7 +145,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 "//chrome/browser", "//chrome/common", "//components/sync", -@@ -1482,6 +1526,7 @@ group("browser_dependencies") { +@@ -1482,6 +1528,7 @@ group("browser_dependencies") { group("child_dependencies") { public_deps = [ @@ -144,7 +153,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 "//chrome/browser/devtools", "//chrome/child", "//chrome/common", -@@ -1503,7 +1548,7 @@ group("child_dependencies") { +@@ -1503,7 +1550,7 @@ group("child_dependencies") { if (is_win) { process_version_rc_template("chrome_exe_version") { sources = [ @@ -153,7 +162,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 ] output = "$target_gen_dir/chrome_exe_version.rc" } -@@ -1798,6 +1843,8 @@ if (is_android) { +@@ -1798,6 +1845,8 @@ if (is_android) { "app/android/chrome_main_delegate_android.h", "app/chrome_main_delegate.cc", "app/chrome_main_delegate.h", @@ -162,7 +171,7 @@ index fbcf20cd0411d39a99642acf2674bf7de2804608..0de616c33d867fae4b2760d55360b7f8 ] include_dirs = [ android_ndk_include_dir ] -@@ -1853,7 +1900,7 @@ if (is_linux) { +@@ -1853,7 +1902,7 @@ if (is_linux) { dump_syms_binary = get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms" diff --git a/patches/chrome-app-nibs-MainMenu.xib.patch b/patches/chrome-app-nibs-MainMenu.xib.patch new file mode 100644 index 000000000000..400920aa6e63 --- /dev/null +++ b/patches/chrome-app-nibs-MainMenu.xib.patch @@ -0,0 +1,25 @@ +diff --git a/chrome/app/nibs/MainMenu.xib b/chrome/app/nibs/MainMenu.xib +index dbe2f9e9187706991898271355a14323472a3a06..4afe47e1db4835be17b71b309474ef493c3f75c2 100644 +--- a/chrome/app/nibs/MainMenu.xib ++++ b/chrome/app/nibs/MainMenu.xib +@@ -26,6 +26,11 @@ + + + ++ ++ ++ ++ ++ + + + +@@ -574,7 +579,7 @@ CA + + + +- ++ + + + diff --git a/patches/chrome-test-BUILD.gn.patch b/patches/chrome-test-BUILD.gn.patch index 01080025cf2f..c026b631918e 100644 --- a/patches/chrome-test-BUILD.gn.patch +++ b/patches/chrome-test-BUILD.gn.patch @@ -1,12 +1,16 @@ diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index 330d0b5e16a3dcf936c214c85b8d174ce1e66287..4dcfd070b632d1374989981bcbaa97cd334b7869 100644 +index 330d0b5e16a3dcf936c214c85b8d174ce1e66287..dbbe35c0f2adef605448b1ff37fb43898372c3a0 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -339,6 +339,7 @@ test("browser_tests") { - configs += [ "//build/config:precompiled_headers" ] +@@ -355,6 +355,11 @@ test("browser_tests") { + "//third_party/WebKit/public:features", + ] - deps = [ -+ "//brave/test:brave_browser_tests_deps", - ":browser_tests_runner", - ":test_support", - "//base", ++ if (brave_chromium_build) { ++ deps += [ ++ "//brave/test:brave_browser_tests_deps", ++ ] ++ } + data_deps = [ + "//testing/buildbot/filters:browser_tests_filters", + "//tools/media_engagement_preload:generator", diff --git a/test/BUILD.gn b/test/BUILD.gn index fa01fb9f0236..807d68bede43 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -62,9 +62,9 @@ test("brave_unit_tests") { group("brave_browser_tests_deps") { deps = [ - "//brave:browser_dependencies", - "//brave:child_dependencies", - "//brave:brave" + "//brave:browser_dependencies", + "//brave:child_dependencies", + "//brave:brave", ] }