From 3756343828952c8c6b793016caae1d815cb1d194 Mon Sep 17 00:00:00 2001 From: Max <41635752+mkarolin@users.noreply.github.com> Date: Wed, 9 Dec 2020 00:13:49 -0500 Subject: [PATCH 01/16] Merge pull request #6957 from brave/cr88 Upgrade from Chromium 87 to Chromium 88. --- android/BUILD.gn | 1 - android/brave_java_sources.gni | 3 +- android/java/apk_for_test.flags | 6 +- .../chrome/browser/BraveAppHooks.java | 11 +- .../chrome/browser/BraveRewardsHelper.java | 4 +- .../chrome/browser/app/BraveActivity.java | 11 +- .../BraveTabbedAppMenuPropertiesDelegate.java | 6 +- ...java => BraveHelpAndFeedbackLauncher.java} | 5 +- .../RetentionNotificationPublisher.java | 8 +- .../BraveEditUrlSuggestionProcessor.java | 2 +- .../settings/BraveMainPreferencesBase.java | 2 +- .../BraveTabbedRootUiCoordinator.java | 16 +- .../browser/toolbar/BraveHomeButton.java | 39 ++- .../browser/toolbar/BraveToolbarManager.java | 85 +++++-- .../bottom/BottomToolbarCoordinator.java | 86 ++++--- .../BraveBottomControlsCoordinator.java | 39 +-- ...crollingBottomViewResourceFrameLayout.java | 53 ++++ .../BrowsingModeBottomToolbarCoordinator.java | 47 +--- .../BraveMenuButtonCoordinator.java | 8 + .../toolbar/top/BraveToolbarLayout.java | 72 +++--- .../top/BraveTopToolbarCoordinator.java | 14 +- .../crypto/binance/BinanceBuyFragment.java | 2 +- .../binance/BinanceConvertFragment.java | 2 +- .../binance/BinanceDepositFragment.java | 4 +- .../res/layout/bottom_control_container.xml | 4 +- .../chromium/chrome/browser/BytecodeTest.java | 7 +- app/brave_main_delegate.cc | 10 +- app/brave_main_delegate_browsertest.cc | 4 +- app/brave_strings.grd | 2 +- app/extensions_strings.grdp | 3 + app/generated_resources.grd | 190 +++++++++----- app/generated_resources_override.grd | 20 +- app/global_media_controls_strings.grdp | 6 + app/nearby_share_strings.grdp | 23 +- app/nearby_share_strings_override.grdp | 2 +- app/os_settings_search_tag_strings.grdp | 24 +- app/os_settings_strings.grdp | 106 ++++++-- app/printing_strings.grdp | 10 + app/profiles_strings.grdp | 8 + app/settings_brave_strings.grdp | 27 -- app/settings_strings.grdp | 239 +++++++++++++++--- app/settings_strings_override.grdp | 3 + app/shared_settings_strings.grdp | 18 +- app/sharesheet_strings.grdp | 3 + app/vector_icons/BUILD.gn | 2 +- browser/BUILD.gn | 1 + browser/android/brave_sync_worker.cc | 20 +- browser/brave_content_browser_client.cc | 7 +- browser/brave_content_browser_client.h | 5 +- ...rave_content_browser_client_browsertest.cc | 161 ++++++------ .../brave_stats_updater_browsertest.cc | 1 + .../brave_clear_browsing_data_browsertest.cc | 1 + browser/extensions/api/binance_api.cc | 48 ++-- browser/extensions/api/brave_rewards_api.cc | 225 ++++++++--------- browser/extensions/api/brave_shields_api.cc | 29 +-- browser/extensions/api/brave_theme_api.cc | 4 +- browser/extensions/api/brave_together_api.cc | 3 +- browser/extensions/api/brave_wallet_api.cc | 25 +- browser/extensions/api/crypto_dot_com_api.cc | 27 +- browser/extensions/api/gemini_api.cc | 42 ++- browser/extensions/api/greaselion_api.cc | 4 +- browser/extensions/api/ipfs_api.cc | 15 +- ...avigator_useragent_farbling_browsertest.cc | 1 + browser/net/url_context.cc | 2 +- ...kmark_model_loaded_observer_browsertest.cc | 1 + browser/resources/extensions/BUILD.gn | 63 ++--- .../resources/extensions/brave_unpack.stamp | 0 .../extensions/extensions_resources.grd | 21 -- browser/resources/resource_ids | 12 +- browser/resources/settings/BUILD.gn | 140 +++++++--- .../brave_help_tips_page.html | 7 +- browser/resources/settings/brave_unpack.stamp | 0 .../resources/settings/settings_resources.grd | 150 ----------- .../settings_resources_generated.grdp | 130 ---------- .../tor/tor_profile_manager_browsertest.cc | 1 + browser/ui/BUILD.gn | 4 +- .../strings/android_chrome_strings.grd | 141 +++++++++-- .../android_chrome_strings_override.grd | 4 + .../brave_content_setting_bubble_model.cc | 80 ------ .../brave_content_setting_bubble_model.h | 18 -- .../bookmark_bar_instructions_view.cc | 2 +- ...ayback_machine_infobar_button_container.cc | 6 +- ...wayback_machine_infobar_button_container.h | 7 +- ...e_wayback_machine_infobar_contents_view.cc | 22 +- ...ve_wayback_machine_infobar_contents_view.h | 6 +- .../profiles/brave_avatar_toolbar_button.cc | 2 +- browser/ui/views/toolbar/bookmark_button.cc | 6 +- browser/ui/views/toolbar/bookmark_button.h | 2 +- .../ui/views/toolbar/brave_toolbar_view.cc | 4 +- .../ui/views/toolbar/speedreader_button.cc | 7 +- browser/ui/views/toolbar/speedreader_button.h | 3 +- .../translate/brave_translate_bubble_view.cc | 16 +- .../translate/brave_translate_bubble_view.h | 2 +- .../brave_translate_bubble_view_unittest.cc | 4 +- browser/ui/webui/brave_settings_ui.cc | 2 +- build/android/BUILD.gn | 1 + build/android/bytecode/BUILD.gn | 1 + .../bytecode/BraveActivityClassAdapter.java | 18 ++ .../org/brave/bytecode/BraveClassAdapter.java | 1 + .../BraveToolbarManagerClassAdapter.java | 6 - .../chrome/browser/browser_about_handler.cc | 17 +- .../chrome/browser/search/instant_service.cc | 2 +- .../chrome/browser/search/instant_service.h | 6 +- .../chrome/browser/ui/browser_navigator.cc | 5 +- .../content_setting_bubble_model.cc | 29 --- .../content_setting_bubble_model.h | 19 -- .../permission_prompt_bubble_view.cc | 18 +- .../ui/webui/extensions/extensions_ui.cc | 2 +- .../chrome/browser/ui/webui/webui_util.cc | 22 -- .../chrome/common/chrome_constants.cc | 11 +- chromium_src/chrome/utility/services.cc | 15 +- .../core/browser/content_settings_registry.cc | 8 +- .../renderer/content_settings_agent_impl.cc | 6 +- .../renderer/content_settings_agent_impl.h | 8 +- .../core/favicon_database_browsertest.cc | 1 + .../browser/application_context_impl.mm | 7 + .../ios/chrome/browser/prefs/browser_prefs.mm | 2 +- .../net/base/network_isolation_key.cc | 19 -- chromium_src/net/base/network_isolation_key.h | 17 -- .../third_party/blink/common/features.cc | 2 +- .../blink/renderer/core/frame/navigator.cc | 14 +- .../modules/plugins/dom_plugin_array.cc | 15 +- .../modules/storage/dom_window_storage.cc | 4 +- chromium_src/ui/base/webui/web_ui_util.cc | 18 +- common/resource_bundle_helper.cc | 1 - .../browser/ads_service_browsertest.cc | 1 + .../brave_ads/browser/ads_service_impl.cc | 2 +- .../test/rewards_database_browsertest.cc | 1 + .../browser/test/rewards_state_browsertest.cc | 1 + components/brave_sync/BUILD.gn | 1 - components/brave_sync/brave_sync_prefs.cc | 4 +- components/brave_sync/brave_sync_prefs.h | 7 +- .../buildflags/buildflags.gni | 2 +- components/components_strings.grd | 13 + components/components_strings_override.grd | 2 + .../brave_content_settings_agent_impl.cc | 2 +- ...t_settings_agent_impl_flash_browsertest.cc | 197 --------------- .../brave_ipfs_client_updater_browsertest.cc | 1 + components/new_or_sad_tab_strings.grdp | 45 ++++ components/ntp_snippets_strings.grdp | 2 +- components/page_info_strings.grdp | 8 +- components/policy_strings.grdp | 7 +- components/subresource_filter_strings.grdp | 19 ++ components/vector_icons/BUILD.gn | 2 +- components/webxr_strings.grdp | 14 + ios/browser/api/sync/brave_sync_worker.cc | 5 - .../proxy_config_service_tor.cc | 2 +- patches/base-BUILD.gn.patch | 4 +- patches/build-config-BUILDCONFIG.gn.patch | 4 +- patches/build-config-android-config.gni.patch | 6 +- ...ld-config-android-internal_rules.gni.patch | 4 +- patches/build-config-android-rules.gni.patch | 4 +- patches/build-config-compiler-BUILD.gn.patch | 4 +- patches/chrome-BUILD.gn.patch | 24 +- patches/chrome-VERSION.patch | 8 +- patches/chrome-android-BUILD.gn.patch | 12 +- ...rome-android-chrome_java_sources.gni.patch | 6 +- ...e-android-chrome_public_apk_tmpl.gni.patch | 6 +- ...d-expectations-lint-suppressions.xml.patch | 4 +- ...ome-android-java-AndroidManifest.xml.patch | 28 +- ...a-res-layout-custom_tabs_toolbar.xml.patch | 4 +- ...hromium-chrome-browser-AppHooks.java.patch | 4 +- ...me-browser-ChromeTabbedActivity.java.patch | 29 +-- ...ut_settings-AboutChromeSettings.java.patch | 2 +- ...-settings-AccessibilitySettings.java.patch | 4 +- ...rome-browser-app-ChromeActivity.java.patch | 4 +- ...textualSearchPreferenceFragment.java.patch | 8 +- ...epage-settings-HomepageSettings.java.patch | 2 +- ...r-native_page-NativePageFactory.java.patch | 4 +- ...ions-NotificationPlatformBridge.java.patch | 2 +- ...ations-NotificationServiceImpl.java.patch} | 10 +- ...DropdownItemViewInfoListBuilder.java.patch | 4 +- ...nager-settings-PasswordSettings.java.patch | 2 +- ...rivacy-settings-PrivacySettings.java.patch | 2 +- ...rowser-sync-AndroidSyncSettings.java.patch | 4 +- ...ync-settings-ManageSyncSettings.java.patch | 2 +- ...ettings-SyncAndServicesSettings.java.patch | 2 +- ...e-browser-toolbar-ToolbarColors.java.patch | 6 +- ...-browser-toolbar-ToolbarManager.java.patch | 21 +- ...ottom-BottomControlsCoordinator.java.patch | 4 +- ...rowser-toolbar-top-ToolbarPhone.java.patch | 20 +- ...owser-toolbar-top-ToolbarTablet.java.patch | 10 +- ...cing-settings-DeveloperSettings.java.patch | 2 +- ...me-browser-ui-RootUiCoordinator.java.patch | 10 +- patches/chrome-android-java_sources.gni.patch | 2 +- patches/chrome-browser-BUILD.gn.patch | 4 +- patches/chrome-browser-about_flags.cc.patch | 6 +- ...rowsing_data-browsing_data_bridge.cc.patch | 4 +- ...hrome-browser-browser_process_impl.h.patch | 4 +- ...ing_data_remover_delegate_factory.cc.patch | 2 +- ...wser-chrome_content_browser_client.h.patch | 2 +- ...wser-devtools-devtools_ui_bindings.h.patch | 2 +- .../chrome-browser-extensions-BUILD.gn.patch | 4 +- ...rivate-webrtc_logging_private_api.cc.patch | 2 +- ...r-extensions-extension_management.cc.patch | 4 +- ...er-extensions-extension_management.h.patch | 4 +- ...ser-extensions-extension_tab_util.cc.patch | 4 +- ...flags-android-chrome_feature_list.cc.patch | 4 +- ...r-external_process_importer_client.h.patch | 4 +- ...porter-in_process_importer_bridge.cc.patch | 2 +- ...mporter-in_process_importer_bridge.h.patch | 2 +- ...me-browser-importer-profile_writer.h.patch | 4 +- ...-media-webrtc-webrtc_log_uploader.cc.patch | 2 +- ...et-system_network_context_manager.cc.patch | 2 +- ...hrome-browser-prefs-browser_prefs.cc.patch | 6 +- .../chrome-browser-profiles-profile.cc.patch | 14 +- ...profiles-profile_avatar_icon_util.cc.patch | 8 +- ...ome-browser-profiles-profile_impl.cc.patch | 2 +- ...-browser-profiles-profile_io_data.cc.patch | 4 +- ...e-browser-profiles-profile_manager.h.patch | 4 +- ...iles-profile_shortcut_manager_win.cc.patch | 2 +- ...ext_menu-render_view_context_menu.cc.patch | 4 +- ...text_menu-render_view_context_menu.h.patch | 4 +- ...r-resources-bookmarks-bookmarks.html.patch | 4 +- ...sources-bookmarks-command_manager.js.patch | 4 +- ...r-resources-downloads-downloads.html.patch | 4 +- ...owser-resources-downloads-toolbar.js.patch | 2 +- ...rowser-resources-extensions-BUILD.gn.patch | 14 +- ...resources-extensions-extensions.html.patch | 4 +- ...owser-resources-history-history.html.patch | 4 +- ...local_discovery-local_discovery.html.patch | 14 +- ...browser-resources-optimize_webui.gni.patch | 4 +- ...-browser-resources-optimize_webui.py.patch | 2 +- ...-browser-resources-settings-BUILD.gn.patch | 16 +- ...ettings-people_page-sync_controls.js.patch | 6 +- ...cy_page-personalization_options.html.patch | 2 +- ...vacy_page-personalization_options.js.patch | 10 +- ...tings-privacy_page-privacy_page.html.patch | 34 +-- ...ettings-privacy_page-privacy_page.js.patch | 2 +- ...-browser-resources-settings-route.js.patch | 2 +- ...ser-resources-settings-settings.html.patch | 12 + ...-resources-settings-settings_v3.html.patch | 12 - ...settings-category_default_setting.js.patch | 2 +- ...-settings-site_settings-constants.js.patch | 4 +- ...ings-site_settings-site_details.html.patch | 4 +- ...sync-profile_sync_service_factory.cc.patch | 4 +- patches/chrome-browser-ui-BUILD.gn.patch | 6 +- ...rome-browser-ui-appmenu-AppMenu.java.patch | 4 +- ...-save_card_bubble_controller_impl.cc.patch | 2 +- patches/chrome-browser-ui-browser.cc.patch | 4 +- patches/chrome-browser-ui-browser.h.patch | 4 +- ...rome-browser-ui-browser_navigator.cc.patch | 2 +- .../chrome-browser-ui-chrome_pages.cc.patch | 4 +- ...rtup-startup_browser_creator_impl.cc.patch | 4 +- .../chrome-browser-ui-tab_helpers.cc.patch | 4 +- ...me-browser-ui-tabs-tab_strip_model.h.patch | 2 +- ...chrome_location_bar_model_delegate.h.patch | 2 +- ...r-ui-toolbar-toolbar_actions_model.h.patch | 10 +- ...bar-toolbar_actions_model_factory.cc.patch | 4 +- ...views-bookmarks-bookmark_bar_view.cc.patch | 4 +- ...ws-bookmarks-bookmark_bubble_view.cc.patch | 4 +- ...ws-location_bar-location_bar_view.cc.patch | 4 +- ...iews-outdated_upgrade_bubble_view.cc.patch | 2 +- ...ble-permission_prompt_bubble_view.cc.patch | 4 +- ...ws-profiles-profile_menu_view_base.h.patch | 6 +- ...ws-tabs-tab_hover_card_bubble_view.h.patch | 2 +- ...me-browser-ui-views-tabs-tab_icon.cc.patch | 4 +- ...s-toolbar-browser_app_menu_button.cc.patch | 6 +- ...ser-ui-views-toolbar-toolbar_view.cc.patch | 4 +- ...wser-ui-views-toolbar-toolbar_view.h.patch | 10 +- ...s-translate-translate_bubble_view.cc.patch | 2 +- ...ws-translate-translate_bubble_view.h.patch | 4 +- ...r-ui-webui-bookmarks-bookmarks_ui.cc.patch | 4 +- ...-chrome_web_ui_controller_factory.cc.patch | 4 +- ...r-ui-webui-downloads-downloads_ui.cc.patch | 12 +- ...ui-webui-extensions-extensions_ui.cc.patch | 4 +- ...owser-ui-webui-history-history_ui.cc.patch | 4 +- ...-ui-webui-settings-people_handler.cc.patch | 8 +- ...ttings_localized_strings_provider.cc.patch | 4 +- ...bui-settings-site_settings_helper.cc.patch | 4 +- ...de_detector-upgrade_detector_impl.cc.patch | 4 +- ...me_authenticator_request_delegate.cc.patch | 4 +- patches/chrome-common-BUILD.gn.patch | 6 +- ...tensions-chrome_extensions_client.cc.patch | 2 +- ...ommon-importer-importer_data_types.h.patch | 4 +- ...mmon-importer-mock_importer_bridge.h.patch | 4 +- patches/chrome-installer-linux-BUILD.gn.patch | 2 +- patches/chrome-installer-mac-BUILD.gn.patch | 4 +- ...hrome-installer-mac-signing-model.py.patch | 4 +- ...me-installer-mac-signing-pipeline.py.patch | 4 +- ...me-installer-mini_installer-BUILD.gn.patch | 4 +- ...ller-mini_installer-configuration.cc.patch | 4 +- ...ler-mini_installer-mini_installer.cc.patch | 4 +- patches/chrome-installer-util-BUILD.gn.patch | 4 +- patches/chrome-renderer-BUILD.gn.patch | 4 +- ...er-chrome_content_renderer_client.cc.patch | 4 +- ...rer-chrome_content_renderer_client.h.patch | 4 +- patches/chrome-test-BUILD.gn.patch | 4 +- .../chrome-test-base-testing_profile.cc.patch | 4 +- patches/chrome-utility-BUILD.gn.patch | 4 +- ...r-external_process_importer_bridge.h.patch | 2 +- patches/chrome-utility-services.cc.patch | 12 +- ...s-bookmarks-browser-bookmark_model.h.patch | 4 +- ...t-android-java-res-values-dimens.xml.patch | 2 +- ..._updater-component_updater_service.h.patch | 2 +- ...er-page_specific_content_settings.cc.patch | 6 +- ...browser-content_settings_registry.cc.patch | 2 +- ...derer-content_settings_agent_impl.cc.patch | 4 +- ...nderer-content_settings_agent_impl.h.patch | 2 +- patches/components-feed-features.gni.patch | 11 + ...nts-infobars-core-infobar_delegate.h.patch | 6 +- .../components-omnibox-browser-BUILD.gn.patch | 4 +- ...x-browser-autocomplete_controller.cc.patch | 4 +- ...mnibox-browser-omnibox_edit_model.cc.patch | 2 +- ...components-page_info-page_info_ui.cc.patch | 4 +- ...nager-core-browser-login_database.cc.patch | 4 +- ...s-permissions-permission_uma_util.cc.patch | 2 +- patches/components-strings-BUILD.gn.patch | 6 +- patches/components-sync-BUILD.gn.patch | 4 +- patches/components-sync-driver-BUILD.gn.patch | 2 +- ...s-sync-driver-profile_sync_service.h.patch | 4 +- ...nents-sync-protocol-proto_visitors.h.patch | 6 +- ...vice_info-device_info_sync_bridge.cc.patch | 4 +- ...-device_info_sync_bridge_unittest.cc.patch | 4 +- ...ents-translate-core-browser-BUILD.gn.patch | 2 +- ...onents-vector_icons-vector_icons.gni.patch | 6 +- ...r_host-navigation_controller_impl.cc.patch | 4 +- ...-renderer_host-navigation_request.cc.patch | 6 +- patches/content-common-BUILD.gn.patch | 4 +- ...lic-browser-content_browser_client.h.patch | 4 +- ...ontent-renderer-render_frame_impl.cc.patch | 4 +- ...ntent-renderer-render_thread_impl.cc.patch | 4 +- ...r-api-web_request-web_request_api.cc.patch | 4 +- ...er-extension_event_histogram_value.h.patch | 8 +- ...nsions-common-api-_api_features.json.patch | 4 +- ...hrome-browser-prefs-browser_prefs.mm.patch | 4 +- ...sync-profile_sync_service_factory.cc.patch | 4 +- ...-blink-key_system_config_selector.cc.patch | 2 +- patches/net-BUILD.gn.patch | 4 +- patches/net-cookies-canonical_cookie.cc.patch | 4 +- ...nfigured_proxy_resolution_service.cc.patch | 4 +- .../sandbox-policy-win-sandbox_win.cc.patch | 4 +- .../sandbox-win-src-sandbox_nt_util.cc.patch | 13 + ...services-network-public-cpp-BUILD.gn.patch | 4 +- .../third_party-blink-renderer-BUILD.gn.patch | 4 +- ...er-bindings-generated_in_modules.gni.patch | 8 +- ...renderer-bindings-idl_in_modules.gni.patch | 6 +- ...d_party-blink-renderer-core-BUILD.gn.patch | 12 +- ...-blink-renderer-core-dom-document.cc.patch | 13 - ...ink-renderer-core-frame-navigator.cc.patch | 8 +- ...-canvas-canvas_async_blob_creator.cc.patch | 2 +- ...e-html-canvas-html_canvas_element.cc.patch | 4 +- ...r-core-html-media-autoplay_policy.cc.patch | 6 +- ...arty-blink-renderer-modules-BUILD.gn.patch | 4 +- ...anvas2d-base_rendering_context_2d.cc.patch | 6 +- ...canvas2d-base_rendering_context_2d.h.patch | 4 +- ...vas2d-canvas_rendering_context_2d.cc.patch | 4 +- ...as2d-canvas_rendering_context_2d.idl.patch | 2 +- ...reen_canvas_rendering_context_2d.idl.patch | 2 +- ...modules-cookie_store-cookie_store.cc.patch | 4 +- ...modules-mediastream-media_devices.cc.patch | 4 +- ...nderer-modules-modules_idl_files.gni.patch | 8 +- ...-modules-plugins-dom_plugin_array.cc.patch | 4 +- ...bgl-webgl2_rendering_context_base.cc.patch | 8 +- ...ebgl-webgl_rendering_context_base.cc.patch | 46 ++-- ...tools-gritsettings-resource_ids.spec.patch | 4 +- patches/tools-licenses.py.patch | 6 +- ...rams_xml-histogram_suffixes_list.xml.patch | 4 +- patches/ui-base-BUILD.gn.patch | 4 +- patches/ui-native_theme-native_theme.h.patch | 4 +- .../ui-native_theme-native_theme_mac.mm.patch | 2 +- .../ui-native_theme-native_theme_win.cc.patch | 4 +- .../ui-native_theme-native_theme_win.h.patch | 6 +- ...ews-controls-button-md_text_button.h.patch | 4 +- test/BUILD.gn | 10 +- test/data/flash.html | 22 -- utility/importer/chrome_importer.cc | 39 ++- utility/importer/chrome_importer_unittest.cc | 4 +- 368 files changed, 2262 insertions(+), 2344 deletions(-) rename android/java/org/chromium/chrome/browser/help/{BraveHelpAndFeedback.java => BraveHelpAndFeedbackLauncher.java} (88%) create mode 100644 android/java/org/chromium/chrome/browser/toolbar/bottom/BraveScrollingBottomViewResourceFrameLayout.java delete mode 100644 browser/resources/extensions/brave_unpack.stamp delete mode 100644 browser/resources/extensions/extensions_resources.grd delete mode 100644 browser/resources/settings/brave_unpack.stamp delete mode 100644 browser/resources/settings/settings_resources.grd delete mode 100644 browser/resources/settings/settings_resources_generated.grdp delete mode 100644 browser/ui/content_settings/brave_content_setting_bubble_model.cc delete mode 100644 browser/ui/content_settings/brave_content_setting_bubble_model.h create mode 100644 build/android/bytecode/java/org/brave/bytecode/BraveActivityClassAdapter.java delete mode 100644 chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.cc delete mode 100644 chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.h delete mode 100644 chromium_src/net/base/network_isolation_key.cc delete mode 100644 chromium_src/net/base/network_isolation_key.h delete mode 100644 components/content_settings/renderer/brave_content_settings_agent_impl_flash_browsertest.cc create mode 100644 components/subresource_filter_strings.grdp create mode 100644 components/webxr_strings.grdp rename patches/{chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationService.java.patch => chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationServiceImpl.java.patch} (61%) create mode 100644 patches/chrome-browser-resources-settings-settings.html.patch delete mode 100644 patches/chrome-browser-resources-settings-settings_v3.html.patch create mode 100644 patches/components-feed-features.gni.patch create mode 100644 patches/sandbox-win-src-sandbox_nt_util.cc.patch delete mode 100644 patches/third_party-blink-renderer-core-dom-document.cc.patch delete mode 100644 test/data/flash.html diff --git a/android/BUILD.gn b/android/BUILD.gn index 2231de25179b..03746cdd595c 100644 --- a/android/BUILD.gn +++ b/android/BUILD.gn @@ -13,7 +13,6 @@ java_cpp_enum("brave_android_java_enums_srcjar") { } java_cpp_template("brave_config_java") { - package_path = "org/chromium/chrome/browser" sources = [ "//brave/build/android/java/templates/BraveConfig.template" ] defines = [ "BRAVE_ANDROID_DEVELOPER_OPTIONS_CODE=\"$brave_android_developer_options_code\"", diff --git a/android/brave_java_sources.gni b/android/brave_java_sources.gni index 56fc9a21fdd5..d178c284ac52 100644 --- a/android/brave_java_sources.gni +++ b/android/brave_java_sources.gni @@ -49,7 +49,7 @@ brave_java_sources = [ "../../brave/android/java/org/chromium/chrome/browser/download/settings/BraveDownloadSettings.java", "../../brave/android/java/org/chromium/chrome/browser/externalnav/BraveExternalNavigationHandler.java", "../../brave/android/java/org/chromium/chrome/browser/feedback/BraveHelpAndFeedbackLauncherImpl.java", - "../../brave/android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedback.java", + "../../brave/android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedbackLauncher.java", "../../brave/android/java/org/chromium/chrome/browser/homepage/BraveHomepageManager.java", "../../brave/android/java/org/chromium/chrome/browser/homepage/settings/BraveHomepageSettings.java", "../../brave/android/java/org/chromium/chrome/browser/informers/BraveP3AInformers.java", @@ -165,6 +165,7 @@ brave_java_sources = [ "../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarVariationManager.java", "../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java", "../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsMediator.java", + "../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveScrollingBottomViewResourceFrameLayout.java", "../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java", "../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarLinearLayout.java", "../../brave/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarMediator.java", diff --git a/android/java/apk_for_test.flags b/android/java/apk_for_test.flags index c9175177ef28..fdf39330a50e 100644 --- a/android/java/apk_for_test.flags +++ b/android/java/apk_for_test.flags @@ -90,9 +90,7 @@ *** mAppThemeColorProvider; *** mShareDelegateSupplier; *** mScrimCoordinator; - *** mActivity; *** mShowStartSurfaceSupplier; - *** mOverviewModeBehaviorSupplier; *** mMenuButtonCoordinator; *** mToolbarTabController; *** mLocationBar; @@ -128,3 +126,7 @@ -keep class org.chromium.chrome.browser.download.MimeUtils { *** canAutoOpenMimeType(...); } + +-keep class org.chromium.chrome.browser.app.ChromeActivity { + *** mTabModelProfileSupplier; +} diff --git a/android/java/org/chromium/chrome/browser/BraveAppHooks.java b/android/java/org/chromium/chrome/browser/BraveAppHooks.java index f9f4c042f342..9c000a99041b 100644 --- a/android/java/org/chromium/chrome/browser/BraveAppHooks.java +++ b/android/java/org/chromium/chrome/browser/BraveAppHooks.java @@ -5,23 +5,16 @@ package org.chromium.chrome.browser; -import org.chromium.chrome.browser.feedback.BraveHelpAndFeedbackLauncherImpl; import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher; -import org.chromium.chrome.browser.help.BraveHelpAndFeedback; -import org.chromium.chrome.browser.help.HelpAndFeedback; +import org.chromium.chrome.browser.help.BraveHelpAndFeedbackLauncher; import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmark; import org.chromium.chrome.browser.partnercustomizations.BravePartnerBrowserCustomizations; import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; public class BraveAppHooks extends AppHooksImpl { - @Override - public HelpAndFeedback createHelpAndFeedback() { - return new BraveHelpAndFeedback(); - } - @Override public HelpAndFeedbackLauncher createHelpAndFeedbackLauncher() { - return new BraveHelpAndFeedbackLauncherImpl(); + return new BraveHelpAndFeedbackLauncher(); } @Override diff --git a/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java b/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java index 17b7e6032805..90616ec75a4d 100644 --- a/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java +++ b/android/java/org/chromium/chrome/browser/BraveRewardsHelper.java @@ -36,9 +36,9 @@ import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabImpl; -import org.chromium.chrome.browser.ui.favicon.IconType; -import org.chromium.chrome.browser.ui.favicon.LargeIconBridge; import org.chromium.components.browser_ui.widget.RoundedIconGenerator; +import org.chromium.components.favicon.IconType; +import org.chromium.components.favicon.LargeIconBridge; import org.chromium.url.GURL; import java.math.BigDecimal; diff --git a/android/java/org/chromium/chrome/browser/app/BraveActivity.java b/android/java/org/chromium/chrome/browser/app/BraveActivity.java index d8b161fedd2f..29c7397480b6 100644 --- a/android/java/org/chromium/chrome/browser/app/BraveActivity.java +++ b/android/java/org/chromium/chrome/browser/app/BraveActivity.java @@ -35,6 +35,7 @@ import org.chromium.base.IntentUtils; import org.chromium.base.Log; import org.chromium.base.annotations.JNINamespace; +import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.task.PostTask; import org.chromium.base.task.TaskTraits; import org.chromium.chrome.R; @@ -63,6 +64,7 @@ import org.chromium.chrome.browser.preferences.BravePreferenceKeys; import org.chromium.chrome.browser.preferences.Pref; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; +import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.rate.RateDialogFragment; import org.chromium.chrome.browser.rate.RateUtils; import org.chromium.chrome.browser.settings.BraveRewardsPreferences; @@ -83,6 +85,7 @@ import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.bookmarks.BookmarkType; import org.chromium.components.embedder_support.util.UrlConstants; +import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.components.search_engines.TemplateUrl; import org.chromium.components.user_prefs.UserPrefs; import org.chromium.ui.widget.Toast; @@ -123,6 +126,10 @@ public abstract class BraveActivity extends C public static final String ANDROID_PACKAGE_NAME = "android"; public static final String BRAVE_BLOG_URL = "http://www.brave.com/blog"; + // Explicitly declare this variable to avoid build errors. + // It will be removed in asm and parent variable will be used instead. + protected ObservableSupplier mTabModelProfileSupplier; + private static final List yandexRegions = Arrays.asList("AM", "AZ", "BY", "KG", "KZ", "MD", "RU", "TJ", "TM", "UZ"); @@ -382,7 +389,7 @@ private void checkForNotificationData() { case RetentionNotificationUtil.BRAVE_STATS_TIME: if (getActivityTab() != null && getActivityTab().getUrlString() != null - && !NewTabPage.isNTPUrl(getActivityTab().getUrlString())) { + && !UrlUtilities.isNTPUrl(getActivityTab().getUrlString())) { getTabCreator(false).launchUrl(UrlConstants.NTP_URL, TabLaunchType.FROM_CHROME_UI); } break; @@ -399,7 +406,7 @@ public void checkForBraveStats() { if (OnboardingPrefManager.getInstance().isBraveStatsEnabled()) { BraveStatsUtil.showBraveStats(); } else { - if (!NewTabPage.isNTPUrl(getActivityTab().getUrlString())) { + if (!UrlUtilities.isNTPUrl(getActivityTab().getUrlString())) { OnboardingPrefManager.getInstance().setFromNotification(true); getTabCreator(false).launchUrl(UrlConstants.NTP_URL, TabLaunchType.FROM_CHROME_UI); } else { diff --git a/android/java/org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate.java b/android/java/org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate.java index b58932b14202..efc6e4b22359 100644 --- a/android/java/org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate.java +++ b/android/java/org/chromium/chrome/browser/appmenu/BraveTabbedAppMenuPropertiesDelegate.java @@ -33,6 +33,7 @@ import org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator; import org.chromium.chrome.browser.ui.appmenu.AppMenuDelegate; import org.chromium.chrome.browser.ui.appmenu.AppMenuHandler; +import org.chromium.ui.modaldialog.ModalDialogManager; public class BraveTabbedAppMenuPropertiesDelegate extends TabbedAppMenuPropertiesDelegate { private Menu mMenu; @@ -43,10 +44,11 @@ public BraveTabbedAppMenuPropertiesDelegate(Context context, TabModelSelector tabModelSelector, ToolbarManager toolbarManager, View decorView, AppMenuDelegate appMenuDelegate, OneshotSupplier overviewModeBehaviorSupplier, - ObservableSupplier bookmarkBridgeSupplier) { + ObservableSupplier bookmarkBridgeSupplier, + ModalDialogManager modalDialogManager) { super(context, activityTabProvider, multiWindowModeStateDispatcher, tabModelSelector, toolbarManager, decorView, appMenuDelegate, overviewModeBehaviorSupplier, - bookmarkBridgeSupplier); + bookmarkBridgeSupplier, modalDialogManager); } @Override diff --git a/android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedback.java b/android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedbackLauncher.java similarity index 88% rename from android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedback.java rename to android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedbackLauncher.java index ed960f836dcc..d8d7c30ea63a 100644 --- a/android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedback.java +++ b/android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedbackLauncher.java @@ -13,12 +13,13 @@ import org.chromium.base.Log; import org.chromium.chrome.browser.feedback.FeedbackCollector; +import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl; import javax.annotation.Nonnull; -public class BraveHelpAndFeedback extends HelpAndFeedback { +public class BraveHelpAndFeedbackLauncher extends HelpAndFeedbackLauncherImpl { protected static final String FALLBACK_SUPPORT_URL = "https://community.brave.com/"; - private static final String TAG = "BraveHelpAndFeedback"; + private static final String TAG = "BraveHelpAndFeedbackLauncher"; @Override protected void show( diff --git a/android/java/org/chromium/chrome/browser/notifications/retention/RetentionNotificationPublisher.java b/android/java/org/chromium/chrome/browser/notifications/retention/RetentionNotificationPublisher.java index d500e470ce76..795b32704229 100644 --- a/android/java/org/chromium/chrome/browser/notifications/retention/RetentionNotificationPublisher.java +++ b/android/java/org/chromium/chrome/browser/notifications/retention/RetentionNotificationPublisher.java @@ -17,19 +17,19 @@ import org.chromium.base.Log; import org.chromium.base.ThreadUtils; import org.chromium.base.task.AsyncTask; -import org.chromium.chrome.browser.app.BraveActivity; import org.chromium.chrome.browser.BraveAdsNativeHelper; import org.chromium.chrome.browser.BraveFeatureList; +import org.chromium.chrome.browser.app.BraveActivity; import org.chromium.chrome.browser.brave_stats.BraveStatsUtil; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.notifications.BraveSetDefaultBrowserNotificationService; -import org.chromium.chrome.browser.ntp.NewTabPage; import org.chromium.chrome.browser.onboarding.OnboardingPrefManager; import org.chromium.chrome.browser.preferences.BravePref; -import org.chromium.components.user_prefs.UserPrefs; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.TabLaunchType; import org.chromium.components.embedder_support.util.UrlConstants; +import org.chromium.components.embedder_support.util.UrlUtilities; +import org.chromium.components.user_prefs.UserPrefs; public class RetentionNotificationPublisher extends BroadcastReceiver { private static final String NOTIFICATION_CHANNEL_NAME = "brave"; @@ -58,7 +58,7 @@ public void onReceive(Context context, Intent intent) { case RetentionNotificationUtil.BRAVE_STATS_TIME: if (braveActivity.getActivityTab() != null && braveActivity.getActivityTab().getUrlString() != null - && !NewTabPage.isNTPUrl(braveActivity.getActivityTab().getUrlString())) { + && !UrlUtilities.isNTPUrl(braveActivity.getActivityTab().getUrlString())) { braveActivity.getTabCreator(false).launchUrl(UrlConstants.NTP_URL, TabLaunchType.FROM_CHROME_UI); } break; diff --git a/android/java/org/chromium/chrome/browser/omnibox/suggestions/editurl/BraveEditUrlSuggestionProcessor.java b/android/java/org/chromium/chrome/browser/omnibox/suggestions/editurl/BraveEditUrlSuggestionProcessor.java index 92e21966ed9e..f22f878132b4 100644 --- a/android/java/org/chromium/chrome/browser/omnibox/suggestions/editurl/BraveEditUrlSuggestionProcessor.java +++ b/android/java/org/chromium/chrome/browser/omnibox/suggestions/editurl/BraveEditUrlSuggestionProcessor.java @@ -15,7 +15,7 @@ import org.chromium.chrome.browser.omnibox.suggestions.UrlBarDelegate; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.ui.favicon.LargeIconBridge; +import org.chromium.components.favicon.LargeIconBridge; public class BraveEditUrlSuggestionProcessor extends EditUrlSuggestionProcessor { private boolean mHasClearedOmniboxForFocus; diff --git a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java index 4f760c9d4de2..03bb4637ed13 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java @@ -210,7 +210,7 @@ public boolean onPreferenceClick(Preference preference) { RateDialogFragment mRateDialogFragment = new RateDialogFragment(); mRateDialogFragment.setCancelable(false); mRateDialogFragment.setArguments(bundle); - mRateDialogFragment.show(getActivity().getSupportFragmentManager(), "RateDialogFragment"); + mRateDialogFragment.show(getParentFragmentManager(), "RateDialogFragment"); return true; } }); diff --git a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java index 606bac08874e..61d7c1409f79 100644 --- a/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java +++ b/android/java/org/chromium/chrome/browser/tabbed_mode/BraveTabbedRootUiCoordinator.java @@ -16,6 +16,8 @@ import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; +import org.chromium.chrome.browser.intent.IntentMetadata; +import org.chromium.chrome.browser.layouts.LayoutStateProvider; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -25,7 +27,7 @@ public class BraveTabbedRootUiCoordinator extends TabbedRootUiCoordinator { public BraveTabbedRootUiCoordinator(ChromeActivity activity, Callback onOmniboxFocusChangedListener, - ObservableSupplier intentWithEffect, + OneshotSupplier intentMetadataOneshotSupplier, ObservableSupplier shareDelegateSupplier, ActivityTabProvider tabProvider, ObservableSupplierImpl ephemeralTabCoordinatorSupplier, @@ -34,11 +36,13 @@ public BraveTabbedRootUiCoordinator(ChromeActivity activity, OneshotSupplier overviewModeBehaviorSupplier, Supplier contextualSearchManagerSupplier, ObservableSupplier tabModelSelectorSupplier, - OneshotSupplier startSurfaceSupplier) { - super(activity, onOmniboxFocusChangedListener, intentWithEffect, shareDelegateSupplier, - tabProvider, ephemeralTabCoordinatorSupplier, profileSupplier, - bookmarkBridgeSupplier, overviewModeBehaviorSupplier, - contextualSearchManagerSupplier, tabModelSelectorSupplier, startSurfaceSupplier); + OneshotSupplier startSurfaceSupplier, + OneshotSupplier layoutStateProviderOneshotSupplier) { + super(activity, onOmniboxFocusChangedListener, intentMetadataOneshotSupplier, + shareDelegateSupplier, tabProvider, ephemeralTabCoordinatorSupplier, + profileSupplier, bookmarkBridgeSupplier, overviewModeBehaviorSupplier, + contextualSearchManagerSupplier, tabModelSelectorSupplier, startSurfaceSupplier, + layoutStateProviderOneshotSupplier); } @Override diff --git a/android/java/org/chromium/chrome/browser/toolbar/BraveHomeButton.java b/android/java/org/chromium/chrome/browser/toolbar/BraveHomeButton.java index 31dbdeda134a..658f16bda649 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/BraveHomeButton.java +++ b/android/java/org/chromium/chrome/browser/toolbar/BraveHomeButton.java @@ -8,39 +8,36 @@ package org.chromium.chrome.browser.toolbar; import android.content.Context; +import android.content.res.ColorStateList; import android.util.AttributeSet; -import androidx.core.content.ContextCompat; - -import org.chromium.chrome.R; -import org.chromium.chrome.browser.homepage.HomepageManager; -import org.chromium.chrome.browser.tab.Tab; +import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.chrome.browser.toolbar.ThemeColorProvider.TintObserver; /** * Brave's extension of HomeButton. */ -public class BraveHomeButton extends HomeButton { - private Context mContext; +public class BraveHomeButton extends HomeButton implements TintObserver { + private ThemeColorProvider mThemeColorProvider; public BraveHomeButton(Context context, AttributeSet attrs) { super(context, attrs); - mContext = context; } - /** - * Override to swap icon to new_tab_icon and enable the button when - * homepage is disabled. - */ + public void setThemeColorProvider(ThemeColorProvider themeColorProvider) { + mThemeColorProvider = themeColorProvider; + mThemeColorProvider.addTintObserver(this); + } + @Override - public void updateButtonEnabledState(Tab tab) { - super.updateButtonEnabledState(tab); - - final boolean isHomepageEnabled = HomepageManager.isHomepageEnabled(); - if (!isHomepageEnabled) { - setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.new_tab_icon)); - setEnabled(true); - } else { // swap back to home button icon - setImageDrawable(ContextCompat.getDrawable(mContext, R.drawable.btn_toolbar_home)); + public void onTintChanged(ColorStateList tint, boolean useLight) { + ApiCompatibilityUtils.setImageTintList(this, tint); + } + + public void destroy() { + if (mThemeColorProvider != null) { + mThemeColorProvider.removeTintObserver(this); + mThemeColorProvider = null; } } } diff --git a/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java b/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java index 0cd65be60164..47d53081d402 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java +++ b/android/java/org/chromium/chrome/browser/toolbar/BraveToolbarManager.java @@ -11,6 +11,7 @@ import android.view.ViewStub; import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; @@ -22,12 +23,17 @@ import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.bookmarks.BookmarkBridge; import org.chromium.chrome.browser.browser_controls.BrowserControlsSizer; +import org.chromium.chrome.browser.compositor.CompositorViewHolder; import org.chromium.chrome.browser.compositor.Invalidator; import org.chromium.chrome.browser.compositor.layouts.LayoutManager; -import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.findinpage.FindToolbarManager; import org.chromium.chrome.browser.fullscreen.FullscreenManager; +import org.chromium.chrome.browser.homepage.HomepageManager; import org.chromium.chrome.browser.identity_disc.IdentityDiscController; +import org.chromium.chrome.browser.intent.IntentMetadata; +import org.chromium.chrome.browser.layouts.LayoutStateProvider; +import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; +import org.chromium.chrome.browser.night_mode.NightModeStateProvider; import org.chromium.chrome.browser.omnibox.LocationBar; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.share.ShareDelegate; @@ -48,7 +54,12 @@ import org.chromium.chrome.browser.toolbar.top.TopToolbarCoordinator; import org.chromium.chrome.browser.ui.TabObscuringHandler; import org.chromium.chrome.browser.ui.appmenu.AppMenuCoordinator; +import org.chromium.chrome.browser.ui.appmenu.AppMenuDelegate; +import org.chromium.chrome.browser.ui.system.StatusBarColorController; +import org.chromium.chrome.features.start_surface.StartSurface; import org.chromium.components.browser_ui.widget.scrim.ScrimCoordinator; +import org.chromium.ui.base.WindowAndroid; +import org.chromium.ui.modaldialog.ModalDialogManager; import java.util.List; @@ -60,9 +71,7 @@ public class BraveToolbarManager extends ToolbarManager { private AppThemeColorProvider mAppThemeColorProvider; private ObservableSupplier mShareDelegateSupplier; private ScrimCoordinator mScrimCoordinator; - private ChromeActivity mActivity; private Supplier mShowStartSurfaceSupplier; - private OneshotSupplier mOverviewModeBehaviorSupplier; private MenuButtonCoordinator mMenuButtonCoordinator; private ToolbarTabControllerImpl mToolbarTabController; private LocationBar mLocationBar; @@ -70,14 +79,17 @@ public class BraveToolbarManager extends ToolbarManager { private LocationBarModel mLocationBarModel; private TopToolbarCoordinator mToolbar; private ObservableSupplier mBookmarkBridgeSupplier; - private ObservableSupplier mOmniboxFocusStateSupplier; private boolean mIsBottomToolbarVisible; private View mRootBottomView; + private ObservableSupplier mOmniboxFocusStateSupplier; + private OneshotSupplier mLayoutStateProviderSupplier; + private HomepageManager.HomepageStateListener mBraveHomepageStateListener; + private AppCompatActivity mActivity; - public BraveToolbarManager(ChromeActivity activity, BrowserControlsSizer controlsSizer, + public BraveToolbarManager(AppCompatActivity activity, BrowserControlsSizer controlsSizer, FullscreenManager fullscreenManager, ToolbarControlContainer controlContainer, - Invalidator invalidator, Callback urlFocusChangedCallback, + CompositorViewHolder compositorViewHolder, Callback urlFocusChangedCallback, ThemeColorProvider themeColorProvider, TabObscuringHandler tabObscuringHandler, ObservableSupplier shareDelegateSupplier, IdentityDiscController identityDiscController, @@ -86,19 +98,40 @@ public BraveToolbarManager(ChromeActivity activity, BrowserControlsSizer control FindToolbarManager findToolbarManager, ObservableSupplier profileSupplier, ObservableSupplier bookmarkBridgeSupplier, @Nullable Supplier canAnimateNativeBrowserControls, - OneshotSupplier overviewModeBehaviorSupplier, + OneshotSupplier layoutStateProviderSupplier, OneshotSupplier appMenuCoordinatorSupplier, boolean shouldShowUpdateBadge, ObservableSupplier tabModelSelectorSupplier, - ObservableSupplier omniboxFocusStateSupplier) { - super(activity, controlsSizer, fullscreenManager, controlContainer, invalidator, + OneshotSupplier startSurfaceSupplier, + ObservableSupplier omniboxFocusStateSupplier, + OneshotSupplier intentMetadataOneshotSupplier, + OneshotSupplier promoShownOneshotSupplier, WindowAndroid windowAndroid, + Supplier isInOverviewModeSupplier, boolean isCustomTab, + Supplier modalDialogManagerSupplier, + NightModeStateProvider nightModeStateProvider, + StatusBarColorController statusBarColorController, AppMenuDelegate appMenuDelegate, + ActivityLifecycleDispatcher activityLifecycleDispatcher) { + super(activity, controlsSizer, fullscreenManager, controlContainer, compositorViewHolder, urlFocusChangedCallback, themeColorProvider, tabObscuringHandler, shareDelegateSupplier, identityDiscController, buttonDataProviders, tabProvider, scrimCoordinator, toolbarActionModeCallback, findToolbarManager, profileSupplier, bookmarkBridgeSupplier, canAnimateNativeBrowserControls, - overviewModeBehaviorSupplier, appMenuCoordinatorSupplier, shouldShowUpdateBadge, - tabModelSelectorSupplier, omniboxFocusStateSupplier); + layoutStateProviderSupplier, appMenuCoordinatorSupplier, shouldShowUpdateBadge, + tabModelSelectorSupplier, startSurfaceSupplier, omniboxFocusStateSupplier, + intentMetadataOneshotSupplier, promoShownOneshotSupplier, windowAndroid, + isInOverviewModeSupplier, isCustomTab, modalDialogManagerSupplier, + nightModeStateProvider, statusBarColorController, appMenuDelegate, + activityLifecycleDispatcher); + mOmniboxFocusStateSupplier = omniboxFocusStateSupplier; + mLayoutStateProviderSupplier = layoutStateProviderSupplier; + mActivity = activity; + + mBraveHomepageStateListener = () -> { + assert (mBottomControlsCoordinator instanceof BraveBottomControlsCoordinator); + ((BraveBottomControlsCoordinator) mBottomControlsCoordinator).updateHomeButtonState(); + }; + HomepageManager.getInstance().addListener(mBraveHomepageStateListener); } @Override @@ -109,16 +142,19 @@ public void enableBottomControls() { return; } viewStub.setOnInflateListener((stub, inflated) -> { mRootBottomView = inflated; }); - mBottomControlsCoordinator = new BraveBottomControlsCoordinator( - BottomTabSwitcherActionMenuCoordinator.createOnLongClickListener( - id -> mActivity.onOptionsItemSelected(id, null)), - mBrowserControlsSizer, mFullscreenManager, viewStub, mActivityTabProvider, - mAppThemeColorProvider, mShareDelegateSupplier, - mMenuButtonCoordinator.getMenuButtonHelperSupplier(), mShowStartSurfaceSupplier, - mToolbarTabController::openHomepage, - (reason) - -> setUrlBarFocus(true, reason), - mOverviewModeBehaviorSupplier, mScrimCoordinator, mOmniboxFocusStateSupplier); + assert (mActivity instanceof ChromeActivity); + mBottomControlsCoordinator = + new BraveBottomControlsCoordinator(mLayoutStateProviderSupplier, + BottomTabSwitcherActionMenuCoordinator.createOnLongClickListener( + id -> ((ChromeActivity) mActivity).onOptionsItemSelected(id, null)), + mBrowserControlsSizer, mFullscreenManager, + mActivity.findViewById(R.id.bottom_controls_stub), mActivityTabProvider, + mAppThemeColorProvider, mShareDelegateSupplier, + mMenuButtonCoordinator.getMenuButtonHelperSupplier(), + mShowStartSurfaceSupplier, mToolbarTabController::openHomepage, + (reason) + -> setUrlBarFocus(true, reason), + mScrimCoordinator, mOmniboxFocusStateSupplier); ((BraveBottomControlsCoordinator) mBottomControlsCoordinator).setRootView(mRootBottomView); boolean isBottomToolbarVisible = BottomToolbarConfiguration.isBottomToolbarEnabled() && mActivity.getResources().getConfiguration().orientation @@ -150,6 +186,13 @@ public void initializeWithNative(LayoutManager layoutManager, return super.getMenuButtonView(); } + @Override + public void destroy() { + super.destroy(); + + HomepageManager.getInstance().removeListener(mBraveHomepageStateListener); + } + protected void onOrientationChange(int newOrientation) { if (mActionModeController != null) mActionModeController.showControlsOnOrientationChange(); diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java index c2bfbb439c6a..ec5cf16bcbeb 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarCoordinator.java @@ -13,6 +13,8 @@ import android.view.ViewGroup; import android.view.ViewStub; +import androidx.core.content.ContextCompat; + import org.chromium.base.Callback; import org.chromium.base.CallbackController; import org.chromium.base.ContextUtils; @@ -26,12 +28,11 @@ import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.app.BraveActivity; import org.chromium.chrome.browser.app.ChromeActivity; -import org.chromium.chrome.browser.compositor.layouts.EmptyOverviewModeObserver; -import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; -import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior.OverviewModeObserver; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.homepage.HomepageManager; -import org.chromium.chrome.browser.omnibox.LocationBar; +import org.chromium.chrome.browser.layouts.LayoutStateProvider; +import org.chromium.chrome.browser.layouts.LayoutType; +import org.chromium.chrome.browser.omnibox.OmniboxFocusReason; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.tab.Tab; @@ -66,9 +67,9 @@ class BottomToolbarCoordinator implements View.OnLongClickListener { /** A provider that notifies components when the theme color changes.*/ private final ThemeColorProvider mThemeColorProvider; - /** The overview mode manager. */ - protected OverviewModeBehavior mOverviewModeBehavior; - protected OverviewModeObserver mOverviewModeObserver; + private LayoutStateProvider.LayoutStateObserver mLayoutStateObserver; + private OneshotSupplier mLayoutStateProviderSupplier; + private LayoutStateProvider mLayoutStateProvider; /** The activity tab provider. */ private ActivityTabProvider mTabProvider; @@ -82,7 +83,7 @@ class BottomToolbarCoordinator implements View.OnLongClickListener { ObservableSupplier mMenuButtonHelperSupplier; private BottomControlsMediator mBottomControlsMediator; private Runnable mOriginalHomeButtonRunnable; - private final ScrollingBottomViewResourceFrameLayout mScrollingBottomView; + private final BraveScrollingBottomViewResourceFrameLayout mScrollingBottomView; private HomeButton mHomeButton; private BookmarksButton mBookmarksButton; private SearchAccelerator mSearchAccelerator; @@ -110,13 +111,13 @@ class BottomToolbarCoordinator implements View.OnLongClickListener { ObservableSupplier shareDelegateSupplier, Supplier showStartSurfaceCallable, Runnable openHomepageAction, Callback setUrlBarFocusAction, - OneshotSupplier overviewModeBehaviorSupplier, + OneshotSupplier layoutStateProviderSupplier, ObservableSupplier menuButtonHelperSupplier, BottomControlsMediator bottomControlsMediator) { View root = stub.inflate(); - overviewModeBehaviorSupplier.onAvailable(mCallbackController.makeCancelable( - (overviewModeBehavior) -> { setOverviewModeBehavior(overviewModeBehavior); })); + layoutStateProviderSupplier.onAvailable( + mCallbackController.makeCancelable(this::setLayoutStateProvider)); mShowStartSurfaceCallable = showStartSurfaceCallable; final OnClickListener homeButtonListener = v -> { @@ -124,19 +125,18 @@ class BottomToolbarCoordinator implements View.OnLongClickListener { }; final OnClickListener searchAcceleratorListener = v -> { - RecordUserAction.record("MobileToolbarOmniboxAcceleratorTap"); - // Only switch to HomePage when overview is showing. - if (mOverviewModeBehavior != null && mOverviewModeBehavior.overviewVisible() + if (mLayoutStateProvider != null + && mLayoutStateProvider.isLayoutVisible(LayoutType.TAB_SWITCHER) && mShowStartSurfaceCallable != null) { mShowStartSurfaceCallable.get(); } - setUrlBarFocusAction.onResult(LocationBar.OmniboxFocusReason.ACCELERATOR_TAP); + setUrlBarFocusAction.onResult(OmniboxFocusReason.ACCELERATOR_TAP); }; mBrowsingModeCoordinator = new BrowsingModeBottomToolbarCoordinator(root, tabProvider, homeButtonListener, searchAcceleratorListener, mShareButtonListenerSupplier, - tabsSwitcherLongClickListner, overviewModeBehaviorSupplier); + tabsSwitcherLongClickListner); mTabSwitcherModeStub = root.findViewById(R.id.bottom_toolbar_tab_switcher_mode_stub); @@ -150,7 +150,7 @@ class BottomToolbarCoordinator implements View.OnLongClickListener { mMenuButtonHelperSupplier = menuButtonHelperSupplier; mBottomControlsMediator = bottomControlsMediator; mOriginalHomeButtonRunnable = openHomepageAction; - mScrollingBottomView = scrollingBottomView; + mScrollingBottomView = (BraveScrollingBottomViewResourceFrameLayout) scrollingBottomView; } /** @@ -194,9 +194,11 @@ void initializeWithNative(OnClickListener tabSwitcherListener, // customized. if (!ReturnToChromeExperimentsUtil.shouldShowStartSurfaceAsTheHomePage() && BottomToolbarVariationManager.shouldBottomToolbarBeVisibleInOverviewMode()) { - mOverviewModeObserver = new EmptyOverviewModeObserver() { + mLayoutStateObserver = new LayoutStateProvider.LayoutStateObserver() { @Override - public void onOverviewModeStartedShowing(boolean showToolbar) { + public void onStartedShowing(@LayoutType int layoutType, boolean showToolbar) { + if (layoutType != LayoutType.TAB_SWITCHER) return; + if (mBottomControlsMediator instanceof BraveBottomControlsMediator) { ((BraveBottomControlsMediator) mBottomControlsMediator) .setCompositedViewVisibile(false); @@ -223,8 +225,10 @@ public void onOverviewModeStartedShowing(boolean showToolbar) { } @Override - public void onOverviewModeStartedHiding( - boolean showToolbar, boolean delayAnimation) { + public void onStartedHiding( + @LayoutType int layoutType, boolean showToolbar, boolean delayAnimation) { + if (layoutType != LayoutType.TAB_SWITCHER) return; + BrowsingModeBottomToolbarCoordinator browsingModeCoordinator = (BrowsingModeBottomToolbarCoordinator) mBrowsingModeCoordinator; browsingModeCoordinator.getSearchAccelerator().setVisibility(View.VISIBLE); @@ -235,8 +239,6 @@ public void onOverviewModeStartedHiding( } if (BottomToolbarVariationManager.isHomeButtonOnBottom()) { browsingModeCoordinator.getHomeButton().setVisibility(View.VISIBLE); - browsingModeCoordinator.getHomeButton().updateButtonEnabledState( - mTabProvider.get()); } if (BottomToolbarVariationManager.isBookmarkButtonOnBottom()) { browsingModeCoordinator.getBookmarkButton().setVisibility(View.VISIBLE); @@ -251,7 +253,9 @@ public void onOverviewModeStartedHiding( } @Override - public void onOverviewModeFinishedHiding() { + public void onFinishedHiding(@LayoutType int layoutType) { + if (layoutType != LayoutType.TAB_SWITCHER) return; + if (mBottomControlsMediator instanceof BraveBottomControlsMediator) { ((BraveBottomControlsMediator) mBottomControlsMediator) .setCompositedViewVisibile(true); @@ -266,11 +270,11 @@ public void onOverviewModeFinishedHiding() { mHomeButton = bottomToolbarBrowsing.findViewById(R.id.bottom_home_button); if (mHomeButton != null) { + updateHomeButtonState(); mHomeButton.setOnLongClickListener(this); final OnClickListener homeButtonListener = v -> { - final boolean isHomepageEnabled = HomepageManager.isHomepageEnabled(); - if (isHomepageEnabled) { + if (HomepageManager.isHomepageEnabled()) { mOriginalHomeButtonRunnable.run(); } else { newTabClickListener.onClick(v); @@ -321,9 +325,9 @@ void destroy() { mTabSwitcherModeCoordinator.destroy(); mTabSwitcherModeCoordinator = null; } - if (mOverviewModeBehavior != null) { - mOverviewModeBehavior.removeOverviewModeObserver(mOverviewModeObserver); - mOverviewModeBehavior = null; + if (mLayoutStateProvider != null) { + mLayoutStateProvider.removeObserver(mLayoutStateObserver); + mLayoutStateProvider = null; } mThemeColorProvider.destroy(); mShareDelegateSupplier.removeObserver(mShareDelegateSupplierCallback); @@ -342,13 +346,11 @@ private void onShareDelegateAvailable(ShareDelegate shareDelegate) { mShareButtonListenerSupplier.set(shareButtonListener); } - private void setOverviewModeBehavior(OverviewModeBehavior overviewModeBehavior) { - assert overviewModeBehavior != null; - assert mOverviewModeBehavior - == null - : "TODO(https://crbug.com/1084528): the overview mode manager should set at most once."; - mOverviewModeBehavior = overviewModeBehavior; - mOverviewModeBehavior.addOverviewModeObserver(mOverviewModeObserver); + private void setLayoutStateProvider(LayoutStateProvider layoutStateProvider) { + assert mLayoutStateProvider == null : "the mLayoutStateProvider should set at most once."; + + mLayoutStateProvider = layoutStateProvider; + mLayoutStateProvider.addObserver(mLayoutStateObserver); } public void updateBookmarkButton(boolean isBookmarked, boolean editingAllowed) { @@ -383,4 +385,16 @@ public boolean onLongClick(View v) { return Toast.showAnchoredToast(mContext, v, description); } + + public void updateHomeButtonState() { + assert (mHomeButton != null); + if (!HomepageManager.isHomepageEnabled()) { + mHomeButton.setImageDrawable( + ContextCompat.getDrawable(mContext, R.drawable.new_tab_icon)); + mHomeButton.setEnabled(true); + } else { + mHomeButton.setImageDrawable( + ContextCompat.getDrawable(mContext, R.drawable.btn_toolbar_home)); + } + } } diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java index d2c18953d96d..dfc02b15de37 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveBottomControlsCoordinator.java @@ -5,6 +5,7 @@ package org.chromium.chrome.browser.toolbar.bottom; +import android.app.Activity; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; @@ -20,13 +21,13 @@ import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; import org.chromium.chrome.browser.ActivityTabProvider; -import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.browser_controls.BrowserControlsSizer; import org.chromium.chrome.browser.compositor.layouts.LayoutManager; -import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.fullscreen.FullscreenManager; +import org.chromium.chrome.browser.layouts.LayoutStateProvider; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider; +import org.chromium.chrome.browser.toolbar.HomeButton; import org.chromium.chrome.browser.toolbar.TabCountProvider; import org.chromium.chrome.browser.toolbar.ThemeColorProvider; import org.chromium.chrome.browser.ui.appmenu.AppMenuButtonHelper; @@ -46,23 +47,23 @@ public class BraveBottomControlsCoordinator extends BottomControlsCoordinator { private Supplier mShowStartSurfaceCallable; private Runnable mOpenHomepageAction; private Callback mSetUrlBarFocusAction; - private OneshotSupplier mOverviewModeBehaviorSupplier; + private OneshotSupplier mLayoutStateProviderSupplier; private ScrollingBottomViewResourceFrameLayout mRoot; - public BraveBottomControlsCoordinator(OnLongClickListener tabSwitcherLongclickListener, - BrowserControlsSizer controlsSizer, FullscreenManager fullscreenManager, ViewStub stub, - ActivityTabProvider tabProvider, ThemeColorProvider themeColorProvider, + public BraveBottomControlsCoordinator( + OneshotSupplier layoutStateProviderSupplier, + OnLongClickListener tabSwitcherLongclickListener, BrowserControlsSizer controlsSizer, + FullscreenManager fullscreenManager, ViewStub stub, ActivityTabProvider tabProvider, + ThemeColorProvider themeColorProvider, ObservableSupplier shareDelegateSupplier, ObservableSupplier menuButtonHelperSupplier, Supplier showStartSurfaceCallable, Runnable openHomepageAction, - Callback setUrlBarFocusAction, - OneshotSupplier overviewModeBehaviorSupplier, - ScrimCoordinator scrimCoordinator, + Callback setUrlBarFocusAction, ScrimCoordinator scrimCoordinator, ObservableSupplier omniboxFocusStateSupplier) { super(controlsSizer, fullscreenManager, stub, tabProvider, themeColorProvider, shareDelegateSupplier, menuButtonHelperSupplier, showStartSurfaceCallable, - openHomepageAction, setUrlBarFocusAction, overviewModeBehaviorSupplier, - scrimCoordinator, omniboxFocusStateSupplier); + openHomepageAction, setUrlBarFocusAction, scrimCoordinator, + omniboxFocusStateSupplier); mTabSwitcherLongclickListener = tabSwitcherLongclickListener; mTabProvider = tabProvider; @@ -71,7 +72,7 @@ public BraveBottomControlsCoordinator(OnLongClickListener tabSwitcherLongclickLi mShowStartSurfaceCallable = showStartSurfaceCallable; mOpenHomepageAction = openHomepageAction; mSetUrlBarFocusAction = setUrlBarFocusAction; - mOverviewModeBehaviorSupplier = overviewModeBehaviorSupplier; + mLayoutStateProviderSupplier = layoutStateProviderSupplier; mMenuButtonHelperSupplier = menuButtonHelperSupplier; } @@ -81,21 +82,21 @@ public void setRootView(View root) { } @Override - public void initializeWithNative(ChromeActivity chromeActivity, ResourceManager resourceManager, + public void initializeWithNative(Activity activity, ResourceManager resourceManager, LayoutManager layoutManager, OnClickListener tabSwitcherListener, OnClickListener newTabClickListener, WindowAndroid windowAndroid, TabCountProvider tabCountProvider, IncognitoStateProvider incognitoStateProvider, ViewGroup topToolbarRoot, Runnable closeAllTabsAction) { - super.initializeWithNative(chromeActivity, resourceManager, layoutManager, - tabSwitcherListener, newTabClickListener, windowAndroid, tabCountProvider, - incognitoStateProvider, topToolbarRoot, closeAllTabsAction); + super.initializeWithNative(activity, resourceManager, layoutManager, tabSwitcherListener, + newTabClickListener, windowAndroid, tabCountProvider, incognitoStateProvider, + topToolbarRoot, closeAllTabsAction); if (BottomToolbarConfiguration.isBottomToolbarEnabled()) { mBottomToolbarCoordinator = new BottomToolbarCoordinator(mRoot, mRoot.findViewById(R.id.bottom_toolbar_stub), mTabProvider, mTabSwitcherLongclickListener, mThemeColorProvider, mShareDelegateSupplier, mShowStartSurfaceCallable, mOpenHomepageAction, mSetUrlBarFocusAction, - mOverviewModeBehaviorSupplier, mMenuButtonHelperSupplier, mMediator); + mLayoutStateProviderSupplier, mMenuButtonHelperSupplier, mMediator); mBottomToolbarCoordinator.initializeWithNative(tabSwitcherListener, newTabClickListener, tabCountProvider, incognitoStateProvider, topToolbarRoot, closeAllTabsAction); @@ -123,4 +124,8 @@ public void updateBookmarkButton(boolean isBookmarked, boolean editingAllowed) { mBottomToolbarCoordinator.updateBookmarkButton(isBookmarked, editingAllowed); } } + + public void updateHomeButtonState() { + mBottomToolbarCoordinator.updateHomeButtonState(); + } } diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveScrollingBottomViewResourceFrameLayout.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveScrollingBottomViewResourceFrameLayout.java new file mode 100644 index 000000000000..c68b357d8660 --- /dev/null +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BraveScrollingBottomViewResourceFrameLayout.java @@ -0,0 +1,53 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * 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/. */ + +package org.chromium.chrome.browser.toolbar.bottom; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.MotionEvent; + +import org.chromium.chrome.browser.compositor.layouts.eventfilter.EdgeSwipeHandler; +import org.chromium.chrome.browser.contextualsearch.SwipeRecognizer; + +public class BraveScrollingBottomViewResourceFrameLayout + extends ScrollingBottomViewResourceFrameLayout { + /** A swipe recognizer for handling swipe gestures. */ + private SwipeRecognizer mSwipeRecognizer; + + public BraveScrollingBottomViewResourceFrameLayout(Context context, AttributeSet attrs) { + super(context, attrs); + } + + /** + * Set the swipe handler for this view and set {@link #isClickable()} to true to allow motion + * events to be intercepted by the view itself. + * @param handler A handler for swipe events on this view. + */ + public void setSwipeDetector(EdgeSwipeHandler handler) { + mSwipeRecognizer = new SwipeRecognizer(getContext()); + mSwipeRecognizer.setSwipeHandler(handler); + + // TODO(mdjones): This line of code makes it impossible to scroll through the bottom + // toolbar. If the user accidentally swipes up on this view, the scroll no longer goes + // through to the web contents. We should figure out how to make this work while also + // supporting the toolbar swipe behavior. + setClickable(true); + } + + @Override + public boolean onInterceptTouchEvent(MotionEvent event) { + boolean handledEvent = false; + if (mSwipeRecognizer != null) handledEvent = mSwipeRecognizer.onTouchEvent(event); + return handledEvent || super.onInterceptTouchEvent(event); + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + boolean handledEvent = false; + if (mSwipeRecognizer != null) handledEvent = mSwipeRecognizer.onTouchEvent(event); + return handledEvent || super.onTouchEvent(event); + } +} diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java index 590a77d5548e..0ccffb7cb460 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BrowsingModeBottomToolbarCoordinator.java @@ -26,7 +26,7 @@ import org.chromium.chrome.browser.tab.TabUtils; import org.chromium.chrome.browser.tabmodel.IncognitoStateProvider; import org.chromium.chrome.browser.tasks.ReturnToChromeExperimentsUtil; -import org.chromium.chrome.browser.toolbar.HomeButton; +import org.chromium.chrome.browser.toolbar.BraveHomeButton; import org.chromium.chrome.browser.toolbar.TabCountProvider; import org.chromium.chrome.browser.toolbar.TabSwitcherButtonCoordinator; import org.chromium.chrome.browser.toolbar.TabSwitcherButtonView; @@ -47,7 +47,7 @@ public class BrowsingModeBottomToolbarCoordinator { private final BrowsingModeBottomToolbarMediator mMediator; /** The home button that lives in the bottom toolbar. */ - private final HomeButton mHomeButton; + private final BraveHomeButton mBraveHomeButton; /** The share button that lives in the bottom toolbar. */ private final ShareButton mShareButton; @@ -96,8 +96,7 @@ public class BrowsingModeBottomToolbarCoordinator { BrowsingModeBottomToolbarCoordinator(View root, ActivityTabProvider tabProvider, OnClickListener homeButtonListener, OnClickListener searchAcceleratorListener, ObservableSupplier shareButtonListenerSupplier, - OnLongClickListener tabSwitcherLongClickListener, - OneshotSupplier overviewModeBehaviorSupplier) { + OnLongClickListener tabSwitcherLongClickListener) { mModel = new BrowsingModeBottomToolbarModel(); mToolbarRoot = root.findViewById(R.id.bottom_toolbar_browsing); mTabProvider = tabProvider; @@ -107,9 +106,8 @@ public class BrowsingModeBottomToolbarCoordinator { mMediator = new BrowsingModeBottomToolbarMediator(mModel); - mHomeButton = mToolbarRoot.findViewById(R.id.bottom_home_button); - mHomeButton.setOnClickListener(homeButtonListener); - mHomeButton.setActivityTabProvider(mTabProvider); + mBraveHomeButton = mToolbarRoot.findViewById(R.id.bottom_home_button); + mBraveHomeButton.setOnClickListener(homeButtonListener); mNewTabButton = mToolbarRoot.findViewById(R.id.bottom_new_tab_button); @@ -127,7 +125,7 @@ public class BrowsingModeBottomToolbarCoordinator { mNewTabButton.setVisibility(View.VISIBLE); } if (BottomToolbarVariationManager.isHomeButtonOnBottom()) { - mHomeButton.setVisibility(View.VISIBLE); + mBraveHomeButton.setVisibility(View.VISIBLE); } if (BottomToolbarVariationManager.isTabSwitcherOnBottom()) { @@ -143,11 +141,6 @@ public class BrowsingModeBottomToolbarCoordinator { mShareButtonListenerSupplier.addObserver(mShareButtonListenerSupplierCallback); } - overviewModeBehaviorSupplier.onAvailable( - mCallbackController.makeCancelable((overviewModeBehavior) -> { - setOverviewModeBehavior(overviewModeBehavior); - })); - mBookmarkButton = mToolbarRoot.findViewById(R.id.bottom_bookmark_button); if (BottomToolbarVariationManager.isBookmarkButtonOnBottom()) { mBookmarkButton.setVisibility(View.VISIBLE); @@ -199,14 +192,15 @@ void initializeWithNative(OnClickListener newTabListener, OnClickListener tabSwi mNewTabButton.setThemeColorProvider(themeColorProvider); mNewTabButton.setIncognitoStateProvider(incognitoStateProvider); } - if (BottomToolbarVariationManager.isHomeButtonOnBottom()) { - mHomeButton.setThemeColorProvider(themeColorProvider); - } if (BottomToolbarVariationManager.isShareButtonOnBottom()) { mShareButton.setThemeColorProvider(themeColorProvider); } + if (BottomToolbarVariationManager.isHomeButtonOnBottom()) { + mBraveHomeButton.setThemeColorProvider(themeColorProvider); + } + mSearchAccelerator.setThemeColorProvider(themeColorProvider); mSearchAccelerator.setIncognitoStateProvider(incognitoStateProvider); @@ -226,19 +220,6 @@ void initializeWithNative(OnClickListener newTabListener, OnClickListener tabSwi }); } - private void setOverviewModeBehavior(OverviewModeBehavior overviewModeBehavior) { - assert overviewModeBehavior != null; - - // If StartSurface is HomePage, BrowsingModeBottomToolbar is shown in browsing mode and in - // overview mode. We need to pass the OverviewModeBehavior to the buttons so they are - // disabled based on the overview state. - if (ReturnToChromeExperimentsUtil.shouldShowStartSurfaceAsTheHomePage()) { - mShareButton.setOverviewModeBehavior(overviewModeBehavior); - // mTabSwitcherButtonCoordinator.setOverviewModeBehavior(overviewModeBehavior); - mHomeButton.setOverviewModeBehavior(overviewModeBehavior); - } - } - /** * @param enabled Whether to disable click events on the bottom toolbar. Setting true can also * prevent from all click events on toolbar and all children views on toolbar. @@ -278,8 +259,8 @@ SearchAccelerator getSearchAccelerator() { /** * @return The browsing mode bottom toolbar's home button. */ - HomeButton getHomeButton() { - return mHomeButton; + BraveHomeButton getHomeButton() { + return mBraveHomeButton; } /** @@ -290,7 +271,7 @@ public void destroy() { mShareButtonListenerSupplier.removeObserver(mShareButtonListenerSupplierCallback); } mMediator.destroy(); - mHomeButton.destroy(); + mBraveHomeButton.destroy(); mShareButton.destroy(); mSearchAccelerator.destroy(); mTabSwitcherButtonCoordinator.destroy(); @@ -307,7 +288,7 @@ public void updateBookmarkButton(boolean isBookmarked, boolean editingAllowed) { } View getNewTabButtonParent() { - return (View)mNewTabButton.getParent(); + return (View) mNewTabButton.getParent(); } BookmarksButton getBookmarkButton() { diff --git a/android/java/org/chromium/chrome/browser/toolbar/menu_button/BraveMenuButtonCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/menu_button/BraveMenuButtonCoordinator.java index 7c86336a8ffb..f3b6cb255983 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/menu_button/BraveMenuButtonCoordinator.java +++ b/android/java/org/chromium/chrome/browser/toolbar/menu_button/BraveMenuButtonCoordinator.java @@ -7,6 +7,8 @@ import android.app.Activity; import android.content.SharedPreferences; +import android.graphics.Canvas; +import android.view.View; import androidx.annotation.IdRes; @@ -44,6 +46,12 @@ public MenuButton getMenuButton() { return isMenuFromBottom() ? null : super.getMenuButton(); } + @Override + public void drawTabSwitcherAnimationOverlay(View root, Canvas canvas, int alpha) { + if (isMenuFromBottom()) return; + super.drawTabSwitcherAnimationOverlay(root, canvas, alpha); + } + @Override public void setVisibility(boolean visible) { updateMenuButtonState(); diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java index 9e7978ca07b3..2209f729a104 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java +++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java @@ -113,6 +113,8 @@ public abstract class BraveToolbarLayout extends ToolbarLayout implements OnClic private static final long MB_10 = 10000000; private static final long MINUTES_10 = 10 * 60 * 1000; + private static final int URL_FOCUS_TOOLBAR_BUTTONS_TRANSLATION_X_DP = 10; + private DatabaseHelper mDatabaseHelper = DatabaseHelper.getInstance(); private ImageButton mBraveShieldsButton; @@ -653,39 +655,39 @@ public void onUrlFocusChange(boolean hasFocus) { } public void populateUrlAnimatorSet(boolean hasFocus, int urlFocusToolbarButtonsDuration, - int urlClearFocusTabStackDelayMs, int urlFocusToolbarButtonsTranslationXDP, - List animators) { - if (mBraveShieldsButton != null) { - Animator animator; - if (hasFocus) { - float density = getContext().getResources().getDisplayMetrics().density; - boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; - float toolbarButtonTranslationX = - MathUtils.flipSignIf(urlFocusToolbarButtonsTranslationXDP, isRtl) * density; - animator = ObjectAnimator.ofFloat( - mBraveShieldsButton, TRANSLATION_X, toolbarButtonTranslationX); - animator.setDuration(urlFocusToolbarButtonsDuration); - animator.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE); - animators.add(animator); - - animator = ObjectAnimator.ofFloat(mBraveShieldsButton, ALPHA, 0); - animator.setDuration(urlFocusToolbarButtonsDuration); - animator.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE); - animators.add(animator); - } else { - animator = ObjectAnimator.ofFloat(mBraveShieldsButton, TRANSLATION_X, 0); - animator.setDuration(urlFocusToolbarButtonsDuration); - animator.setStartDelay(urlClearFocusTabStackDelayMs); - animator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE); - animators.add(animator); - - animator = ObjectAnimator.ofFloat(mBraveShieldsButton, ALPHA, 1); - animator.setDuration(urlFocusToolbarButtonsDuration); - animator.setStartDelay(urlClearFocusTabStackDelayMs); - animator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE); - animators.add(animator); + int urlClearFocusTabStackDelayMs, List animators) { + if (mBraveShieldsButton != null) { + Animator animator; + if (hasFocus) { + float density = getContext().getResources().getDisplayMetrics().density; + boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; + float toolbarButtonTranslationX = + MathUtils.flipSignIf(URL_FOCUS_TOOLBAR_BUTTONS_TRANSLATION_X_DP, isRtl) + * density; + animator = ObjectAnimator.ofFloat( + mBraveShieldsButton, TRANSLATION_X, toolbarButtonTranslationX); + animator.setDuration(urlFocusToolbarButtonsDuration); + animator.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE); + animators.add(animator); + + animator = ObjectAnimator.ofFloat(mBraveShieldsButton, ALPHA, 0); + animator.setDuration(urlFocusToolbarButtonsDuration); + animator.setInterpolator(BakedBezierInterpolator.FADE_OUT_CURVE); + animators.add(animator); + } else { + animator = ObjectAnimator.ofFloat(mBraveShieldsButton, TRANSLATION_X, 0); + animator.setDuration(urlFocusToolbarButtonsDuration); + animator.setStartDelay(urlClearFocusTabStackDelayMs); + animator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE); + animators.add(animator); + + animator = ObjectAnimator.ofFloat(mBraveShieldsButton, ALPHA, 1); + animator.setDuration(urlFocusToolbarButtonsDuration); + animator.setStartDelay(urlClearFocusTabStackDelayMs); + animator.setInterpolator(BakedBezierInterpolator.TRANSFORM_CURVE); + animators.add(animator); + } } - } } protected void updateModernLocationBarColor(int color) { @@ -948,8 +950,10 @@ private boolean isMenuButtonOnBottom() { @Override protected void initialize(ToolbarDataProvider toolbarDataProvider, - ToolbarTabController tabController, MenuButtonCoordinator menuButtonCoordinator) { - super.initialize(toolbarDataProvider, tabController, menuButtonCoordinator); + ToolbarTabController tabController, MenuButtonCoordinator menuButtonCoordinator, + Runnable tabOrModelChangeRunnable) { + super.initialize( + toolbarDataProvider, tabController, menuButtonCoordinator, tabOrModelChangeRunnable); BraveMenuButtonCoordinator.setMenuFromBottom(isMenuButtonOnBottom()); } diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java index a6d60478dcb3..4c0c72846b7a 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java +++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveTopToolbarCoordinator.java @@ -12,8 +12,8 @@ import org.chromium.base.supplier.OneshotSupplier; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.R; -import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.identity_disc.IdentityDiscController; +import org.chromium.chrome.browser.layouts.LayoutStateProvider; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.toolbar.ButtonData; import org.chromium.chrome.browser.toolbar.ButtonDataProvider; @@ -23,6 +23,7 @@ import org.chromium.chrome.browser.toolbar.menu_button.MenuButtonCoordinator; import org.chromium.chrome.browser.ui.appmenu.AppMenuButtonHelper; import org.chromium.chrome.browser.user_education.UserEducationHelper; +import org.chromium.chrome.features.start_surface.StartSurface; import org.chromium.chrome.features.start_surface.StartSurfaceConfiguration; import java.util.List; @@ -36,7 +37,7 @@ public BraveTopToolbarCoordinator(ToolbarControlContainer controlContainer, ToolbarLayout toolbarLayout, ToolbarDataProvider toolbarDataProvider, ToolbarTabController tabController, UserEducationHelper userEducationHelper, List buttonDataProviders, - OneshotSupplier overviewModeBehaviorSupplier, + OneshotSupplier layoutStateProviderSupplier, ThemeColorProvider normalThemeColorProvider, ThemeColorProvider overviewThemeColorProvider, MenuButtonCoordinator browsingModeMenuButtonCoordinator, @@ -45,14 +46,15 @@ public BraveTopToolbarCoordinator(ToolbarControlContainer controlContainer, ObservableSupplier tabModelSelectorSupplier, ObservableSupplier homeButtonVisibilitySupplier, ObservableSupplier identityDiscStateSupplier, - Callback invalidatorCallback, - Supplier identityDiscButtonSupplier) { + Callback invalidatorCallback, Supplier identityDiscButtonSupplier, + OneshotSupplier startSurfaceSupplier, Runnable tabOrModelChangeRunnable) { super(controlContainer, toolbarLayout, toolbarDataProvider, tabController, - userEducationHelper, buttonDataProviders, overviewModeBehaviorSupplier, + userEducationHelper, buttonDataProviders, layoutStateProviderSupplier, normalThemeColorProvider, overviewThemeColorProvider, browsingModeMenuButtonCoordinator, overviewModeMenuButtonCoordinator, appMenuButtonHelperSupplier, tabModelSelectorSupplier, homeButtonVisibilitySupplier, - identityDiscStateSupplier, invalidatorCallback, identityDiscButtonSupplier); + identityDiscStateSupplier, invalidatorCallback, identityDiscButtonSupplier, + startSurfaceSupplier, tabOrModelChangeRunnable); mBraveToolbarLayout = toolbarLayout; diff --git a/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceBuyFragment.java b/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceBuyFragment.java index b17026f99c06..9a4c62a39cc2 100644 --- a/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceBuyFragment.java +++ b/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceBuyFragment.java @@ -189,7 +189,7 @@ private void setFiatSpinner(List fiatSpinnerList) { } private void dismissBinanceBottomSheet() { - FragmentManager fm = getActivity().getSupportFragmentManager(); + FragmentManager fm = getParentFragmentManager(); CryptoWidgetBottomSheetDialogFragment fragment = (CryptoWidgetBottomSheetDialogFragment) fm.findFragmentByTag( CryptoWidgetBottomSheetDialogFragment.TAG_FRAGMENT); diff --git a/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceConvertFragment.java b/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceConvertFragment.java index b6b0e9aa5ebb..475f0852f6d6 100644 --- a/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceConvertFragment.java +++ b/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceConvertFragment.java @@ -252,7 +252,7 @@ public void onNothingSelected(AdapterView parentView) {} } private void dismissBinanceBottomSheet() { - FragmentManager fm = getActivity().getSupportFragmentManager(); + FragmentManager fm = getParentFragmentManager(); CryptoWidgetBottomSheetDialogFragment fragment = (CryptoWidgetBottomSheetDialogFragment) fm.findFragmentByTag( CryptoWidgetBottomSheetDialogFragment.TAG_FRAGMENT); diff --git a/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceDepositFragment.java b/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceDepositFragment.java index 8b08d4331e40..4082f32b77e4 100644 --- a/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceDepositFragment.java +++ b/android/java/org/chromium/chrome/browser/widget/crypto/binance/BinanceDepositFragment.java @@ -207,8 +207,8 @@ public void onClick(View view) { QRCodeShareDialogFragment mQRCodeShareDialogFragment = new QRCodeShareDialogFragment(); mQRCodeShareDialogFragment.setQRCodeText(depositAddress); - mQRCodeShareDialogFragment.show(getActivity().getSupportFragmentManager(), - "QRCodeShareDialogFragment"); + mQRCodeShareDialogFragment.show( + getParentFragmentManager(), "QRCodeShareDialogFragment"); } }); diff --git a/android/java/res/layout/bottom_control_container.xml b/android/java/res/layout/bottom_control_container.xml index 299df52de67e..614dbcd291d7 100644 --- a/android/java/res/layout/bottom_control_container.xml +++ b/android/java/res/layout/bottom_control_container.xml @@ -3,7 +3,7 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> - - + diff --git a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java index 1c68bb24de0e..a96c24065dd1 100644 --- a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java +++ b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java @@ -55,6 +55,7 @@ public void testClassesExist() throws Exception { Assert.assertTrue( classExists("org/chromium/chrome/browser/suggestions/tile/SuggestionsTileView")); Assert.assertTrue(classExists("org/chromium/chrome/browser/download/MimeUtils")); + Assert.assertTrue(classExists("org/chromium/chrome/browser/app/ChromeActivity")); } @Test @@ -163,12 +164,8 @@ public void testFieldsExist() throws Exception { "org/chromium/chrome/browser/toolbar/ToolbarManager", "mShareDelegateSupplier")); Assert.assertTrue(fieldExists( "org/chromium/chrome/browser/toolbar/ToolbarManager", "mScrimCoordinator")); - Assert.assertTrue( - fieldExists("org/chromium/chrome/browser/toolbar/ToolbarManager", "mActivity")); Assert.assertTrue(fieldExists( "org/chromium/chrome/browser/toolbar/ToolbarManager", "mShowStartSurfaceSupplier")); - Assert.assertTrue(fieldExists("org/chromium/chrome/browser/toolbar/ToolbarManager", - "mOverviewModeBehaviorSupplier")); Assert.assertTrue(fieldExists( "org/chromium/chrome/browser/toolbar/ToolbarManager", "mMenuButtonCoordinator")); Assert.assertTrue(fieldExists( @@ -204,6 +201,8 @@ public void testFieldsExist() throws Exception { Assert.assertTrue( fieldExists("org/chromium/chrome/browser/toolbar/top/TabSwitcherModeTTPhone", "mShouldShowNewTabVariation")); + Assert.assertTrue(fieldExists( + "org/chromium/chrome/browser/app/ChromeActivity", "mTabModelProfileSupplier")); } private boolean classExists(String className) { diff --git a/app/brave_main_delegate.cc b/app/brave_main_delegate.cc index 50070552a9fa..d21cd8d728fb 100644 --- a/app/brave_main_delegate.cc +++ b/app/brave_main_delegate.cc @@ -101,10 +101,8 @@ BraveMainDelegate::CreateContentBrowserClient() { return NULL; #else if (chrome_content_browser_client_ == nullptr) { - DCHECK(!startup_data_); - startup_data_ = std::make_unique(); chrome_content_browser_client_ = - std::make_unique(startup_data_.get()); + std::make_unique(); } return chrome_content_browser_client_.get(); #endif @@ -226,20 +224,20 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) { autofill::features::kAutofillEnableAccountWalletStorage.name, autofill::features::kAutofillServerCommunication.name, blink::features::kTextFragmentAnchor.name, - features::kAllowPopupsDuringPageUnload.name, features::kIdleDetection.name, features::kNotificationTriggers.name, features::kPrivacySettingsRedesign.name, features::kSignedExchangeSubresourcePrefetch.name, - features::kSmsReceiver.name, features::kTabHoverCards.name, + features::kVideoPlaybackQuality.name, + features::kWebOTP.name, network_time::kNetworkTimeServiceQuerying.name, password_manager::features::kPasswordCheck.name, safe_browsing::kEnhancedProtection.name, #if defined(OS_ANDROID) feed::kInterestFeedContentSuggestions.name, - translate::kTranslate.name, offline_pages::kPrefetchingOfflinePagesFeature.name, + translate::kTranslate.name, #endif }; diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc index c19e70e3936f..2d6fc0d5c21d 100644 --- a/app/brave_main_delegate_browsertest.cc +++ b/app/brave_main_delegate_browsertest.cc @@ -65,13 +65,13 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &autofill::features::kAutofillEnableAccountWalletStorage, &autofill::features::kAutofillServerCommunication, &blink::features::kTextFragmentAnchor, - &features::kAllowPopupsDuringPageUnload, &features::kIdleDetection, &features::kNotificationTriggers, &features::kPrivacySettingsRedesign, &features::kSignedExchangeSubresourcePrefetch, - &features::kSmsReceiver, &features::kTabHoverCards, + &features::kVideoPlaybackQuality, + &features::kWebOTP, &network_time::kNetworkTimeServiceQuerying, &password_manager::features::kPasswordCheck, &safe_browsing::kEnhancedProtection, diff --git a/app/brave_strings.grd b/app/brave_strings.grd index 66acc72f1999..eefa85d5c959 100644 --- a/app/brave_strings.grd +++ b/app/brave_strings.grd @@ -1164,7 +1164,7 @@ Brave is unable to recover your settings. Set up your new Brave profile - Ask when I open Brave + Ask when Brave opens diff --git a/app/extensions_strings.grdp b/app/extensions_strings.grdp index 1902f28f9f4d..e55c24ac954a 100644 --- a/app/extensions_strings.grdp +++ b/app/extensions_strings.grdp @@ -407,6 +407,9 @@ Type a shortcut + + Subpage button + Include Ctrl, Alt, or ⌘ diff --git a/app/generated_resources.grd b/app/generated_resources.grd index ef64c15502ad..f6f33be95239 100644 --- a/app/generated_resources.grd +++ b/app/generated_resources.grd @@ -441,12 +441,6 @@ are declared in tools/grit/grit_rule.gni. To get your tabs from your other devices, sign in to Brave. - - You can clear your browsing data from this menu - - - Close - @@ -2063,6 +2057,9 @@ are declared in tools/grit/grit_rule.gni. New Tab + + Page URL + @@ -3847,9 +3844,6 @@ are declared in tools/grit/grit_rule.gni. Access list of network connections - - Configure network connections - Manage network connections @@ -4208,6 +4202,9 @@ are declared in tools/grit/grit_rule.gni. Unpin + + Pinned by your administrator + Manage extensions @@ -4258,6 +4255,9 @@ are declared in tools/grit/grit_rule.gni. Unpin + + Pinned by your Administrator + Manage Extensions @@ -4720,12 +4720,6 @@ Keep your key file in a safe place. You will need it to create new versions of y Component updating - - - (Disabled) - - - Sign in as @@ -5471,16 +5465,16 @@ Keep your key file in a safe place. You will need it to create new versions of y Top picks for you - + Why am I seeing this? - + You’re seeing this item based on your previous activity using Brave services. You can see your data, delete it, and change your settings at <a href="$1" target="_blank" rel="noopener noreferrer">myactivity.google.com</a>. - + Learn about the data Brave collects and why at <a href="$1" target="_blank" rel="noopener noreferrer">policies.google.com</a>. - + Close @@ -5509,7 +5503,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Edit Bookmark - Read Later + Add to Reading List Mark as Read @@ -5523,7 +5517,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Edit bookmark - Read later + Add to reading list Mark as read @@ -5624,7 +5618,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Find - Tab search + Search tabs @@ -5708,7 +5702,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Reset to default zoom level - Tab search + Search tabs @@ -5780,6 +5774,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Reopen a tab if you accidentally closed it + + To get back to here quickly, install this app + $1CTRL+SHIFT+T can reopen accidentally closed tabs @@ -6128,6 +6125,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Close + + Describe the issue in detail + URL @@ -6193,7 +6193,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Go to the <a href="#" id="legal-help-page-url">Legal Help page</a> to request content changes for legal reasons. Some account and system information may be sent to Brave. We will use the information you give us to help address technical issues and to improve our services, subject to our <a href="#" id="privacy-policy-url">Privacy Policy</a> and <a href="#" id="terms-of-service-url">Terms of Service</a>. - Please tell us what is happening before sending the feedback. + Please describe the problem before sending feedback. Send @@ -6473,8 +6473,8 @@ Keep your key file in a safe place. You will need it to create new versions of y {NUM_TABS, plural, - =1 {Read tab later} - other {Read tabs later}} + =1 {Add tab to reading list} + other {Add tabs to reading list}} {NUM_TABS, plural, @@ -6545,8 +6545,8 @@ Keep your key file in a safe place. You will need it to create new versions of y {NUM_TABS, plural, - =1 {Read Tab Later} - other {Read Tabs Later}} + =1 {Add Tab to Reading List} + other {Add Tabs to Reading List}} {NUM_TABS, plural, @@ -6609,35 +6609,33 @@ Keep your key file in a safe place. You will need it to create new versions of y - - - Search Tabs - - - No Results Found - - - Close Tab - - - Submit Feedback - - - Tab Closed - - - Found $11 Tab - - - Found $12 Tabs - - - Found $11 Tab For '$2google' - - - Found $12 Tabs For '$2google' - - + + Search Tabs + + + No Results Found + + + Close Tab + + + Submit Feedback + + + Tab Closed + + + Found $11 Tab + + + Found $12 Tabs + + + Found $11 Tab For '$2google' + + + Found $12 Tabs For '$2google' + @@ -7611,6 +7609,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Split vertical + + Start app when you sign in + @@ -7668,6 +7669,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Split Vertical + + Start App When You Sign In + @@ -7712,6 +7716,12 @@ Keep your key file in a safe place. You will need it to create new versions of y No thanks + + Cancel + + + Switch + To keep your browsing separate, you can create a new profile for $1Bob @@ -7727,6 +7737,12 @@ Keep your key file in a safe place. You will need it to create new versions of y Work + + Switch to another profile? + + + $2Bob's profile is already signed in to $1bob@gmail.com + @@ -8326,6 +8342,33 @@ Please help our engineers fix this problem. Tell us what happened right before y Send message + + Details are hidden while you share your screen + + + + {MUTED_NOTIFICATIONS_COUNT, plural, + =1 {New notification} + other {# new notifications}} + + + {MUTED_NOTIFICATIONS_COUNT, plural, + =1 {Show} + other {Show all}} + + + + + {MUTED_NOTIFICATIONS_COUNT, plural, + =1 {New Notification} + other {# New Notifications}} + + + {MUTED_NOTIFICATIONS_COUNT, plural, + =1 {Show} + other {Show All}} + + Manage @@ -9223,6 +9266,24 @@ Please help our engineers fix this problem. Tell us what happened right before y Live Caption is not available right now + + + Live Caption visible, press Ctrl + Back or Ctrl + Forward to cycle focus + + + + + Live Caption visible, press ⌘ + Option + Up arrow or Down arrow to cycle focus + + + + + Live Caption visible, press F6 to cycle focus + + + + Moved caption bubble to $120% across, $280% down + @@ -9945,18 +10006,6 @@ Please help our engineers fix this problem. Tell us what happened right before y - - Always allow ads on this site - - - Ads blocked. - - - Ads blocked - - - This site shows intrusive or misleading ads. - Ads blocked on this site @@ -10738,6 +10787,9 @@ Please help our engineers fix this problem. Tell us what happened right before y Window name + + Commander + diff --git a/app/generated_resources_override.grd b/app/generated_resources_override.grd index 30ba7947364e..37de14b9e665 100644 --- a/app/generated_resources_override.grd +++ b/app/generated_resources_override.grd @@ -422,9 +422,6 @@ are declared in tools/grit/grit_rule.gni. - - - @@ -574,9 +571,6 @@ are declared in tools/grit/grit_rule.gni. - - - @@ -679,7 +673,7 @@ are declared in tools/grit/grit_rule.gni. - + @@ -688,7 +682,7 @@ are declared in tools/grit/grit_rule.gni. - + @@ -751,6 +745,10 @@ are declared in tools/grit/grit_rule.gni. + + + + @@ -792,6 +790,12 @@ are declared in tools/grit/grit_rule.gni. + + + + + + diff --git a/app/global_media_controls_strings.grdp b/app/global_media_controls_strings.grdp index 778c2885b55a..6b4b449a2c40 100644 --- a/app/global_media_controls_strings.grdp +++ b/app/global_media_controls_strings.grdp @@ -14,4 +14,10 @@ Devices + + Stop casting + + + Live Caption (English only) + diff --git a/app/nearby_share_strings.grdp b/app/nearby_share_strings.grdp index 19fd123de411..8aa497da601d 100644 --- a/app/nearby_share_strings.grdp +++ b/app/nearby_share_strings.grdp @@ -14,15 +14,6 @@ - - Contacts - - - Devices near you when Nearby Share is open on their device - - - Devices near you when Nearby Share is open on your device - No contacts are available. To use Nearby Share with your contacts, add the email address linked with their Brave sync chain to your contacts. @@ -30,19 +21,19 @@ No available contacts - Profiles who have chosen to be visible to you when their screen is unlocked + Profiles who have chosen to be visible to you when their screen is unlocked and devices near you when Nearby Share is open Devices you can share with - All contacts near you when your screen is unlocked + All contacts near you when your screen is unlocked and devices near you when Nearby Share is open - No one unless you open Nearby Share on your device + No one unless you open Nearby Share - Selected contacts near you when your screen is unlocked + Selected contacts near you when your screen is unlocked and devices near you when Nearby Share is open Who can share with your device @@ -67,7 +58,7 @@ - Make sure both devices are unlocked, close together, and have Bluetooth turned on. If you’re sharing with a Bravebook, make sure it has Nearby Sharing turned on (open the status area by selecting the time, then select Nearby Share). + Make sure both devices are unlocked, close together, and have Bluetooth turned on. If you’re sharing with a Bravebook, make sure it has Nearby Sharing turned on (open the status area by selecting the time, then select Nearby Share). <a>Learn more</a> Select the device you’d like to share files with @@ -163,8 +154,8 @@ - - Nearby Share settings for $1example@gmail.com's device, '$2My Bravebook'. + + Nearby Share settings for $1Jane Doe's device, sharing under the account $2example@gmail.com. All contacts diff --git a/app/nearby_share_strings_override.grdp b/app/nearby_share_strings_override.grdp index d9bee950142c..058c27e14cd9 100644 --- a/app/nearby_share_strings_override.grdp +++ b/app/nearby_share_strings_override.grdp @@ -2,7 +2,7 @@ - Profiles who have chosen to be visible to you when their screen is unlocked + Profiles who have chosen to be visible to you when their screen is unlocked and devices near you when Nearby Share is open Share files with profiles around you diff --git a/app/os_settings_search_tag_strings.grdp b/app/os_settings_search_tag_strings.grdp index 8987cd40a402..f9bf6cbb70df 100644 --- a/app/os_settings_search_tag_strings.grdp +++ b/app/os_settings_search_tag_strings.grdp @@ -105,6 +105,18 @@ Disconnect Cellular network + + Remove eSIM Cellular network + + + Remove eSIM profile + + + Rename eSIM Cellular network + + + Rename eSIM profile + Mobile networks @@ -250,10 +262,7 @@ Phone Hub notifications - - Phone Hub notifications badge - - + Phone Hub task continuation @@ -743,12 +752,15 @@ - + Linux - + Crostini + + Developers + Linux shared folders diff --git a/app/os_settings_strings.grdp b/app/os_settings_strings.grdp index c826a29c655d..54f8c28a16ca 100644 --- a/app/os_settings_strings.grdp +++ b/app/os_settings_strings.grdp @@ -70,6 +70,9 @@ Update schedule + + Device name + Your administrator is rolling back this device ($190%) @@ -157,6 +160,15 @@ See what's new + + Edit device name + + + This name is visible to other devices for Bluetooth and network connections + + + Name can use letters, numbers, and hyphens (-) + Your $1Bravebook is up to date @@ -499,7 +511,7 @@ - Enable reverse scrolling <a>Learn more</a> + Enable reverse scrolling. <a>Learn more</a> Device @@ -647,8 +659,11 @@ Preferred search engine - - Used by Brave browser and $1Bravebook Launcher + + Configure + + + Set your default search engine for Brave browser and $1Bravebook Launcher Brave Assistant @@ -959,6 +974,30 @@ $11.5s + + Please press a switch key to assign. + + + Press '$1backspace' again to confirm and exit. + + + '$1backspace' is already assigned. Press '$1backspace' again to remove assignment and exit. + + + Keys do not match. '$1enter' was pressed. '$2backspace' was pressed before. Press any key to exit. + + + Open a dialog to assign a switch key + + + '$1enter' is already assigned to the '$2Select' action. Press any key to exit. + + + Unrecognized key. Press any key to exit. + + + No switches assigned + Text-to-Speech @@ -1020,28 +1059,28 @@ Rate - Slowest + Slow - Fastest + Fast Pitch - Lowest + Low - Highest + High Volume - Quietest + Quiet - Loudest + Loud $1120% @@ -1149,11 +1188,11 @@ - - Linux (Beta) + + Developers - - Linux + + Linux development environment Manage shared folders @@ -1611,6 +1650,9 @@ Mouse + + TrackPoint + Touchpad @@ -1638,8 +1680,14 @@ Swap primary mouse button + + Left button + + + Right button + - Enable reverse scrolling <a>Learn more</a> + Enable reverse scrolling. <a>Learn more</a> Enable mouse acceleration @@ -2044,6 +2092,12 @@ Automatically connect to cellular network + + Remove profile + + + Rename + Activate @@ -2246,6 +2300,9 @@ Disabled + + Connected phone features enable. + Instant Tethering @@ -2264,9 +2321,6 @@ Notifications - - Notifications Badge - Task Continuation @@ -2276,9 +2330,6 @@ View your phones notifications on your $1Bravebook - - Indicator in shelf when new notifications come in - View your active Brave tabs in Phone Hub @@ -2297,11 +2348,20 @@ You will receive your phone notifications on your Bravebook - + Wi-Fi Sync - - Sync Wi-Fi networks with your phone <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> + + Sync Wi-Fi networks with your phone. <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> + + + Turn on <a id="chromeSyncLink">Brave Sync</a> to use Wi-Fi Sync. <a id="learnMoreLink" target="_blank" rel="noopener noreferrer" href="$1https://google.com/">Learn more</a> + + + Turn on Brave Sync to use Wi-Fi Sync + + + Wi-Fi Sync, Learn More diff --git a/app/printing_strings.grdp b/app/printing_strings.grdp index 1852e6efb48b..fa4d6ab86ed9 100644 --- a/app/printing_strings.grdp +++ b/app/printing_strings.grdp @@ -8,6 +8,10 @@ + + Print Backend Service + + The selected printer is not available or not installed correctly. Check your printer or try selecting another printer. @@ -17,6 +21,9 @@ Print + + Print preview dialog + Loading preview @@ -298,6 +305,9 @@ These settings are enforced by your administrator + + Print servers + Enable user pin diff --git a/app/profiles_strings.grdp b/app/profiles_strings.grdp index 56c63ea9cf40..ef7e54bc4fde 100644 --- a/app/profiles_strings.grdp +++ b/app/profiles_strings.grdp @@ -675,6 +675,14 @@ + + + Done + + + Pick a theme color + + Add diff --git a/app/settings_brave_strings.grdp b/app/settings_brave_strings.grdp index cd77049e2c16..54eb75daf999 100644 --- a/app/settings_brave_strings.grdp +++ b/app/settings_brave_strings.grdp @@ -141,33 +141,6 @@ Brave can't check your extensions. Try again later. - - Brave checks for unwanted software once a week - - - Brave checks for unwanted software once a week. Last checked: a moment ago. - - - {NUM_MINS, plural, - =1 {Brave checks for unwanted software once a week. Last checked: 1 minute ago.} - other {Brave checks for unwanted software once a week. Last checked: {NUM_MINS} minutes ago.}} - - - {NUM_HOURS, plural, - =1 {Brave checks for unwanted software once a week. Last checked: 1 hour ago.} - other {Brave checks for unwanted software once a week. Last checked: {NUM_HOURS} hours ago.}} - - - Brave checks for unwanted software once a week. Last checked: yesterday. - - - {NUM_DAYS, plural, - =1 {Brave checks for unwanted software once a week. Last checked: 1 day ago.} - other {Brave checks for unwanted software once a week. Last checked: {NUM_DAYS} days ago.}} - - - Brave found harmful software on your computer - diff --git a/app/settings_strings.grdp b/app/settings_strings.grdp index e5c980dcc2ce..dbff0f38abd5 100644 --- a/app/settings_strings.grdp +++ b/app/settings_strings.grdp @@ -263,6 +263,12 @@ Remove + + Are you sure you want to remove this address? + + + Remove address + Remove @@ -917,9 +923,6 @@ Cookies and other site data - - Cookies and other site and plugin data - Passwords and other sign-in data @@ -1290,13 +1293,54 @@ Review extensions - - Device software - - - Review device software - - + + + Device software + + + Review device software + + + Brave can check your computer for harmful software + + + Brave didn't find known harmful software on your computer. Last checked: a moment ago. + + + {NUM_MINS, plural, + =1 {Brave didn't find known harmful software on your computer. Last checked: 1 minute ago.} + other {Brave didn't find known harmful software on your computer. Last checked: {NUM_MINS} minutes ago.}} + + + {NUM_HOURS, plural, + =1 {Brave didn't find known harmful software on your computer. Last checked: 1 hour ago.} + other {Brave didn't find known harmful software on your computer. Last checked: {NUM_HOURS} hours ago.}} + + + Brave didn't find known harmful software on your computer. Last checked: yesterday. + + + {NUM_DAYS, plural, + =1 {Brave didn't find known harmful software on your computer. Last checked: 1 day ago.} + other {Brave didn't find known harmful software on your computer. Last checked: {NUM_DAYS} days ago.}} + + + Brave found harmful software on your computer + + + Brave is checking your computer for harmful software... + + + Brave is removing harmful software from your computer... + + + <a target="_blank" rel="noopener noreferrer" href="$1">Your administrator</a> has disabled Brave's check for harmful software + + + An error occurred while Brave was checking your computer for harmful software + + + Preload pages for faster browsing and searching @@ -1636,6 +1680,9 @@ Sites automatically follow this setting when you visit them + + Customized behaviors + Sites usually show ads so they can provide content or services for free. But, some sites are known to show intrusive or misleading ads. @@ -1645,6 +1692,12 @@ Block ads on sites that show intrusive or misleading ads (recommended) + + Allowed to show any ads + + + Not allowed to show intrusive or misleading ads + Sites usually track your camera position for AR features, like games or heads-up directions @@ -1654,6 +1707,12 @@ Block sites from tracking your camera position + + Allowed to track your camera position + + + Not allowed to track your camera position + Sites might automatically download related files together to save you time @@ -1663,6 +1722,12 @@ Block sites from automatically downloading multiple files + + Allowed to automatically download multiple files + + + Not allowed to automatically download multiple files + After you leave or go offline, sites usually keep syncing to finish tasks, like uploading photos or sending a chat message @@ -1672,6 +1737,12 @@ Block closed sites from sending and receiving data + + Allowed to finish sending and receiving data + + + Not allowed to finish sending or receiving data + Sites usually use your video camera for communication features like video chatting @@ -1684,6 +1755,12 @@ Features that need a camera won't work + + Allowed to use your camera + + + Not allowed to use your camera + Sites usually read your clipboard for features like keeping the formatting of text you copied @@ -1693,6 +1770,12 @@ Block sites from seeing text and images on your clipboard + + Allowed to see your clipboard + + + Not allowed to see your clipboard + Sites usually access files and folders on your device for features like automatically saving your work @@ -1702,6 +1785,9 @@ Block sites from editing files and folders on your device + + Not allowed to edit files and folders on your device + Sites usually use your location for relevant features or info, like local news or nearby shops @@ -1714,6 +1800,12 @@ Features that need your location won't work + + Allowed to see your location + + + Not allowed to see your location + Sites usually show images to provide illustration, like photos for online stores or news articles @@ -1723,6 +1815,12 @@ Block images + + Allowed to show images + + + Not allowed to show images + Sites usually use Javascript to display interactive features, like video games or web forms @@ -1732,6 +1830,12 @@ Block Javascript + + Allowed to use Javascript + + + Not allowed to use Javascript + Sites usually use your microphone for communication features like video chatting @@ -1744,6 +1848,12 @@ Features that need a microphone won't work + + Allowed to use your microphone + + + Not allowed to use your microphone + Sites usually connect to MIDI devices for features for creating and editing music @@ -1753,6 +1863,42 @@ Block sites from connecting to MIDI devices + + Allowed to connect to MIDI devices + + + Not allowed to connect to MIDI devices + + + Allowed to show insecure content + + + Not allowed to show insecure content + + + Sites usually send notifications to let you know about breaking news or chat messages + + + Sites can ask to send notifications + + + Use quieter messaging (recommended) + + + Sites can't interrupt you by asking to send notifications + + + Block notifications + + + Features that need notifications won't work + + + Allowed to send notifications + + + Not allowed to send notifications + Sites usually install payment handlers for shopping features like easier checkout @@ -1762,14 +1908,11 @@ Block payment handlers - - Sites usually use Flash to play audio, video, or video games. Flash Player will no longer be supported after December 2020. + + Allowed to install payment handlers - - Sites can ask to use Flash - - - Block Flash (recommended) + + Not allowed to install payment handlers Sites might send pop-ups to show ads, or use redirects to lead you to websites you may not want to visit @@ -1780,6 +1923,12 @@ Block pop-ups and redirects (recommended) + + Allowed to send pop-ups and use redirects + + + Not allowed to send pop-ups or use redirects + When a site plays content protected by copyright, it might ask to recognize your device @@ -1789,6 +1938,12 @@ Block protected content + + Allowed to play protected content + + + Not allowed to play protected content + Sites usually use your device's motion sensors for features like virtual reality or step counting @@ -1801,6 +1956,12 @@ Features that need motion sensors won't work + + Allowed to use motion sensors + + + Not allowed to use motion sensors + Sites usually connect to serial devices for data transfer features, like setting up your network @@ -1819,6 +1980,12 @@ Mute sound + + Allowed to play sound + + + Not allowed to play sound + Sites usually use plugins for features like streaming videos or installing apps @@ -1828,6 +1995,12 @@ Block plugins from accessing your computer + + Allowed to use a plugin to access your computer + + + Not allowed to use a plugin to access your computer + Sites usually connect to USB devices for features like printing a document or saving to a storage device @@ -1846,6 +2019,12 @@ Block sites from using virtual reality devices and data + + Allowed to use virtual reality devices and data + + + Not allowed to use virtual reality devices and data + You can set how much you zoom in or out on certain websites @@ -1990,9 +2169,6 @@ JavaScript - - Flash - Payment Handlers @@ -2196,21 +2372,6 @@ Allow sites to save and read cookie data (recommended) - - Block sites from running Flash - - - Block sites from running Flash (recommended) - - - Your Flash settings will be kept until you quit Brave. - - - Settings with "*" wildcards are no longer supported. Contact the extension developer or your administrator to <a is="action-link" href="$1" target="_blank" rel="noopener noreferrer">change these settings</a>. - - - Settings with "*" wildcards are no longer supported. Contact your administrator to <a is="action-link" href="$1" target="_blank" rel="noopener noreferrer">change these settings</a>. - Allow recently closed sites to finish sending and receiving data @@ -2293,7 +2454,7 @@ Block sites from using fonts installed on your device - User presence + Your presence Ask when a site wants to know when you're present @@ -2539,9 +2700,6 @@ Search cookies - - Adobe Flash Player Storage settings - Default @@ -2999,6 +3157,9 @@ Report details to Brave about harmful software, system settings, and processes that were found on your computer during this cleanup + + Notify me when Brave has finished searching for harmful software + Cleanup is currently unavailable diff --git a/app/settings_strings_override.grdp b/app/settings_strings_override.grdp index ec588aa41447..c85e59650daf 100644 --- a/app/settings_strings_override.grdp +++ b/app/settings_strings_override.grdp @@ -57,6 +57,9 @@ + + + Current private session: $1automatically blocked Notifications diff --git a/app/shared_settings_strings.grdp b/app/shared_settings_strings.grdp index 70821a65c657..27ea69fadd95 100644 --- a/app/shared_settings_strings.grdp +++ b/app/shared_settings_strings.grdp @@ -11,17 +11,14 @@ - - Caption preferences - - - Customize caption size and style for apps that support this setting + + Captions - - Settings + + Caption preferences - - Preview + + Customize caption size and style for apps and sites that support this setting Text size (Also applies to Live Caption) @@ -280,6 +277,9 @@ Bookmarks + + Reading List + Encryption options diff --git a/app/sharesheet_strings.grdp b/app/sharesheet_strings.grdp index 26611fe1ce54..6f06480e86fa 100644 --- a/app/sharesheet_strings.grdp +++ b/app/sharesheet_strings.grdp @@ -15,4 +15,7 @@ Fewer apps + + No apps available + diff --git a/app/vector_icons/BUILD.gn b/app/vector_icons/BUILD.gn index f31dc0bda304..33725e586783 100644 --- a/app/vector_icons/BUILD.gn +++ b/app/vector_icons/BUILD.gn @@ -4,7 +4,7 @@ import("//components/vector_icons/vector_icons.gni") -aggregate_vector_icons2("brave_vector_icons") { +aggregate_vector_icons("brave_vector_icons") { icon_directory = "." sources = [ diff --git a/browser/BUILD.gn b/browser/BUILD.gn index 5ecae4749b6d..b4e2aab7f280 100644 --- a/browser/BUILD.gn +++ b/browser/BUILD.gn @@ -183,6 +183,7 @@ source_set("browser_process") { "//content/public/browser", "//content/public/common", "//extensions/buildflags", + "//services/metrics/public/cpp:metrics_cpp", "//services/network/public/cpp", "//third_party/blink/public/common", "//third_party/blink/public/mojom:mojom_platform_headers", diff --git a/browser/android/brave_sync_worker.cc b/browser/android/brave_sync_worker.cc index 62c0ee0ceb91..e070b5b9da07 100644 --- a/browser/android/brave_sync_worker.cc +++ b/browser/android/brave_sync_worker.cc @@ -309,21 +309,15 @@ void BraveSyncWorker::OnStateChanged(syncer::SyncService* sync) { return; } - // Don't allow "encrypt all" if the SyncService doesn't allow it. - // The UI is hidden, but the user may have enabled it e.g. by fiddling with - // the web inspector. - if (!service->GetUserSettings()->IsEncryptEverythingAllowed()) { - configuration.encrypt_all = false; + if (service->GetUserSettings()->IsEncryptEverythingAllowed()) { + ProfileMetrics::LogProfileSyncInfo(ProfileMetrics::SYNC_ENCRYPT); + } else { + // Don't allow "encrypt all" if the SyncService doesn't allow it. + // The UI is hidden, but the user may have enabled it e.g. by fiddling with + // the web inspector. configuration.set_new_passphrase = false; } - // Note: Data encryption will not occur until configuration is complete - // (when the PSS receives its CONFIGURE_DONE notification from the sync - // engine), so the user still has a chance to cancel out of the operation - // if (for example) some kind of passphrase error is encountered. - if (configuration.encrypt_all) - service->GetUserSettings()->EnableEncryptEverything(); - bool passphrase_failed = false; if (!configuration.passphrase.empty()) { // We call IsPassphraseRequired() here (instead of @@ -359,8 +353,6 @@ void BraveSyncWorker::OnStateChanged(syncer::SyncService* sync) { VLOG(1) << __func__ << " setup passphrase failed"; } - if (configuration.encrypt_all) - ProfileMetrics::LogProfileSyncInfo(ProfileMetrics::SYNC_ENCRYPT); if (!configuration.set_new_passphrase && !configuration.passphrase.empty()) ProfileMetrics::LogProfileSyncInfo(ProfileMetrics::SYNC_PASSPHRASE); } diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc index 861b0b012d52..57fa5d076136 100644 --- a/browser/brave_content_browser_client.cc +++ b/browser/brave_content_browser_client.cc @@ -130,9 +130,8 @@ bool HandleURLRewrite(GURL* url, content::BrowserContext* browser_context) { } // namespace -BraveContentBrowserClient::BraveContentBrowserClient(StartupData* startup_data) - : ChromeContentBrowserClient(startup_data), - session_token_(base::RandUint64()), +BraveContentBrowserClient::BraveContentBrowserClient() + : session_token_(base::RandUint64()), incognito_session_token_(base::RandUint64()) {} BraveContentBrowserClient::~BraveContentBrowserClient() {} @@ -286,7 +285,7 @@ bool BraveContentBrowserClient::WillCreateURLLoaderFactory( URLLoaderFactoryType type, const url::Origin& request_initiator, base::Optional navigation_id, - base::UkmSourceId ukm_source_id, + ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* header_client, diff --git a/browser/brave_content_browser_client.h b/browser/brave_content_browser_client.h index 75322a466231..7a5951cca638 100644 --- a/browser/brave_content_browser_client.h +++ b/browser/brave_content_browser_client.h @@ -15,6 +15,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "mojo/public/cpp/bindings/pending_remote.h" +#include "services/metrics/public/cpp/ukm_source_id.h" #include "third_party/blink/public/mojom/loader/referrer.mojom.h" class PrefChangeRegistrar; @@ -25,7 +26,7 @@ class BrowserContext; class BraveContentBrowserClient : public ChromeContentBrowserClient { public: - explicit BraveContentBrowserClient(StartupData* startup_data = nullptr); + BraveContentBrowserClient(); ~BraveContentBrowserClient() override; // Overridden from ChromeContentBrowserClient: @@ -68,7 +69,7 @@ class BraveContentBrowserClient : public ChromeContentBrowserClient { URLLoaderFactoryType type, const url::Origin& request_initiator, base::Optional navigation_id, - base::UkmSourceId ukm_source_id, + ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* header_client, diff --git a/browser/brave_content_browser_client_browsertest.cc b/browser/brave_content_browser_client_browsertest.cc index c2e5aeae2ee8..26f7c9907830 100644 --- a/browser/brave_content_browser_client_browsertest.cc +++ b/browser/brave_content_browser_client_browsertest.cc @@ -125,14 +125,13 @@ class BraveContentBrowserClientTest : public InProcessBrowserTest { }; IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadChromeURL) { - std::vector pages { - chrome::kChromeUIWelcomeHost, + std::vector pages{ + chrome::kChromeUIWelcomeHost, }; - std::vector schemes { - "about:", - "brave://", - "chrome://", + std::vector schemes{ + "brave://", + "chrome://", }; for (const std::string& page : pages) { @@ -142,14 +141,21 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadChromeURL) { ui_test_utils::NavigateToURL(browser(), GURL(scheme + page + "/")); ASSERT_TRUE(WaitForLoadStop(contents)); - EXPECT_STREQ(base::UTF16ToUTF8(browser()->location_bar_model() - ->GetFormattedFullURL()).c_str(), + EXPECT_STREQ(base::UTF16ToUTF8( + browser()->location_bar_model()->GetFormattedFullURL()) + .c_str(), ("brave://" + page).c_str()); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetVirtualURL().spec().c_str(), + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetVirtualURL() + .spec() + .c_str(), ("chrome://" + page + "/").c_str()); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetURL().spec().c_str(), + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetURL() + .spec() + .c_str(), ("chrome://" + page + "/").c_str()); } } @@ -163,9 +169,9 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadCustomBravePages) { #endif }; - std::vector schemes { - "brave://", - "chrome://", + std::vector schemes{ + "brave://", + "chrome://", }; for (const std::string& page : pages) { @@ -175,64 +181,84 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadCustomBravePages) { ui_test_utils::NavigateToURL(browser(), GURL(scheme + page + "/")); ASSERT_TRUE(WaitForLoadStop(contents)); - EXPECT_STREQ(base::UTF16ToUTF8(browser()->location_bar_model() - ->GetFormattedFullURL()).c_str(), + EXPECT_STREQ(base::UTF16ToUTF8( + browser()->location_bar_model()->GetFormattedFullURL()) + .c_str(), ("brave://" + page).c_str()); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetVirtualURL().spec().c_str(), + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetVirtualURL() + .spec() + .c_str(), ("chrome://" + page + "/").c_str()); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetURL().spec().c_str(), + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetURL() + .spec() + .c_str(), ("chrome://" + page + "/").c_str()); } } } IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, CanLoadAboutHost) { - std::vector schemes { - "chrome://", - "brave://", + std::vector schemes{ + "chrome://", + "brave://", }; for (const std::string& scheme : schemes) { content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); ui_test_utils::NavigateToURL(browser(), GURL(scheme + "about/")); - ASSERT_TRUE(WaitForLoadStop(contents)); + ASSERT_TRUE(WaitForLoadStop(contents)); - EXPECT_STREQ(base::UTF16ToUTF8(browser()->location_bar_model() - ->GetFormattedFullURL()).c_str(), - "brave://about"); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetVirtualURL().spec().c_str(), - "chrome://about/"); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetURL().spec().c_str(), - "chrome://chrome-urls/"); + EXPECT_STREQ(base::UTF16ToUTF8( + browser()->location_bar_model()->GetFormattedFullURL()) + .c_str(), + "brave://about"); + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetVirtualURL() + .spec() + .c_str(), + "chrome://about/"); + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetURL() + .spec() + .c_str(), + "chrome://chrome-urls/"); } } -IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, - RewriteChromeSync) { - std::vector schemes { - "brave://", - "chrome://", +IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientTest, RewriteChromeSync) { + std::vector schemes{ + "brave://", + "chrome://", }; for (const std::string& scheme : schemes) { content::WebContents* contents = - browser()->tab_strip_model()->GetActiveWebContents(); + browser()->tab_strip_model()->GetActiveWebContents(); ui_test_utils::NavigateToURL(browser(), GURL(scheme + chrome::kChromeUISyncHost)); ASSERT_TRUE(WaitForLoadStop(contents)); - EXPECT_STREQ(base::UTF16ToUTF8(browser()->location_bar_model() - ->GetFormattedFullURL()).c_str(), + EXPECT_STREQ(base::UTF16ToUTF8( + browser()->location_bar_model()->GetFormattedFullURL()) + .c_str(), "brave://sync"); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetVirtualURL().spec().c_str(), + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetVirtualURL() + .spec() + .c_str(), "chrome://sync/"); - EXPECT_STREQ(contents->GetController().GetLastCommittedEntry() - ->GetURL().spec().c_str(), + EXPECT_STREQ(contents->GetController() + .GetLastCommittedEntry() + ->GetURL() + .spec() + .c_str(), "chrome://settings/braveSync"); } } @@ -471,65 +497,56 @@ IN_PROC_BROWSER_TEST_F(BraveContentBrowserClientReferrerTest, // Cross-origin navigations don't get a referrer. blink::mojom::ReferrerPtr referrer = kReferrer.Clone(); - client()->MaybeHideReferrer(browser()->profile(), - kRequestUrl, kDocumentUrl, true, "GET", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kRequestUrl, kDocumentUrl, + true, "GET", &referrer); EXPECT_EQ(referrer->url, GURL()); // Cross-origin navigations get a truncated referrer if method is not "GET" or // "HEAD". referrer = kReferrer.Clone(); - client()->MaybeHideReferrer(browser()->profile(), - kRequestUrl, kDocumentUrl, true, "POST", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kRequestUrl, kDocumentUrl, + true, "POST", &referrer); EXPECT_EQ(referrer->url, kDocumentUrl.GetOrigin()); // Same-origin navigations get full referrers. referrer = kReferrer.Clone(); - client()->MaybeHideReferrer(browser()->profile(), - kSameOriginRequestUrl, kDocumentUrl, true, "GET", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kSameOriginRequestUrl, + kDocumentUrl, true, "GET", &referrer); EXPECT_EQ(referrer->url, kDocumentUrl); // Same-site navigations get truncated referrers. referrer = kReferrer.Clone(); - client()->MaybeHideReferrer(browser()->profile(), - kSameSiteRequestUrl, kDocumentUrl, true, "GET", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kSameSiteRequestUrl, + kDocumentUrl, true, "GET", &referrer); EXPECT_EQ(referrer->url, kDocumentUrl.GetOrigin()); // Cross-origin iframe navigations get origins. referrer = kReferrer.Clone(); - client()->MaybeHideReferrer(browser()->profile(), - kRequestUrl, kDocumentUrl, false, "GET", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kRequestUrl, kDocumentUrl, + false, "GET", &referrer); EXPECT_EQ(referrer->url, kDocumentUrl.GetOrigin().spec()); // Same-origin iframe navigations get full referrers. referrer = kReferrer.Clone(); - client()->MaybeHideReferrer(browser()->profile(), - kSameOriginRequestUrl, kDocumentUrl, false, "GET", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kSameOriginRequestUrl, + kDocumentUrl, false, "GET", &referrer); EXPECT_EQ(referrer->url, kDocumentUrl); // Special rule for extensions. const GURL kExtensionUrl("chrome-extension://abc/path?query"); referrer = kReferrer.Clone(); referrer->url = kExtensionUrl; - client()->MaybeHideReferrer(browser()->profile(), - kRequestUrl, kExtensionUrl, true, "GET", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kRequestUrl, kExtensionUrl, + true, "GET", &referrer); EXPECT_EQ(referrer->url, kExtensionUrl); // Allow referrers for certain URL. content_settings()->SetContentSettingCustomScope( ContentSettingsPattern::FromString(kDocumentUrl.GetOrigin().spec() + "*"), - ContentSettingsPattern::Wildcard(), - ContentSettingsType::PLUGINS, + ContentSettingsPattern::Wildcard(), ContentSettingsType::PLUGINS, brave_shields::kReferrers, CONTENT_SETTING_ALLOW); referrer = kReferrer.Clone(); - client()->MaybeHideReferrer(browser()->profile(), - kRequestUrl, kDocumentUrl, true, "GET", - &referrer); + client()->MaybeHideReferrer(browser()->profile(), kRequestUrl, kDocumentUrl, + true, "GET", &referrer); EXPECT_EQ(referrer->url, kDocumentUrl); } diff --git a/browser/brave_stats/brave_stats_updater_browsertest.cc b/browser/brave_stats/brave_stats_updater_browsertest.cc index 4072974b5aae..20d616b67b49 100644 --- a/browser/brave_stats/brave_stats_updater_browsertest.cc +++ b/browser/brave_stats/brave_stats_updater_browsertest.cc @@ -5,6 +5,7 @@ #include "base/command_line.h" #include "base/environment.h" +#include "base/files/file_util.h" #include "base/path_service.h" #include "base/time/time.h" #include "brave/browser/brave_referrals/brave_referrals_service_factory.h" diff --git a/browser/browsing_data/brave_clear_browsing_data_browsertest.cc b/browser/browsing_data/brave_clear_browsing_data_browsertest.cc index 3dece290da42..c44b788c6046 100644 --- a/browser/browsing_data/brave_clear_browsing_data_browsertest.cc +++ b/browser/browsing_data/brave_clear_browsing_data_browsertest.cc @@ -3,6 +3,7 @@ * 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/. */ +#include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/macros.h" #include "base/path_service.h" diff --git a/browser/extensions/api/binance_api.cc b/browser/extensions/api/binance_api.cc index 241237e5a033..1b01d40f359e 100644 --- a/browser/extensions/api/binance_api.cc +++ b/browser/extensions/api/binance_api.cc @@ -50,8 +50,7 @@ BinanceGetUserTLDFunction::Run() { auto* service = GetBinanceService(browser_context()); const std::string user_tld = service->GetBinanceTLD(); - return RespondNow(OneArgument( - std::make_unique(user_tld))); + return RespondNow(OneArgument(base::Value(user_tld))); } ExtensionFunction::ResponseAction @@ -63,8 +62,7 @@ BinanceGetClientUrlFunction::Run() { auto* service = GetBinanceService(browser_context()); const std::string client_url = service->GetOAuthClientUrl(); - return RespondNow(OneArgument( - std::make_unique(client_url))); + return RespondNow(OneArgument(base::Value(client_url))); } ExtensionFunction::ResponseAction @@ -86,7 +84,7 @@ BinanceGetAccessTokenFunction::Run() { } void BinanceGetAccessTokenFunction::OnCodeResult(bool success) { - Respond(OneArgument(std::make_unique(success))); + Respond(OneArgument(base::Value(success))); } ExtensionFunction::ResponseAction @@ -111,18 +109,17 @@ BinanceGetAccountBalancesFunction::Run() { void BinanceGetAccountBalancesFunction::OnGetAccountBalances( const BinanceAccountBalances& balances, bool success) { - std::unique_ptr result(new base::DictionaryValue()); + base::DictionaryValue result; for (const auto& balance : balances) { auto info = std::make_unique(); info->SetString("balance", balance.second[0]); info->SetString("btcValue", balance.second[1]); info->SetString("fiatValue", balance.second[2]); - result->SetDictionary(balance.first, std::move(info)); + result.SetDictionary(balance.first, std::move(info)); } - Respond(TwoArguments(std::move(result), - std::make_unique(success))); + Respond(TwoArguments(std::move(result), base::Value(success))); } ExtensionFunction::ResponseAction @@ -152,11 +149,11 @@ BinanceGetConvertQuoteFunction::Run() { void BinanceGetConvertQuoteFunction::OnQuoteResult( const std::string& quote_id, const std::string& quote_price, const std::string& total_fee, const std::string& total_amount) { - auto quote = std::make_unique(base::Value::Type::DICTIONARY); - quote->SetStringKey("id", quote_id); - quote->SetStringKey("price", quote_price); - quote->SetStringKey("fee", total_fee); - quote->SetStringKey("amount", total_amount); + base::Value quote(base::Value::Type::DICTIONARY); + quote.SetStringKey("id", quote_id); + quote.SetStringKey("price", quote_price); + quote.SetStringKey("fee", total_fee); + quote.SetStringKey("amount", total_amount); Respond(OneArgument(std::move(quote))); } @@ -169,8 +166,7 @@ BinanceIsSupportedRegionFunction::Run() { auto* service = GetBinanceService(browser_context()); bool is_supported = service->IsSupportedRegion(); - return RespondNow(OneArgument( - std::make_unique(is_supported))); + return RespondNow(OneArgument(base::Value(is_supported))); } ExtensionFunction::ResponseAction @@ -201,9 +197,7 @@ void BinanceGetDepositInfoFunction::OnGetDepositInfo( const std::string& deposit_address, const std::string& deposit_tag, bool success) { - Respond(TwoArguments( - std::make_unique(deposit_address), - std::make_unique(deposit_tag))); + Respond(TwoArguments(base::Value(deposit_address), base::Value(deposit_tag))); } ExtensionFunction::ResponseAction @@ -231,9 +225,7 @@ BinanceConfirmConvertFunction::Run() { void BinanceConfirmConvertFunction::OnConfirmConvert( bool success, const std::string& message) { - Respond(TwoArguments( - std::make_unique(success), - std::make_unique(message))); + Respond(TwoArguments(base::Value(success), base::Value(message))); } ExtensionFunction::ResponseAction @@ -256,8 +248,7 @@ BinanceGetConvertAssetsFunction::Run() { void BinanceGetConvertAssetsFunction::OnGetConvertAssets( const BinanceConvertAsserts& assets) { - auto result = std::make_unique( - base::Value::Type::DICTIONARY); + base::Value result(base::Value::Type::DICTIONARY); for (const auto& asset : assets) { base::ListValue sub_selectors; @@ -269,7 +260,7 @@ void BinanceGetConvertAssetsFunction::OnGetConvertAssets( } sub_selectors.Append(std::move(sub_selector)); } - result->SetKey(asset.first, std::move(sub_selectors)); + result.SetKey(asset.first, std::move(sub_selectors)); } Respond(OneArgument(std::move(result))); @@ -294,7 +285,7 @@ BinanceRevokeTokenFunction::Run() { } void BinanceRevokeTokenFunction::OnRevokeToken(bool success) { - Respond(OneArgument(std::make_unique(success))); + Respond(OneArgument(base::Value(success))); } ExtensionFunction::ResponseAction @@ -318,11 +309,10 @@ BinanceGetCoinNetworksFunction::Run() { void BinanceGetCoinNetworksFunction::OnGetCoinNetworks( const BinanceCoinNetworks& networks) { - auto coin_networks = std::make_unique( - base::Value::Type::DICTIONARY); + base::Value coin_networks(base::Value::Type::DICTIONARY); for (const auto& network : networks) { - coin_networks->SetStringKey(network.first, network.second); + coin_networks.SetStringKey(network.first, network.second); } Respond(OneArgument(std::move(coin_networks))); diff --git a/browser/extensions/api/brave_rewards_api.cc b/browser/extensions/api/brave_rewards_api.cc index bf3633237471..9658fda64a54 100644 --- a/browser/extensions/api/brave_rewards_api.cc +++ b/browser/extensions/api/brave_rewards_api.cc @@ -114,24 +114,21 @@ void BraveRewardsGetPublisherInfoFunction::OnGetPublisherInfo( const ledger::type::Result result, ledger::type::PublisherInfoPtr info) { if (!info) { - Respond( - OneArgument(std::make_unique(static_cast(result)))); + Respond(OneArgument(base::Value(static_cast(result)))); return; } - auto dict = std::make_unique(base::Value::Type::DICTIONARY); - dict->SetStringKey("publisherKey", info->id); - dict->SetStringKey("name", info->name); - dict->SetIntKey("percentage", info->percent); - dict->SetIntKey("status", static_cast(info->status)); - dict->SetIntKey("excluded", static_cast(info->excluded)); - dict->SetStringKey("url", info->url); - dict->SetStringKey("provider", info->provider); - dict->SetStringKey("favIconUrl", info->favicon_url); + base::Value dict(base::Value::Type::DICTIONARY); + dict.SetStringKey("publisherKey", info->id); + dict.SetStringKey("name", info->name); + dict.SetIntKey("percentage", info->percent); + dict.SetIntKey("status", static_cast(info->status)); + dict.SetIntKey("excluded", static_cast(info->excluded)); + dict.SetStringKey("url", info->url); + dict.SetStringKey("provider", info->provider); + dict.SetStringKey("favIconUrl", info->favicon_url); - Respond(TwoArguments( - std::make_unique(static_cast(result)), - std::move(dict))); + Respond(TwoArguments(base::Value(static_cast(result)), std::move(dict))); } BraveRewardsGetPublisherPanelInfoFunction:: @@ -164,24 +161,21 @@ void BraveRewardsGetPublisherPanelInfoFunction::OnGetPublisherPanelInfo( const ledger::type::Result result, ledger::type::PublisherInfoPtr info) { if (!info) { - Respond( - OneArgument(std::make_unique(static_cast(result)))); + Respond(OneArgument(base::Value(static_cast(result)))); return; } - auto dict = std::make_unique(base::Value::Type::DICTIONARY); - dict->SetStringKey("publisherKey", info->id); - dict->SetStringKey("name", info->name); - dict->SetIntKey("percentage", info->percent); - dict->SetIntKey("status", static_cast(info->status)); - dict->SetIntKey("excluded", static_cast(info->excluded)); - dict->SetStringKey("url", info->url); - dict->SetStringKey("provider", info->provider); - dict->SetStringKey("favIconUrl", info->favicon_url); + base::Value dict(base::Value::Type::DICTIONARY); + dict.SetStringKey("publisherKey", info->id); + dict.SetStringKey("name", info->name); + dict.SetIntKey("percentage", info->percent); + dict.SetIntKey("status", static_cast(info->status)); + dict.SetIntKey("excluded", static_cast(info->excluded)); + dict.SetStringKey("url", info->url); + dict.SetStringKey("provider", info->provider); + dict.SetStringKey("favIconUrl", info->favicon_url); - Respond(TwoArguments( - std::make_unique(static_cast(result)), - std::move(dict))); + Respond(TwoArguments(base::Value(static_cast(result)), std::move(dict))); } BraveRewardsSavePublisherInfoFunction:: @@ -221,7 +215,7 @@ BraveRewardsSavePublisherInfoFunction::Run() { void BraveRewardsSavePublisherInfoFunction::OnSavePublisherInfo( const ledger::type::Result result) { - Respond(OneArgument(std::make_unique(static_cast(result)))); + Respond(OneArgument(base::Value(static_cast(result)))); } BraveRewardsTipSiteFunction::~BraveRewardsTipSiteFunction() { @@ -465,7 +459,7 @@ BraveRewardsGetRewardsParametersFunction::Run() { Profile* profile = Profile::FromBrowserContext(browser_context()); auto* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - auto data = std::make_unique(base::Value::Type::DICTIONARY); + base::Value data(base::Value::Type::DICTIONARY); return RespondNow(OneArgument(std::move(data))); } @@ -477,18 +471,18 @@ BraveRewardsGetRewardsParametersFunction::Run() { void BraveRewardsGetRewardsParametersFunction::OnGet( ledger::type::RewardsParametersPtr parameters) { - auto data = std::make_unique(); + base::DictionaryValue data; if (!parameters) { return Respond(OneArgument(std::move(data))); } - data->SetDouble("rate", parameters->rate); + data.SetDouble("rate", parameters->rate); auto monthly_choices = std::make_unique(); for (auto const& item : parameters->monthly_tip_choices) { monthly_choices->Append(base::Value(item)); } - data->SetList("monthlyTipChoices", std::move(monthly_choices)); + data.SetList("monthlyTipChoices", std::move(monthly_choices)); Respond(OneArgument(std::move(data))); } @@ -500,7 +494,7 @@ ExtensionFunction::ResponseAction BraveRewardsGetBalanceReportFunction::Run() { Profile* profile = Profile::FromBrowserContext(browser_context()); auto* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - auto data = std::make_unique(base::Value::Type::DICTIONARY); + base::Value data(base::Value::Type::DICTIONARY); return RespondNow(OneArgument(std::move(data))); } @@ -519,16 +513,16 @@ ExtensionFunction::ResponseAction BraveRewardsGetBalanceReportFunction::Run() { void BraveRewardsGetBalanceReportFunction::OnBalanceReport( const ledger::type::Result result, ledger::type::BalanceReportInfoPtr report) { - auto data = std::make_unique(base::Value::Type::DICTIONARY); + base::Value data(base::Value::Type::DICTIONARY); if (!report) { Respond(OneArgument(std::move(data))); return; } - data->SetDoubleKey("ads", report->earning_from_ads); - data->SetDoubleKey("contribute", report->auto_contribute); - data->SetDoubleKey("grant", report->grants); - data->SetDoubleKey("tips", report->one_time_donation); - data->SetDoubleKey("monthly", report->recurring_donation); + data.SetDoubleKey("ads", report->earning_from_ads); + data.SetDoubleKey("contribute", report->auto_contribute); + data.SetDoubleKey("grant", report->grants); + data.SetDoubleKey("tips", report->one_time_donation); + data.SetDoubleKey("monthly", report->recurring_donation); Respond(OneArgument(std::move(data))); } @@ -555,8 +549,8 @@ ExtensionFunction::ResponseAction BraveRewardsClaimPromotionFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - auto data = std::make_unique(base::Value::Type::DICTIONARY); - data->SetIntKey("result", 1); + base::Value data(base::Value::Type::DICTIONARY); + data.SetIntKey("result", 1); return RespondNow(OneArgument(std::move(data))); } @@ -575,12 +569,12 @@ void BraveRewardsClaimPromotionFunction::OnClaimPromotion( const std::string& captcha_image, const std::string& hint, const std::string& captcha_id) { - auto data = std::make_unique(base::Value::Type::DICTIONARY); - data->SetIntKey("result", static_cast(result)); - data->SetStringKey("promotionId", promotion_id); - data->SetStringKey("captchaImage", captcha_image); - data->SetStringKey("captchaId", captcha_id); - data->SetStringKey("hint", hint); + base::Value data(base::Value::Type::DICTIONARY); + data.SetIntKey("result", static_cast(result)); + data.SetStringKey("promotionId", promotion_id); + data.SetStringKey("captchaImage", captcha_image); + data.SetStringKey("captchaId", captcha_id); + data.SetStringKey("hint", hint); Respond(OneArgument(std::move(data))); } @@ -594,7 +588,7 @@ ExtensionFunction::ResponseAction BraveRewardsAttestPromotionFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - return RespondNow(OneArgument(std::make_unique(1))); + return RespondNow(OneArgument(base::Value(1))); } rewards_service->AttestPromotion(params->promotion_id, params->solution, @@ -609,23 +603,19 @@ void BraveRewardsAttestPromotionFunction::OnAttestPromotion( const std::string& promotion_id, const ledger::type::Result result, ledger::type::PromotionPtr promotion) { - auto data = std::make_unique(base::Value::Type::DICTIONARY); - data->SetStringKey("promotionId", promotion_id); + base::Value data(base::Value::Type::DICTIONARY); + data.SetStringKey("promotionId", promotion_id); if (!promotion) { Respond( - TwoArguments( - std::make_unique(static_cast(result)), - std::move(data))); + TwoArguments(base::Value(static_cast(result)), std::move(data))); return; } - data->SetIntKey("expiresAt", promotion->expires_at); - data->SetDoubleKey("amount", promotion->approximate_value); - data->SetIntKey("type", static_cast(promotion->type)); - Respond(TwoArguments( - std::make_unique(static_cast(result)), - std::move(data))); + data.SetIntKey("expiresAt", promotion->expires_at); + data.SetDoubleKey("amount", promotion->approximate_value); + data.SetIntKey("type", static_cast(promotion->type)); + Respond(TwoArguments(base::Value(static_cast(result)), std::move(data))); } BraveRewardsGetPendingContributionsTotalFunction:: @@ -639,8 +629,7 @@ BraveRewardsGetPendingContributionsTotalFunction::Run() { RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - return RespondNow(OneArgument( - std::make_unique(0.0))); + return RespondNow(OneArgument(base::Value(0.0))); } rewards_service->GetPendingContributionsTotal(base::Bind( @@ -651,7 +640,7 @@ BraveRewardsGetPendingContributionsTotalFunction::Run() { void BraveRewardsGetPendingContributionsTotalFunction::OnGetPendingTotal( double amount) { - Respond(OneArgument(std::make_unique(amount))); + Respond(OneArgument(base::Value(amount))); } BraveRewardsSaveAdsSettingFunction::~BraveRewardsSaveAdsSettingFunction() { @@ -719,7 +708,7 @@ BraveRewardsGetACEnabledFunction::Run() { } void BraveRewardsGetACEnabledFunction::OnGetACEnabled(bool enabled) { - Respond(OneArgument(std::make_unique(enabled))); + Respond(OneArgument(base::Value(enabled))); } BraveRewardsSaveRecurringTipFunction:: @@ -799,7 +788,7 @@ BraveRewardsGetRecurringTipsFunction::Run() { void BraveRewardsGetRecurringTipsFunction::OnGetRecurringTips( ledger::type::PublisherInfoList list) { - std::unique_ptr result(new base::DictionaryValue()); + base::DictionaryValue result; auto recurringTips = std::make_unique(); if (!list.empty()) { @@ -811,7 +800,7 @@ void BraveRewardsGetRecurringTipsFunction::OnGetRecurringTips( } } - result->SetList("recurringTips", std::move(recurringTips)); + result.SetList("recurringTips", std::move(recurringTips)); Respond(OneArgument(std::move(result))); } @@ -842,29 +831,29 @@ BraveRewardsGetPublisherBannerFunction::Run() { void BraveRewardsGetPublisherBannerFunction::OnPublisherBanner( ledger::type::PublisherBannerPtr banner) { - std::unique_ptr result(new base::DictionaryValue()); + base::DictionaryValue result; if (banner) { - result->SetString("publisherKey", banner->publisher_key); - result->SetString("title", banner->title); - result->SetString("name", banner->name); - result->SetString("description", banner->description); - result->SetString("background", banner->background); - result->SetString("logo", banner->logo); - result->SetString("provider", banner->provider); - result->SetInteger("verified", static_cast(banner->status)); + result.SetString("publisherKey", banner->publisher_key); + result.SetString("title", banner->title); + result.SetString("name", banner->name); + result.SetString("description", banner->description); + result.SetString("background", banner->background); + result.SetString("logo", banner->logo); + result.SetString("provider", banner->provider); + result.SetInteger("verified", static_cast(banner->status)); auto amounts = std::make_unique(); for (auto const& value : banner->amounts) { amounts->AppendInteger(value); } - result->SetList("amounts", std::move(amounts)); + result.SetList("amounts", std::move(amounts)); auto links = std::make_unique(); for (auto const& item : banner->links) { links->SetString(item.first, item.second); } - result->SetDictionary("links", std::move(links)); + result.SetDictionary("links", std::move(links)); } Respond(OneArgument(std::move(result))); @@ -881,9 +870,8 @@ ExtensionFunction::ResponseAction BraveRewardsRefreshPublisherFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - return RespondNow(TwoArguments( - std::make_unique(false), - std::make_unique(std::string()))); + return RespondNow( + TwoArguments(base::Value(false), base::Value(std::string()))); } rewards_service->RefreshPublisher( params->publisher_key, @@ -896,9 +884,8 @@ ExtensionFunction::ResponseAction BraveRewardsRefreshPublisherFunction::Run() { void BraveRewardsRefreshPublisherFunction::OnRefreshPublisher( const ledger::type::PublisherStatus status, const std::string& publisher_key) { - Respond(TwoArguments( - std::make_unique(static_cast(status)), - std::make_unique(publisher_key))); + Respond(TwoArguments(base::Value(static_cast(status)), + base::Value(publisher_key))); } BraveRewardsGetAllNotificationsFunction:: @@ -911,7 +898,7 @@ BraveRewardsGetAllNotificationsFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); - auto list = std::make_unique(); + base::ListValue list; if (!rewards_service) { return RespondNow(OneArgument(std::move(list))); @@ -931,7 +918,7 @@ BraveRewardsGetAllNotificationsFunction::Run() { } item->SetList("args", std::move(args)); - list->Append(std::move(item)); + list.Append(std::move(item)); } return RespondNow(OneArgument(std::move(list))); @@ -951,7 +938,7 @@ BraveRewardsGetInlineTippingPlatformEnabledFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - return RespondNow(OneArgument(std::make_unique(false))); + return RespondNow(OneArgument(base::Value(false))); } rewards_service->GetInlineTippingPlatformEnabled( @@ -965,7 +952,7 @@ BraveRewardsGetInlineTippingPlatformEnabledFunction::Run() { void BraveRewardsGetInlineTippingPlatformEnabledFunction::OnInlineTipSetting( bool value) { - Respond(OneArgument(std::make_unique(value))); + Respond(OneArgument(base::Value(value))); } BraveRewardsFetchBalanceFunction:: @@ -978,7 +965,7 @@ BraveRewardsFetchBalanceFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - auto balance_value = std::make_unique(); + base::DictionaryValue balance_value; return RespondNow(OneArgument(std::move(balance_value))); } @@ -992,20 +979,19 @@ BraveRewardsFetchBalanceFunction::Run() { void BraveRewardsFetchBalanceFunction::OnBalance( const ledger::type::Result result, ledger::type::BalancePtr balance) { - auto balance_value = std::make_unique( - base::Value::Type::DICTIONARY); + base::Value balance_value(base::Value::Type::DICTIONARY); if (result == ledger::type::Result::LEDGER_OK && balance) { - balance_value->SetDoubleKey("total", balance->total); + balance_value.SetDoubleKey("total", balance->total); base::Value wallets(base::Value::Type::DICTIONARY); for (auto const& rate : balance->wallets) { wallets.SetDoubleKey(rate.first, rate.second); } - balance_value->SetKey("wallets", std::move(wallets)); + balance_value.SetKey("wallets", std::move(wallets)); } else { - balance_value->SetDoubleKey("total", 0.0); + balance_value.SetDoubleKey("total", 0.0); base::Value wallets(base::Value::Type::DICTIONARY); - balance_value->SetKey("wallets", std::move(wallets)); + balance_value.SetKey("wallets", std::move(wallets)); } Respond(OneArgument(std::move(balance_value))); @@ -1021,8 +1007,7 @@ BraveRewardsGetExternalWalletFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - auto data = std::make_unique( - base::Value::Type::DICTIONARY); + base::Value data(base::Value::Type::DICTIONARY); return RespondNow(OneArgument(std::move(data))); } @@ -1040,25 +1025,22 @@ void BraveRewardsGetExternalWalletFunction::OnGetUpholdWallet( const ledger::type::Result result, ledger::type::UpholdWalletPtr wallet) { if (!wallet) { - Respond(OneArgument( - std::make_unique(static_cast(result)))); + Respond(OneArgument(base::Value(static_cast(result)))); return; } - auto data = std::make_unique(base::Value::Type::DICTIONARY); - data->SetStringKey("token", wallet->token); - data->SetStringKey("address", wallet->address); - data->SetIntKey("status", static_cast(wallet->status)); - data->SetStringKey("verifyUrl", wallet->verify_url); - data->SetStringKey("addUrl", wallet->add_url); - data->SetStringKey("withdrawUrl", wallet->withdraw_url); - data->SetStringKey("userName", wallet->user_name); - data->SetStringKey("accountUrl", wallet->account_url); - data->SetStringKey("loginUrl", wallet->login_url); + base::Value data(base::Value::Type::DICTIONARY); + data.SetStringKey("token", wallet->token); + data.SetStringKey("address", wallet->address); + data.SetIntKey("status", static_cast(wallet->status)); + data.SetStringKey("verifyUrl", wallet->verify_url); + data.SetStringKey("addUrl", wallet->add_url); + data.SetStringKey("withdrawUrl", wallet->withdraw_url); + data.SetStringKey("userName", wallet->user_name); + data.SetStringKey("accountUrl", wallet->account_url); + data.SetStringKey("loginUrl", wallet->login_url); - Respond(TwoArguments( - std::make_unique(static_cast(result)), - std::move(data))); + Respond(TwoArguments(base::Value(static_cast(result)), std::move(data))); } BraveRewardsDisconnectWalletFunction:: @@ -1091,11 +1073,11 @@ BraveRewardsOnlyAnonWalletFunction::Run() { RewardsService* rewards_service = RewardsServiceFactory::GetForProfile(profile); if (!rewards_service) { - return RespondNow(OneArgument(std::make_unique(false))); + return RespondNow(OneArgument(base::Value(false))); } const auto only = rewards_service->OnlyAnonWallet(); - return RespondNow(OneArgument(std::make_unique(only))); + return RespondNow(OneArgument(base::Value(only))); } BraveRewardsGetAdsEnabledFunction:: @@ -1113,8 +1095,7 @@ BraveRewardsGetAdsEnabledFunction::Run() { } const bool enabled = ads_service_->IsEnabled(); - return RespondNow( - OneArgument(std::make_unique(enabled))); + return RespondNow(OneArgument(base::Value(enabled))); } BraveRewardsGetAdsEstimatedEarningsFunction:: @@ -1144,8 +1125,7 @@ void BraveRewardsGetAdsEstimatedEarningsFunction::OnAdsEstimatedEarnings( const uint64_t ads_received_this_month, const double earnings_this_month, const double earnings_last_month) { - Respond(OneArgument( - std::make_unique(estimated_pending_rewards))); + Respond(OneArgument(base::Value(estimated_pending_rewards))); } BraveRewardsGetAdsSupportedFunction:: @@ -1163,8 +1143,7 @@ BraveRewardsGetAdsSupportedFunction::Run() { } const bool supported = ads_service_->IsSupportedLocale(); - return RespondNow( - OneArgument(std::make_unique(supported))); + return RespondNow(OneArgument(base::Value(supported))); } BraveRewardsGetAnonWalletStatusFunction:: @@ -1188,7 +1167,7 @@ BraveRewardsGetAnonWalletStatusFunction::Run() { void BraveRewardsGetAnonWalletStatusFunction::OnGetAnonWalletStatus( const ledger::type::Result result) { - Respond(OneArgument(std::make_unique(static_cast(result)))); + Respond(OneArgument(base::Value(static_cast(result)))); } BraveRewardsIsInitializedFunction:: @@ -1205,8 +1184,7 @@ BraveRewardsIsInitializedFunction::Run() { } const bool initialized = rewards_service->IsInitialized(); - return RespondNow( - OneArgument(std::make_unique(initialized))); + return RespondNow(OneArgument(base::Value(initialized))); } BraveRewardsShouldShowOnboardingFunction:: @@ -1221,8 +1199,7 @@ BraveRewardsShouldShowOnboardingFunction::Run() { } const bool should_show = rewards_service->ShouldShowOnboarding(); - return RespondNow( - OneArgument(std::make_unique(should_show))); + return RespondNow(OneArgument(base::Value(should_show))); } BraveRewardsSaveOnboardingResultFunction:: diff --git a/browser/extensions/api/brave_shields_api.cc b/browser/extensions/api/brave_shields_api.cc index d60cba83b024..3a28dea9a93e 100644 --- a/browser/extensions/api/brave_shields_api.cc +++ b/browser/extensions/api/brave_shields_api.cc @@ -243,9 +243,8 @@ BraveShieldsGetBraveShieldsEnabledFunction::Run() { auto enabled = ::brave_shields::GetBraveShieldsEnabled( HostContentSettingsMapFactory::GetForProfile(profile), url); - auto result = std::make_unique(enabled); - return RespondNow(OneArgument(std::move(result))); + return RespondNow(OneArgument(base::Value(enabled))); } ExtensionFunction::ResponseAction @@ -266,7 +265,7 @@ BraveShieldsShouldDoCosmeticFilteringFunction::Run() { HostContentSettingsMapFactory::GetForProfile(profile), url); - return RespondNow(OneArgument(std::make_unique(enabled))); + return RespondNow(OneArgument(base::Value(enabled))); } ExtensionFunction::ResponseAction @@ -312,12 +311,10 @@ BraveShieldsIsFirstPartyCosmeticFilteringEnabledFunction::Run() { } Profile* profile = Profile::FromBrowserContext(browser_context()); - auto result = std::make_unique( - ::brave_shields::IsFirstPartyCosmeticFilteringEnabled( - HostContentSettingsMapFactory::GetForProfile(profile), - url)); + const bool enabled = ::brave_shields::IsFirstPartyCosmeticFilteringEnabled( + HostContentSettingsMapFactory::GetForProfile(profile), url); - return RespondNow(OneArgument(std::move(result))); + return RespondNow(OneArgument(base::Value(enabled))); } ExtensionFunction::ResponseAction BraveShieldsSetAdControlTypeFunction::Run() { @@ -361,9 +358,8 @@ ExtensionFunction::ResponseAction BraveShieldsGetAdControlTypeFunction::Run() { auto type = ::brave_shields::GetAdControlType( HostContentSettingsMapFactory::GetForProfile(profile), url); - auto result = std::make_unique(ControlTypeToString(type)); - return RespondNow(OneArgument(std::move(result))); + return RespondNow(OneArgument(base::Value(ControlTypeToString(type)))); } ExtensionFunction::ResponseAction @@ -409,9 +405,8 @@ BraveShieldsGetCookieControlTypeFunction::Run() { auto type = ::brave_shields::GetCookieControlType( HostContentSettingsMapFactory::GetForProfile(profile), url); - auto result = std::make_unique(ControlTypeToString(type)); - return RespondNow(OneArgument(std::move(result))); + return RespondNow(OneArgument(base::Value(ControlTypeToString(type)))); } ExtensionFunction::ResponseAction @@ -457,10 +452,8 @@ BraveShieldsGetFingerprintingControlTypeFunction::Run() { auto type = ::brave_shields::GetFingerprintingControlType( HostContentSettingsMapFactory::GetForProfile(profile), url); - auto result = - std::make_unique(ControlTypeToString(type)); - return RespondNow(OneArgument(std::move(result))); + return RespondNow(OneArgument(base::Value(ControlTypeToString(type)))); } ExtensionFunction::ResponseAction @@ -501,9 +494,8 @@ BraveShieldsGetHTTPSEverywhereEnabledFunction::Run() { auto type = ::brave_shields::GetHTTPSEverywhereEnabled( HostContentSettingsMapFactory::GetForProfile(profile), url); - auto result = std::make_unique(type); - return RespondNow(OneArgument(std::move(result))); + return RespondNow(OneArgument(base::Value(type))); } ExtensionFunction::ResponseAction @@ -549,9 +541,8 @@ BraveShieldsGetNoScriptControlTypeFunction::Run() { auto type = ::brave_shields::GetNoScriptControlType( HostContentSettingsMapFactory::GetForProfile(profile), url); - auto result = std::make_unique(ControlTypeToString(type)); - return RespondNow(OneArgument(std::move(result))); + return RespondNow(OneArgument(base::Value(ControlTypeToString(type)))); } ExtensionFunction::ResponseAction diff --git a/browser/extensions/api/brave_theme_api.cc b/browser/extensions/api/brave_theme_api.cc index c4054606dc04..6400acc8984a 100644 --- a/browser/extensions/api/brave_theme_api.cc +++ b/browser/extensions/api/brave_theme_api.cc @@ -19,14 +19,14 @@ namespace api { ExtensionFunction::ResponseAction BraveThemeGetBraveThemeListFunction::Run() { std::string json_string; base::JSONWriter::Write(dark_mode::GetBraveDarkModeTypeList(), &json_string); - return RespondNow(OneArgument(std::make_unique(json_string))); + return RespondNow(OneArgument(base::Value(json_string))); } ExtensionFunction::ResponseAction BraveThemeGetBraveThemeTypeFunction::Run() { const std::string theme_type = dark_mode::GetStringFromBraveDarkModeType( dark_mode::GetActiveBraveDarkModeType()); - return RespondNow(OneArgument(std::make_unique(theme_type))); + return RespondNow(OneArgument(base::Value(theme_type))); } ExtensionFunction::ResponseAction BraveThemeSetBraveThemeTypeFunction::Run() { diff --git a/browser/extensions/api/brave_together_api.cc b/browser/extensions/api/brave_together_api.cc index e997a43ab68b..3fe9c3b03d0c 100644 --- a/browser/extensions/api/brave_together_api.cc +++ b/browser/extensions/api/brave_together_api.cc @@ -26,8 +26,7 @@ BraveTogetherIsSupportedFunction::Run() { bool is_supported = ntp_widget_utils::IsRegionSupported( profile->GetPrefs(), brave_together::unsupported_regions, false); - return RespondNow(OneArgument( - std::make_unique(is_supported))); + return RespondNow(OneArgument(base::Value(is_supported))); } } // namespace api diff --git a/browser/extensions/api/brave_wallet_api.cc b/browser/extensions/api/brave_wallet_api.cc index b266ab3151d3..248fa6b327fd 100644 --- a/browser/extensions/api/brave_wallet_api.cc +++ b/browser/extensions/api/brave_wallet_api.cc @@ -134,15 +134,14 @@ BraveWalletShouldPromptForSetupFunction::Run() { auto* service = BraveWalletServiceFactory::GetForProfile(profile); bool should_prompt = !service->IsCryptoWalletsSetup() && !profile->GetPrefs()->GetBoolean(kOptedIntoCryptoWallets); - return RespondNow(OneArgument(std::make_unique(should_prompt))); + return RespondNow(OneArgument(base::Value(should_prompt))); } ExtensionFunction::ResponseAction BraveWalletShouldCheckForDappsFunction::Run() { Profile* profile = Profile::FromBrowserContext(browser_context()); if (browser_context()->IsTor()) { - return RespondNow(OneArgument( - std::make_unique(false))); + return RespondNow(OneArgument(base::Value(false))); } auto provider = static_cast( profile->GetPrefs()->GetInteger(kBraveWalletWeb3Provider)); @@ -156,8 +155,7 @@ BraveWalletShouldCheckForDappsFunction::Run() { (provider == BraveWalletWeb3ProviderTypes::CRYPTO_WALLETS && !service->IsCryptoWalletsReady()); - return RespondNow(OneArgument( - std::make_unique(dappDetection))); + return RespondNow(OneArgument(base::Value(dappDetection))); } ExtensionFunction::ResponseAction @@ -180,8 +178,7 @@ BraveWalletGetWalletSeedFunction::Run() { blob.assign(derived.begin(), derived.end()); - return RespondNow(OneArgument( - std::make_unique(blob))); + return RespondNow(OneArgument(base::Value(blob))); } ExtensionFunction::ResponseAction @@ -204,22 +201,19 @@ BraveWalletGetBitGoSeedFunction::Run() { blob.assign(derived.begin(), derived.end()); - return RespondNow(OneArgument( - std::make_unique(blob))); + return RespondNow(OneArgument(base::Value(blob))); } ExtensionFunction::ResponseAction BraveWalletGetProjectIDFunction::Run() { std::string project_id = extensions::GetInfuraProjectID(); - return RespondNow(OneArgument( - std::make_unique(project_id))); + return RespondNow(OneArgument(base::Value(project_id))); } ExtensionFunction::ResponseAction BraveWalletGetBraveKeyFunction::Run() { std::string brave_key = extensions::GetBraveKey(); - return RespondNow(OneArgument( - std::make_unique(brave_key))); + return RespondNow(OneArgument(base::Value(brave_key))); } ExtensionFunction::ResponseAction @@ -240,8 +234,7 @@ BraveWalletGetWeb3ProviderFunction::Run() { } else if (provider == BraveWalletWeb3ProviderTypes::METAMASK) { extension_id = metamask_extension_id; } - return RespondNow(OneArgument( - std::make_unique(extension_id))); + return RespondNow(OneArgument(base::Value(extension_id))); } ExtensionFunction::ResponseAction @@ -265,7 +258,7 @@ BraveWalletGetWeb3ProviderListFunction::Run() { } std::string json_string; base::JSONWriter::Write(list, &json_string); - return RespondNow(OneArgument(std::make_unique(json_string))); + return RespondNow(OneArgument(base::Value(json_string))); } } // namespace api diff --git a/browser/extensions/api/crypto_dot_com_api.cc b/browser/extensions/api/crypto_dot_com_api.cc index b826eed1422c..56b72f65b46a 100644 --- a/browser/extensions/api/crypto_dot_com_api.cc +++ b/browser/extensions/api/crypto_dot_com_api.cc @@ -66,11 +66,10 @@ CryptoDotComGetTickerInfoFunction::Run() { void CryptoDotComGetTickerInfoFunction::OnInfoResult( const CryptoDotComTickerInfo& info) { - auto result = std::make_unique( - base::Value::Type::DICTIONARY); + base::Value result(base::Value::Type::DICTIONARY); for (const auto& att : info) { - result->SetStringKey(att.first, att.second); + result.SetStringKey(att.first, att.second); } Respond(OneArgument(std::move(result))); @@ -102,7 +101,7 @@ CryptoDotComGetChartDataFunction::Run() { void CryptoDotComGetChartDataFunction::OnChartDataResult( const CryptoDotComChartData& data) { - auto result = std::make_unique(); + base::ListValue result; for (const auto& data_point : data) { auto point = std::make_unique( @@ -110,7 +109,7 @@ void CryptoDotComGetChartDataFunction::OnChartDataResult( for (const auto& att : data_point) { point->SetStringKey(att.first, att.second); } - result->Append(std::move(point)); + result.Append(std::move(point)); } Respond(OneArgument(std::move(result))); @@ -138,7 +137,7 @@ CryptoDotComGetSupportedPairsFunction::Run() { void CryptoDotComGetSupportedPairsFunction::OnSupportedPairsResult( const CryptoDotComSupportedPairs& pairs) { - auto result = std::make_unique(); + base::ListValue result; for (const auto& pair : pairs) { auto instrument = std::make_unique( @@ -146,7 +145,7 @@ void CryptoDotComGetSupportedPairsFunction::OnSupportedPairsResult( for (const auto& item : pair) { instrument->SetStringKey(item.first, item.second); } - result->Append(std::move(instrument)); + result.Append(std::move(instrument)); } Respond(OneArgument(std::move(result))); @@ -174,8 +173,7 @@ CryptoDotComGetAssetRankingsFunction::Run() { void CryptoDotComGetAssetRankingsFunction::OnAssetRankingsResult( const CryptoDotComAssetRankings& rankings) { - auto result = std::make_unique( - base::Value::Type::DICTIONARY); + base::Value result(base::Value::Type::DICTIONARY); for (const auto& ranking : rankings) { base::ListValue ranking_list; @@ -187,7 +185,7 @@ void CryptoDotComGetAssetRankingsFunction::OnAssetRankingsResult( } ranking_list.Append(std::move(asset_dict)); } - result->SetKey(ranking.first, std::move(ranking_list)); + result.SetKey(ranking.first, std::move(ranking_list)); } Respond(OneArgument(std::move(result))); @@ -204,8 +202,7 @@ CryptoDotComIsSupportedFunction::Run() { bool is_supported = ntp_widget_utils::IsRegionSupported( profile->GetPrefs(), ::crypto_dot_com::unsupported_regions, false); - return RespondNow(OneArgument( - std::make_unique(is_supported))); + return RespondNow(OneArgument(base::Value(is_supported))); } ExtensionFunction::ResponseAction @@ -245,9 +242,9 @@ CryptoDotComGetInteractionsFunction::Run() { bool has_interacted = profile->GetPrefs()->GetBoolean( kCryptoDotComHasInteracted); - auto interactions = std::make_unique(); - interactions->SetBoolean("boughtCrypto", has_bought); - interactions->SetBoolean("interacted", has_interacted); + base::DictionaryValue interactions; + interactions.SetBoolean("boughtCrypto", has_bought); + interactions.SetBoolean("interacted", has_interacted); return RespondNow(OneArgument(std::move(interactions))); } diff --git a/browser/extensions/api/gemini_api.cc b/browser/extensions/api/gemini_api.cc index 505ccffdf2ad..884e59acf082 100644 --- a/browser/extensions/api/gemini_api.cc +++ b/browser/extensions/api/gemini_api.cc @@ -39,8 +39,7 @@ GeminiGetClientUrlFunction::Run() { auto* service = GetGeminiService(browser_context()); const std::string client_url = service->GetOAuthClientUrl(); - return RespondNow(OneArgument( - std::make_unique(client_url))); + return RespondNow(OneArgument(base::Value(client_url))); } ExtensionFunction::ResponseAction @@ -58,7 +57,7 @@ GeminiGetAccessTokenFunction::Run() { } void GeminiGetAccessTokenFunction::OnCodeResult(bool success) { - Respond(OneArgument(std::make_unique(success))); + Respond(OneArgument(base::Value(success))); } ExtensionFunction::ResponseAction @@ -76,7 +75,7 @@ GeminiRefreshAccessTokenFunction::Run() { } void GeminiRefreshAccessTokenFunction::OnRefreshResult(bool success) { - Respond(OneArgument(std::make_unique(success))); + Respond(OneArgument(base::Value(success))); } ExtensionFunction::ResponseAction @@ -101,7 +100,7 @@ GeminiGetTickerPriceFunction::Run() { void GeminiGetTickerPriceFunction::OnPriceResult( const std::string& price) { - Respond(OneArgument(std::make_unique(price))); + Respond(OneArgument(base::Value(price))); } ExtensionFunction::ResponseAction @@ -122,15 +121,13 @@ GeminiGetAccountBalancesFunction::Run() { void GeminiGetAccountBalancesFunction::OnGetAccountBalances( const GeminiAccountBalances& balances, bool auth_invalid) { - auto result = std::make_unique( - base::Value::Type::DICTIONARY); + base::Value result(base::Value::Type::DICTIONARY); for (const auto& balance : balances) { - result->SetStringKey(balance.first, balance.second); + result.SetStringKey(balance.first, balance.second); } - Respond(TwoArguments(std::move(result), - std::make_unique(auth_invalid))); + Respond(TwoArguments(std::move(result), base::Value(auth_invalid))); } ExtensionFunction::ResponseAction @@ -154,8 +151,7 @@ GeminiGetDepositInfoFunction::Run() { void GeminiGetDepositInfoFunction::OnGetDepositInfo( const std::string& deposit_address) { - Respond(OneArgument( - std::make_unique(deposit_address))); + Respond(OneArgument(base::Value(deposit_address))); } ExtensionFunction::ResponseAction @@ -173,7 +169,7 @@ GeminiRevokeTokenFunction::Run() { } void GeminiRevokeTokenFunction::OnRevokeToken(bool success) { - Respond(OneArgument(std::make_unique(success))); + Respond(OneArgument(base::Value(success))); } ExtensionFunction::ResponseAction @@ -200,14 +196,13 @@ void GeminiGetOrderQuoteFunction::OnOrderQuoteResult( const std::string& quote_id, const std::string& quantity, const std::string& fee, const std::string& price, const std::string& total_price, const std::string& error) { - auto quote = std::make_unique(base::Value::Type::DICTIONARY); - quote->SetStringKey("id", quote_id); - quote->SetStringKey("quantity", quantity); - quote->SetStringKey("fee", fee); - quote->SetStringKey("price", price); - quote->SetStringKey("totalPrice", total_price); - Respond(TwoArguments( - std::move(quote), std::make_unique(error))); + base::Value quote(base::Value::Type::DICTIONARY); + quote.SetStringKey("id", quote_id); + quote.SetStringKey("quantity", quantity); + quote.SetStringKey("fee", fee); + quote.SetStringKey("price", price); + quote.SetStringKey("totalPrice", total_price); + Respond(TwoArguments(std::move(quote), base::Value(error))); } ExtensionFunction::ResponseAction @@ -232,7 +227,7 @@ GeminiExecuteOrderFunction::Run() { } void GeminiExecuteOrderFunction::OnOrderExecuted(bool success) { - Respond(OneArgument(std::make_unique(success))); + Respond(OneArgument(base::Value(success))); } ExtensionFunction::ResponseAction @@ -240,8 +235,7 @@ GeminiIsSupportedFunction::Run() { Profile* profile = Profile::FromBrowserContext(browser_context()); bool is_supported = ntp_widget_utils::IsRegionSupported( profile->GetPrefs(), ::gemini::supported_regions, true); - return RespondNow(OneArgument( - std::make_unique(is_supported))); + return RespondNow(OneArgument(base::Value(is_supported))); } } // namespace api diff --git a/browser/extensions/api/greaselion_api.cc b/browser/extensions/api/greaselion_api.cc index e884d02684f3..497d9a5387b3 100644 --- a/browser/extensions/api/greaselion_api.cc +++ b/browser/extensions/api/greaselion_api.cc @@ -22,7 +22,7 @@ GreaselionIsGreaselionExtensionFunction::Run() { ::greaselion::GreaselionService* greaselion_service = ::greaselion::GreaselionServiceFactory::GetForBrowserContext(profile); if (!greaselion_service) { - return RespondNow(OneArgument(std::make_unique(false))); + return RespondNow(OneArgument(base::Value(false))); } std::unique_ptr params( @@ -30,7 +30,7 @@ GreaselionIsGreaselionExtensionFunction::Run() { EXTENSION_FUNCTION_VALIDATE(params.get()); bool result = greaselion_service->IsGreaselionExtension(params->id); - return RespondNow(OneArgument(std::make_unique(result))); + return RespondNow(OneArgument(base::Value(result))); } } // namespace api diff --git a/browser/extensions/api/ipfs_api.cc b/browser/extensions/api/ipfs_api.cc index 84263c5d9fc9..20f80c63ba31 100644 --- a/browser/extensions/api/ipfs_api.cc +++ b/browser/extensions/api/ipfs_api.cc @@ -60,12 +60,12 @@ ExtensionFunction::ResponseAction IpfsGetResolveMethodListFunction::Run() { ipfs::IPFSResolveMethodTypes::IPFS_DISABLED)); std::string json_string; base::JSONWriter::Write(list, &json_string); - return RespondNow(OneArgument(std::make_unique(json_string))); + return RespondNow(OneArgument(base::Value(json_string))); } ExtensionFunction::ResponseAction IpfsGetIPFSEnabledFunction::Run() { bool enabled = IsIpfsEnabled(browser_context()); - return RespondNow(OneArgument(std::make_unique(enabled))); + return RespondNow(OneArgument(base::Value(enabled))); } ExtensionFunction::ResponseAction IpfsGetResolveMethodTypeFunction::Run() { @@ -86,7 +86,7 @@ ExtensionFunction::ResponseAction IpfsGetResolveMethodTypeFunction::Run() { break; } } - return RespondNow(OneArgument(std::make_unique(value))); + return RespondNow(OneArgument(base::Value(value))); } ExtensionFunction::ResponseAction IpfsLaunchFunction::Run() { @@ -109,7 +109,7 @@ ExtensionFunction::ResponseAction IpfsLaunchFunction::Run() { } void IpfsLaunchFunction::OnLaunch(bool launched) { - Respond(OneArgument(std::make_unique(launched))); + Respond(OneArgument(base::Value(launched))); } ExtensionFunction::ResponseAction IpfsShutdownFunction::Run() { @@ -122,7 +122,7 @@ ExtensionFunction::ResponseAction IpfsShutdownFunction::Run() { } void IpfsShutdownFunction::OnShutdown(bool shutdown) { - Respond(OneArgument(std::make_unique(shutdown))); + Respond(OneArgument(base::Value(shutdown))); } ExtensionFunction::ResponseAction IpfsGetConfigFunction::Run() { @@ -136,8 +136,7 @@ ExtensionFunction::ResponseAction IpfsGetConfigFunction::Run() { void IpfsGetConfigFunction::OnGetConfig(bool success, const std::string& value) { - Respond(TwoArguments(std::make_unique(success), - std::make_unique(value))); + Respond(TwoArguments(base::Value(success), base::Value(value))); } ExtensionFunction::ResponseAction IpfsGetExecutableAvailableFunction::Run() { @@ -145,7 +144,7 @@ ExtensionFunction::ResponseAction IpfsGetExecutableAvailableFunction::Run() { return RespondNow(Error("IPFS not enabled")); } bool avail = GetIpfsService(browser_context())->IsIPFSExecutableAvailable(); - return RespondNow(OneArgument(std::make_unique(avail))); + return RespondNow(OneArgument(base::Value(avail))); } } // namespace api diff --git a/browser/farbling/brave_navigator_useragent_farbling_browsertest.cc b/browser/farbling/brave_navigator_useragent_farbling_browsertest.cc index 0cfaeac177de..430c5038405b 100644 --- a/browser/farbling/brave_navigator_useragent_farbling_browsertest.cc +++ b/browser/farbling/brave_navigator_useragent_farbling_browsertest.cc @@ -5,6 +5,7 @@ #include "base/path_service.h" #include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "base/test/thread_test_helper.h" #include "brave/browser/brave_browser_process_impl.h" diff --git a/browser/net/url_context.cc b/browser/net/url_context.cc index 081f757a273f..f8193a3afb7a 100644 --- a/browser/net/url_context.cc +++ b/browser/net/url_context.cc @@ -99,7 +99,7 @@ std::shared_ptr BraveRequestInfo::MakeCTX( ctx->network_isolation_key = request.trusted_params->isolation_info.network_isolation_key(); ctx->tab_origin = ctx->network_isolation_key - .GetTopFrameOrigin() + .GetTopFrameSite() .value_or(url::Origin()) .GetURL(); } diff --git a/browser/profiles/brave_bookmark_model_loaded_observer_browsertest.cc b/browser/profiles/brave_bookmark_model_loaded_observer_browsertest.cc index b0d014374bbd..601ffce5c83c 100644 --- a/browser/profiles/brave_bookmark_model_loaded_observer_browsertest.cc +++ b/browser/profiles/brave_bookmark_model_loaded_observer_browsertest.cc @@ -3,6 +3,7 @@ * 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/. */ +#include "base/strings/utf_string_conversions.h" #include "brave/common/pref_names.h" #include "brave/components/brave_sync/brave_sync_prefs.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" diff --git a/browser/resources/extensions/BUILD.gn b/browser/resources/extensions/BUILD.gn index 5b9dbbdefeff..006c092c042f 100644 --- a/browser/resources/extensions/BUILD.gn +++ b/browser/resources/extensions/BUILD.gn @@ -1,19 +1,29 @@ import("//chrome/browser/resources/optimize_webui.gni") import("//chrome/common/features.gni") import("//tools/grit/grit_rule.gni") +import("//tools/grit/preprocess_grit.gni") import("//tools/polymer/polymer.gni") +import("//ui/webui/resources/tools/generate_grd.gni") -grit("resources") { - source = "extensions_resources.grd" +preprocess_folder = "preprocessed" +preprocess_gen_manifest = "brave_preprocessed_gen_manifest.json" - # The .grd contains references to generated files. - enable_input_discovery_for_gn_analyze = true +grit("resources") { grit_flags = [ "-E", "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir), + "-E", + "root_src_dir=" + rebase_path("//", root_build_dir), ] - deps = [ ":polymer3_elements" ] + defines = chrome_grit_defines + + enable_input_discovery_for_gn_analyze = false + defines += [ "SHARED_INTERMEDIATE_DIR=" + + rebase_path(root_gen_dir, root_build_dir) ] + extensions_gen_dir = "$root_gen_dir/brave/browser/resources/extensions" + source = "$extensions_gen_dir/brave_extensions_resources.grd" + deps = [ ":build_grd" ] outputs = [ "grit/brave_extensions_resources.h", @@ -26,40 +36,22 @@ grit("resources") { resource_ids = "//brave/browser/resources/resource_ids" } -group("unpak") { - deps = [ - ":unpak_brave_extensions_resources", - ] -} - -action("unpak_brave_extensions_resources") { - script = "//chrome/browser/resources/unpack_pak.py" +generate_grd("build_grd") { + grd_prefix = "brave_extensions" + out_grd = "$target_gen_dir/${grd_prefix}_resources.grd" + input_files = [] + input_files_base_dir = rebase_path(".", "//") - pak_file = "brave_extensions_resources.pak" - out_folder = "$root_gen_dir/chrome/browser/resources/extensions/preprocessed" - - inputs = [ - "$target_gen_dir/brave_extensions_resources.pak", - ] - - outputs = [ - "${out_folder}/brave_unpack.stamp", - ] - - deps = [ - ":resources", - ] - - args = [ - "--out_folder", - rebase_path(out_folder, root_build_dir), - "--pak_file", - rebase_path("$target_gen_dir/${pak_file}", root_build_dir), - ] + deps = [ ":preprocess_generated" ] + manifest_files = [ "$root_gen_dir/chrome/browser/resources/extensions/$preprocess_gen_manifest" ] } -group("polymer3_elements") { +preprocess_grit("preprocess_generated") { deps = [ ":brave_item_list_more_items_module" ] + in_folder = target_gen_dir + out_folder = "$root_gen_dir/chrome/browser/resources/extensions/$preprocess_folder" + out_manifest = "$root_gen_dir/chrome/browser/resources/extensions/$preprocess_gen_manifest" + in_files = [ "brave_item_list_more_items.js" ] } polymer_modulizer("brave_item_list_more_items") { @@ -67,4 +59,3 @@ polymer_modulizer("brave_item_list_more_items") { html_file = "brave_item_list_more_items.html" html_type = "v3-ready" } - diff --git a/browser/resources/extensions/brave_unpack.stamp b/browser/resources/extensions/brave_unpack.stamp deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/browser/resources/extensions/extensions_resources.grd b/browser/resources/extensions/extensions_resources.grd deleted file mode 100644 index 3d213c695e17..000000000000 --- a/browser/resources/extensions/extensions_resources.grd +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/browser/resources/resource_ids b/browser/resources/resource_ids index f23007ca98a6..580fd3ac51ec 100644 --- a/browser/resources/resource_ids +++ b/browser/resources/resource_ids @@ -19,9 +19,9 @@ "<(ROOT_GEN_DIR)/brave/web-ui-brave_welcome/brave_welcome.grd": { "includes": [33240], }, - "brave/browser/resources/settings/settings_resources.grd": { - "structures": [34500], - "includes": [34900], + "<(SHARED_INTERMEDIATE_DIR)/brave/browser/resources/settings/brave_settings_resources.grd": { + "META": {"sizes": {"includes": [100],}}, + "includes": [34500], }, "brave/app/brave_generated_resources.grd": { "includes": [35000], @@ -77,9 +77,9 @@ "includes": [41000], "structures": [42000], }, - "brave/browser/resources/extensions/extensions_resources.grd": { - "structures": [43000], - "includes": [43500], + "<(SHARED_INTERMEDIATE_DIR)/brave/browser/resources/extensions/brave_extensions_resources.grd": { + "META": {"sizes": {"includes": [50],}}, + "includes": [43000], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_wallet/brave_wallet.grd": { diff --git a/browser/resources/settings/BUILD.gn b/browser/resources/settings/BUILD.gn index c1a08f59d85e..30ed98eef969 100644 --- a/browser/resources/settings/BUILD.gn +++ b/browser/resources/settings/BUILD.gn @@ -10,26 +10,37 @@ import("//third_party/closure_compiler/compile_js.gni") import("//chrome/browser/resources/optimize_webui.gni") import("//chrome/common/features.gni") import("//tools/grit/grit_rule.gni") +import("//tools/grit/preprocess_grit.gni") import("//ui/webui/resources/tools/js_modulizer.gni") import("//tools/polymer/html_to_js.gni") import("//tools/polymer/polymer.gni") +import("//ui/webui/resources/tools/generate_grd.gni") -grit("resources") { - source = "settings_resources.grd" +preprocess_folder = "preprocessed" +preprocess_manifest = "brave_preprocessed_manifest.json" +preprocess_gen_manifest = "brave_preprocessed_gen_manifest.json" +grit("resources") { grit_flags = [ "-E", "root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir), + "-E", + "root_src_dir=" + rebase_path("//", root_build_dir), ] - deps = [ ":web_modules" ] - defines = [ + defines = chrome_grit_defines + defines += [ "is_release_channel=$is_release_channel", "enable_tor=$enable_tor", "enable_brave_wayback_machine=$enable_brave_wayback_machine", ] - enable_input_discovery_for_gn_analyze = optimize_webui + enable_input_discovery_for_gn_analyze = false + defines += [ "SHARED_INTERMEDIATE_DIR=" + + rebase_path(root_gen_dir, root_build_dir) ] + settings_gen_dir = "$root_gen_dir/brave/browser/resources/settings" + source = "$settings_gen_dir/brave_settings_resources.grd" + deps = [ ":build_grd" ] outputs = [ "grit/brave_settings_resources.h", @@ -42,38 +53,99 @@ grit("resources") { resource_ids = "//brave/browser/resources/resource_ids" } -if (optimize_webui) { - group("unpak") { - deps = [ - ":unpak_brave_settings_resources", - ] - } - - action("unpak_brave_settings_resources") { - script = "//chrome/browser/resources/unpack_pak.py" - - pak_file = "brave_settings_resources.pak" - out_folder = "$root_gen_dir/chrome/browser/resources/settings/preprocessed" - - inputs = [ - "$target_gen_dir/brave_settings_resources.pak", - ] +generate_grd("build_grd") { + grd_prefix = "brave_settings" + out_grd = "$target_gen_dir/${grd_prefix}_resources.grd" + input_files = [ + "brave_sync_page/device_computer.svg", + "brave_sync_page/device_mobile.svg", + "brave_sync_page/qr_scanning.svg", + "brave_sync_page/start_icon.svg", + "images/cookies_banner.svg", + "images/cookies_banner_dark.svg", + "images/permissions_banner.svg", + "images/permissions_banner_dark.svg", + "images/safe_browsing_banner.svg", + "images/safe_browsing_banner_dark.svg", + ] + input_files_base_dir = rebase_path(".", "//") - outputs = [ - "${out_folder}/brave_unpack.stamp", - ] + deps = [ + ":preprocess", + ":preprocess_generated", + ] + manifest_files = [ + "$root_gen_dir/chrome/browser/resources/settings/$preprocess_manifest", + "$root_gen_dir/chrome/browser/resources/settings/$preprocess_gen_manifest", + ] +} - deps = [ - ":resources", - ] +preprocess_grit("preprocess") { + in_folder = "./" + out_folder = "$root_gen_dir/chrome/browser/resources/settings/$preprocess_folder" + out_manifest = "$root_gen_dir/chrome/browser/resources/settings/$preprocess_manifest" + in_files = [ + "brave_appearance_page/brave_appearance_browser_proxy.js", + "brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.js", + "brave_overrides/about_page.js", + "brave_overrides/appearance_page.js", + "brave_overrides/basic_page.js", + "brave_overrides/clear_browsing_data_dialog.js", + "brave_overrides/cookies_page.js", + "brave_overrides/default_browser_page.js", + "brave_overrides/icons.js", + "brave_overrides/import_data_dialog.js", + "brave_overrides/index.js", + "brave_overrides/page_visibility.js", + "brave_overrides/passwords_section.js", + "brave_overrides/payments_section.js", + "brave_overrides/people_page.js", + "brave_overrides/printing_page.js", + "brave_overrides/reset_profile_dialog.js", + "brave_overrides/safety_check_passwords_child.js", + "brave_overrides/security_page.js", + "brave_overrides/settings_menu.js", + "brave_overrides/settings_section.js", + "brave_overrides/settings_ui.js", + "brave_overrides/site_settings_page.js", + "brave_overrides/sync_account_control.js", + "brave_overrides/sync_controls.js", + "brave_sync_page/brave_sync_browser_proxy.js", + ] +} - args = [ - "--out_folder", - rebase_path(out_folder, root_build_dir), - "--pak_file", - rebase_path("$target_gen_dir/${pak_file}", root_build_dir), - ] - } +preprocess_grit("preprocess_generated") { + deps = [ ":web_modules" ] + defines = [ + "enable_tor=$enable_tor", + "enable_brave_wayback_machine=$enable_brave_wayback_machine", + ] + in_folder = target_gen_dir + out_folder = "$root_gen_dir/chrome/browser/resources/settings/$preprocess_folder" + out_manifest = "$root_gen_dir/chrome/browser/resources/settings/$preprocess_gen_manifest" + in_files = [ + "brave_appearance_page/brave_theme.js", + "brave_appearance_page/super_referral.js", + "brave_appearance_page/toolbar.js", + "brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.js", + "brave_default_extensions_page/brave_default_extensions_browser_proxy.m.js", + "brave_default_extensions_page/brave_default_extensions_page.m.js", + "brave_help_tips_page/brave_help_tips_page.m.js", + "brave_icons.m.js", + "brave_new_tab_page/brave_new_tab_browser_proxy.m.js", + "brave_new_tab_page/brave_new_tab_page.m.js", + "brave_privacy_page/brave_personalization_options.m.js", + "brave_privacy_page/brave_privacy_page_browser_proxy.m.js", + "brave_sync_page/brave_sync_code_dialog.js", + "brave_sync_page/brave_sync_configure.js", + "brave_sync_page/brave_sync_page.js", + "brave_sync_page/brave_sync_setup.js", + "brave_sync_page/brave_sync_subpage.js", + "default_brave_shields_page/default_brave_shields_browser_proxy.m.js", + "default_brave_shields_page/default_brave_shields_page.m.js", + "getting_started_page/getting_started.js", + "social_blocking_page/social_blocking_page.m.js", + ] } group("web_modules") { diff --git a/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html b/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html index 8a5ec95b8dfb..d6c23b43bffc 100644 --- a/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html +++ b/browser/resources/settings/brave_help_tips_page/brave_help_tips_page.html @@ -8,9 +8,10 @@ diff --git a/browser/resources/settings/brave_unpack.stamp b/browser/resources/settings/brave_unpack.stamp deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/browser/resources/settings/settings_resources.grd b/browser/resources/settings/settings_resources.grd deleted file mode 100644 index 41273689da58..000000000000 --- a/browser/resources/settings/settings_resources.grd +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/browser/resources/settings/settings_resources_generated.grdp b/browser/resources/settings/settings_resources_generated.grdp deleted file mode 100644 index 68178694892c..000000000000 --- a/browser/resources/settings/settings_resources_generated.grdp +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/browser/tor/tor_profile_manager_browsertest.cc b/browser/tor/tor_profile_manager_browsertest.cc index 7692a4082a1a..65558f0bd5dd 100644 --- a/browser/tor/tor_profile_manager_browsertest.cc +++ b/browser/tor/tor_profile_manager_browsertest.cc @@ -4,6 +4,7 @@ // you can obtain one at http://mozilla.org/MPL/2.0/. #include "base/path_service.h" +#include "base/strings/utf_string_conversions.h" #include "brave/browser/brave_browser_process_impl.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" #include "brave/browser/tor/tor_profile_manager.h" diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn index ae4ac26cc0c4..7a5209c16983 100644 --- a/browser/ui/BUILD.gn +++ b/browser/ui/BUILD.gn @@ -69,8 +69,6 @@ source_set("ui") { "content_settings/brave_autoplay_blocked_image_model.h", "content_settings/brave_autoplay_content_setting_bubble_model.cc", "content_settings/brave_autoplay_content_setting_bubble_model.h", - "content_settings/brave_content_setting_bubble_model.cc", - "content_settings/brave_content_setting_bubble_model.h", "content_settings/brave_content_setting_image_models.cc", "content_settings/brave_content_setting_image_models.h", "omnibox/brave_omnibox_client_impl.cc", @@ -178,7 +176,7 @@ source_set("ui") { } } - if (is_win || is_mac || is_desktop_linux) { + if (is_win || is_mac || is_linux) { sources += [ "views/profiles/brave_incognito_menu_view.cc", "views/profiles/brave_incognito_menu_view.h", diff --git a/browser/ui/android/strings/android_chrome_strings.grd b/browser/ui/android/strings/android_chrome_strings.grd index 2f2d0cd43da8..34d1cd95b375 100644 --- a/browser/ui/android/strings/android_chrome_strings.grd +++ b/browser/ui/android/strings/android_chrome_strings.grd @@ -375,6 +375,35 @@ CHAR-LIMIT guidelines: Cancel sync + + + Usage data + + + Manage usage data sharing + + + Choose what you’re comfortable to share with Brave. The metrics you share will be used to help improve Brave’s features, performance, and stability. + + + Extended usage data + + + Basic data plus information about the websites you visit and apps you use + + + Basic usage data + + + How you interact with Brave, settings you’ve selected, details of Brave crashes + + + No usage data + + + No statistics or crash reports are sent to Brave + + Search engine @@ -566,9 +595,6 @@ CHAR-LIMIT guidelines: Delete stored password - - Edit stored password - Username copied @@ -584,6 +610,9 @@ CHAR-LIMIT guidelines: Turn on screen lock in Settings to export your passwords from this device + + To view passwords, first set a screen lock on your device + Showing password generation popup @@ -1846,9 +1875,18 @@ To change this setting, <resetlink>reset sync

Reopen closed tab + + Restored %1$sYouTube, tab + + + Restored %1$s3 tabs + %1$sWelcome to Facebook, tab + + %1$sWelcome to Facebook, tab, selected + Close %1$sBrave tab @@ -2160,6 +2198,24 @@ To change this setting, <resetlink>reset sync

Added to Home screen + + Install this app + + + To get here quicker, add this page to your Home screen + + + To get here quicker, add this page to your Home screen from the More options button + + + Get to this site quicker + + + Add this site to your phone’s Home screen so you can get here more easily + + + Add this site to your tablet’s Home screen so you can get here more easily + @@ -2638,12 +2694,16 @@ Data from your Private session will only be cleared from Brave when you <link>Learn more</link> about suggested content - - Can’t get suggestions - - - No new suggestions - + + + Can’t get suggestions + + + + + No new suggestions + + Manage activity @@ -2772,6 +2832,9 @@ Data from your Private session will only be cleared from Brave when you Type here or tap the voice icon to start + + Loading… + @@ -2887,6 +2950,18 @@ Data from your Private session will only be cleared from Brave when you Stop image descriptions + + Add to… + + + Add to: + + + Add to Bookmarks + + + Add to Downloads + @@ -3199,8 +3274,8 @@ Data from your Private session will only be cleared from Brave when you %1$sCrater Lake National Park (U.S. National Park Service) - %1$sCrater Lake National Park (U.S. National Park Service): %1$shttps://www.nps.gov/crla - + %1$sCrater Lake National Park (U.S. National Park Service): %2$shttps://www.nps.gov/crla + {NUM_SELECTED, plural, @@ -3310,6 +3385,12 @@ Data from your Private session will only be cleared from Brave when you %1$s3 downloads deleted + + Restored %1$sYouTube + + + %1$s3 downloads restored + @@ -3344,6 +3425,9 @@ Data from your Private session will only be cleared from Brave when you Preview tab + + Preview tab content is not viewable. + Preview tab is half-opened @@ -3449,9 +3533,6 @@ Data from your Private session will only be cleared from Brave when you - - This app is running in Brave - Running in Brave @@ -3588,23 +3669,10 @@ Data from your Private session will only be cleared from Brave when you - - - To view augmented reality content, install ARCore - - - To view augmented reality content, update ARCore - - Augmented Reality - - - - Update - @@ -3935,6 +4003,10 @@ Data from your Private session will only be cleared from Brave when you + + Brave as a Security Key + + QR Code @@ -4177,6 +4249,21 @@ Data from your Private session will only be cleared from Brave when you Get descriptions + + Image descriptions + + + Get image descriptions + + + Some images are sent to Brave to improve descriptions for you + + + Use mobile data + + + Wi-Fi is used when available + diff --git a/browser/ui/android/strings/android_chrome_strings_override.grd b/browser/ui/android/strings/android_chrome_strings_override.grd index 46c12379c8e6..5a40df877922 100644 --- a/browser/ui/android/strings/android_chrome_strings_override.grd +++ b/browser/ui/android/strings/android_chrome_strings_override.grd @@ -155,6 +155,10 @@ In Private, your activity <b1>might still be v Data from your Private session will only be cleared from Brave when you <b2>close all Private tabs</b2>. + + + + New private tab diff --git a/browser/ui/content_settings/brave_content_setting_bubble_model.cc b/browser/ui/content_settings/brave_content_setting_bubble_model.cc deleted file mode 100644 index 1783f7284d5f..000000000000 --- a/browser/ui/content_settings/brave_content_setting_bubble_model.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright (c) 2019 The Brave Authors. All rights reserved. - * 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/. */ - -#include "brave/browser/ui/content_settings/brave_content_setting_bubble_model.h" - -#include -#include - -#include "brave/components/brave_shields/common/brave_shield_constants.h" -#include "chrome/browser/content_settings/host_content_settings_map_factory.h" -#include "chrome/browser/plugins/plugin_utils.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" -#include "chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h" -#include "chrome/grit/generated_resources.h" -#include "components/content_settings/browser/page_specific_content_settings.h" -#include "components/content_settings/core/browser/host_content_settings_map.h" -#include "ui/base/l10n/l10n_util.h" - -BraveContentSettingPluginBubbleModel::BraveContentSettingPluginBubbleModel( - Delegate* delegate, content::WebContents* web_contents) - : ContentSettingSimpleBubbleModel(delegate, web_contents, - ContentSettingsType::PLUGINS) { - content_settings::SettingInfo info; - HostContentSettingsMap* map = - HostContentSettingsMapFactory::GetForProfile(GetProfile()); - GURL url = web_contents->GetURL(); - std::unique_ptr value = - map->GetWebsiteSetting(url, url, ContentSettingsType::PLUGINS, - std::string(), &info); - - set_show_learn_more(true); - - // Do not show "Run flash this time" and "Manage" button in Tor profile. - if (GetProfile()->IsTor()) { - set_manage_text_style(ContentSettingBubbleModel::ManageTextStyle::kNone); - return; - } - - // If the setting is not managed by the user, hide the "Manage" button. - if (info.source != content_settings::SETTING_SOURCE_USER) - set_manage_text_style(ContentSettingBubbleModel::ManageTextStyle::kNone); - - set_custom_link(l10n_util::GetStringUTF16(IDS_BLOCKED_PLUGINS_LOAD_ALL)); - set_custom_link_enabled( - web_contents && - content_settings::PageSpecificContentSettings::GetForFrame( - web_contents->GetMainFrame()) - ->load_plugins_link_enabled()); -} - -void BraveContentSettingPluginBubbleModel::OnLearnMoreClicked() { - if (delegate()) - delegate()->ShowLearnMorePage(ContentSettingsType::PLUGINS); -} - -void BraveContentSettingPluginBubbleModel::OnCustomLinkClicked() { - RunPluginsOnPage(); -} - -void BraveContentSettingPluginBubbleModel::RunPluginsOnPage() { - // Web contents can be NULL if the tab was closed while the plugins - // settings bubble is visible. - if (!web_contents()) - return; - - HostContentSettingsMap* map = - HostContentSettingsMapFactory::GetForProfile(GetProfile()); - map->SetContentSettingDefaultScope( - web_contents()->GetURL(), - GURL(), - ContentSettingsType::PLUGINS, - std::string(), - CONTENT_SETTING_DETECT_IMPORTANT_CONTENT); - - ChromeSubresourceFilterClient::FromWebContents(web_contents()) - ->OnReloadRequested(); -} diff --git a/browser/ui/content_settings/brave_content_setting_bubble_model.h b/browser/ui/content_settings/brave_content_setting_bubble_model.h deleted file mode 100644 index 8e6a460c80e5..000000000000 --- a/browser/ui/content_settings/brave_content_setting_bubble_model.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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/. */ - -#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" - -class BraveContentSettingPluginBubbleModel : public ContentSettingSimpleBubbleModel { - public: - BraveContentSettingPluginBubbleModel(Delegate* delegate, - content::WebContents* web_contents); - private: - void OnLearnMoreClicked() override; - void OnCustomLinkClicked() override; - - void RunPluginsOnPage(); - - DISALLOW_COPY_AND_ASSIGN(BraveContentSettingPluginBubbleModel); -}; diff --git a/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc b/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc index 6e8a93b8335c..a2f40bf8cc77 100644 --- a/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc +++ b/browser/ui/views/bookmarks/bookmark_bar_instructions_view.cc @@ -55,7 +55,7 @@ BookmarkBarInstructionsView::BookmarkBarInstructionsView(Browser* browser) new views::Link(l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_IMPORT_LINK), kBookmarkBarTextContext); // We don't want the link to alter tab navigation. - import_link_->set_callback( + import_link_->SetCallback( base::BindRepeating(&BookmarkBarInstructionsView::LinkClicked, base::Unretained(this))); import_link_->SetFocusBehavior(FocusBehavior::NEVER); diff --git a/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.cc b/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.cc index 129e0f65e0af..4048e0ea67fb 100644 --- a/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.cc +++ b/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.cc @@ -6,6 +6,7 @@ #include "brave/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.h" #include +#include #include "brave/browser/ui/views/infobars/brave_wayback_machine_infobar_throbber.h" #include "brave/grit/brave_generated_resources.h" @@ -20,9 +21,10 @@ constexpr int kInsetOffsetsForThrobber = kThrobberDiameter; } // namespace BraveWaybackMachineInfoBarButtonContainer:: -BraveWaybackMachineInfoBarButtonContainer(views::ButtonListener* listener) { + BraveWaybackMachineInfoBarButtonContainer( + views::Button::PressedCallback callback) { auto button = std::make_unique( - listener, + std::move(callback), l10n_util::GetStringUTF16(IDS_BRAVE_WAYBACK_MACHINE_CHECK_BUTTON_TEXT)); button_ = button.get(); button->SetProminent(true); diff --git a/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.h b/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.h index 8d7b00599430..81f7218714f5 100644 --- a/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.h +++ b/browser/ui/views/infobars/brave_wayback_machine_infobar_button_container.h @@ -7,10 +7,7 @@ #define BRAVE_BROWSER_UI_VIEWS_INFOBARS_BRAVE_WAYBACK_MACHINE_INFOBAR_BUTTON_CONTAINER_H_ #include "ui/views/view.h" - -namespace views { -class ButtonListener; -} // namespace views +#include "ui/views/controls/button/button.h" class BraveWaybackMachineInfoBarThrobber; @@ -21,7 +18,7 @@ class BraveWaybackMachineInfoBarThrobber; class BraveWaybackMachineInfoBarButtonContainer : public views::View { public: explicit BraveWaybackMachineInfoBarButtonContainer( - views::ButtonListener* listener); + views::Button::PressedCallback callback); ~BraveWaybackMachineInfoBarButtonContainer() override; BraveWaybackMachineInfoBarButtonContainer( diff --git a/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.cc b/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.cc index d299a67eadbc..65d2d087b484 100644 --- a/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.cc +++ b/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.cc @@ -77,16 +77,6 @@ void BraveWaybackMachineInfoBarContentsView::OnThemeChanged() { : IDR_BRAVE_WAYBACK_INFOBAR)); } -void BraveWaybackMachineInfoBarContentsView::ButtonPressed( - views::Button* sender, - const ui::Event& event) { - if (wayback_url_fetch_requested_) - return; - wayback_url_fetch_requested_ = true; - - FetchWaybackURL(); -} - void BraveWaybackMachineInfoBarContentsView::OnWaybackURLFetched( const GURL& latest_wayback_url) { DCHECK(wayback_url_fetch_requested_); @@ -120,6 +110,14 @@ void BraveWaybackMachineInfoBarContentsView::HideInfobar() { } } +void BraveWaybackMachineInfoBarContentsView::ButtonPressed() { + if (wayback_url_fetch_requested_) + return; + wayback_url_fetch_requested_ = true; + + FetchWaybackURL(); +} + void BraveWaybackMachineInfoBarContentsView::InitializeChildren() { wayback_spot_graphic_ = new views::ImageView(); wayback_spot_graphic_->SetProperty(views::kMarginsKey, @@ -178,7 +176,9 @@ void BraveWaybackMachineInfoBarContentsView::InitializeChildren() { 0)); AddChildView(label); - button_ = new BraveWaybackMachineInfoBarButtonContainer(this); + button_ = new BraveWaybackMachineInfoBarButtonContainer(base::BindRepeating( + &BraveWaybackMachineInfoBarContentsView::ButtonPressed, + base::Unretained(this))); views_visible_before_checking_.push_back(button_); button_->SetProperty( views::kMarginsKey, diff --git a/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.h b/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.h index 590d6a4105bc..3af0ff965505 100644 --- a/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.h +++ b/browser/ui/views/infobars/brave_wayback_machine_infobar_contents_view.h @@ -9,7 +9,7 @@ #include #include "brave/components/brave_wayback_machine/wayback_machine_url_fetcher.h" -#include "ui/views/controls/button/button.h" +#include "ui/views/view.h" namespace content { class WebContents; @@ -26,7 +26,6 @@ class GURL; // Includes all view controls except close button that managed by InfoBarView. class BraveWaybackMachineInfoBarContentsView : public views::View, - public views::ButtonListener, public WaybackMachineURLFetcher::Client { public: explicit BraveWaybackMachineInfoBarContentsView( @@ -44,7 +43,6 @@ class BraveWaybackMachineInfoBarContentsView // views::View overrides: void OnThemeChanged() override; - void ButtonPressed(views::Button* sender, const ui::Event& event) override; // WaybackMachineURLFetcher::Client overrides: void OnWaybackURLFetched(const GURL& latest_wayback_url) override; @@ -57,6 +55,8 @@ class BraveWaybackMachineInfoBarContentsView void LoadURL(const GURL& url); void HideInfobar(); + void ButtonPressed(); + // Used for labels theme changing all together. Labels labels_; Views views_visible_before_checking_; diff --git a/browser/ui/views/profiles/brave_avatar_toolbar_button.cc b/browser/ui/views/profiles/brave_avatar_toolbar_button.cc index 8ae7ff1c872b..e3d7f6f94f03 100644 --- a/browser/ui/views/profiles/brave_avatar_toolbar_button.cc +++ b/browser/ui/views/profiles/brave_avatar_toolbar_button.cc @@ -90,7 +90,7 @@ void BraveAvatarToolbarButton::UpdateColorsAndInsets() { // We give more margins to horizontally. gfx::Insets target_insets = - GetLayoutInsets(TOOLBAR_BUTTON) + + ::GetLayoutInsets(TOOLBAR_BUTTON) + *GetProperty(views::kInternalPaddingKey) + gfx::Insets(0, kBraveAvatarButtonHorizontalSpacing); SetBorder(views::CreateEmptyBorder(target_insets)); diff --git a/browser/ui/views/toolbar/bookmark_button.cc b/browser/ui/views/toolbar/bookmark_button.cc index 0ee0a515b4d6..e8ce90cdee28 100644 --- a/browser/ui/views/toolbar/bookmark_button.cc +++ b/browser/ui/views/toolbar/bookmark_button.cc @@ -9,6 +9,7 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/themes/theme_properties.h" +#include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/grit/generated_resources.h" #include "components/strings/grit/components_strings.h" #include "components/omnibox/browser/vector_icons.h" @@ -17,9 +18,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/theme_provider.h" #include "ui/gfx/paint_vector_icon.h" +#include "ui/views/controls/button/button.h" -BookmarkButton::BookmarkButton(views::ButtonListener* listener) - : ToolbarButton(listener) { +BookmarkButton::BookmarkButton() + : ToolbarButton(views::Button::PressedCallback()) { SetID(VIEW_ID_STAR_BUTTON); set_tag(IDC_BOOKMARK_THIS_TAB); SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)); diff --git a/browser/ui/views/toolbar/bookmark_button.h b/browser/ui/views/toolbar/bookmark_button.h index b275eff033b6..5bd10bb85dc2 100644 --- a/browser/ui/views/toolbar/bookmark_button.h +++ b/browser/ui/views/toolbar/bookmark_button.h @@ -14,7 +14,7 @@ class BookmarkButton : public ToolbarButton { public: - explicit BookmarkButton(views::ButtonListener* listener); + BookmarkButton(); ~BookmarkButton() override; void SetToggled(bool on); diff --git a/browser/ui/views/toolbar/brave_toolbar_view.cc b/browser/ui/views/toolbar/brave_toolbar_view.cc index 16e187315918..903b2ec96104 100644 --- a/browser/ui/views/toolbar/brave_toolbar_view.cc +++ b/browser/ui/views/toolbar/brave_toolbar_view.cc @@ -131,7 +131,7 @@ void BraveToolbarView::Init() { base::Bind(&BraveToolbarView::OnLocationBarIsWideChanged, base::Unretained(this))); - bookmark_ = new BookmarkButton(this); + bookmark_ = new BookmarkButton(); bookmark_->SetTriggerableEventFlags(ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); DCHECK(location_bar_); @@ -141,7 +141,7 @@ void BraveToolbarView::Init() { #if BUILDFLAG(ENABLE_SPEEDREADER) // Speedreader. if (base::FeatureList::IsEnabled(speedreader::kSpeedreaderFeature)) { - speedreader_ = new SpeedreaderButton(this, profile->GetPrefs()); + speedreader_ = new SpeedreaderButton(profile->GetPrefs()); speedreader_->SetTriggerableEventFlags(ui::EF_LEFT_MOUSE_BUTTON | ui::EF_MIDDLE_MOUSE_BUTTON); } diff --git a/browser/ui/views/toolbar/speedreader_button.cc b/browser/ui/views/toolbar/speedreader_button.cc index 0d22fc0460b5..689932886649 100644 --- a/browser/ui/views/toolbar/speedreader_button.cc +++ b/browser/ui/views/toolbar/speedreader_button.cc @@ -13,6 +13,7 @@ #include "brave/components/speedreader/speedreader_pref_names.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/themes/theme_properties.h" +#include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/grit/generated_resources.h" #include "components/grit/brave_components_strings.h" #include "components/prefs/pref_service.h" @@ -22,10 +23,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/theme_provider.h" #include "ui/gfx/paint_vector_icon.h" +#include "ui/views/controls/button/button.h" -SpeedreaderButton::SpeedreaderButton(views::ButtonListener* listener, - PrefService* prefs) - : ToolbarButton(listener), prefs_(prefs) { +SpeedreaderButton::SpeedreaderButton(PrefService* prefs) + : ToolbarButton(views::Button::PressedCallback()), prefs_(prefs) { SetID(BRAVE_VIEW_ID_SPEEDREADER_BUTTON); set_tag(IDC_TOGGLE_SPEEDREADER); SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)); diff --git a/browser/ui/views/toolbar/speedreader_button.h b/browser/ui/views/toolbar/speedreader_button.h index 6788a329a208..3855be190c6a 100644 --- a/browser/ui/views/toolbar/speedreader_button.h +++ b/browser/ui/views/toolbar/speedreader_button.h @@ -19,8 +19,7 @@ class WebContents; // distilled. class SpeedreaderButton : public ToolbarButton { public: - explicit SpeedreaderButton(views::ButtonListener* listener, - PrefService* prefs); + explicit SpeedreaderButton(PrefService* prefs); ~SpeedreaderButton() override; SpeedreaderButton(const SpeedreaderButton&) = delete; diff --git a/browser/ui/views/translate/brave_translate_bubble_view.cc b/browser/ui/views/translate/brave_translate_bubble_view.cc index 3bd512a4547e..7088e753f2a0 100644 --- a/browser/ui/views/translate/brave_translate_bubble_view.cc +++ b/browser/ui/views/translate/brave_translate_bubble_view.cc @@ -62,7 +62,8 @@ views::View* BraveTranslateBubbleView::BraveCreateViewBeforeTranslate() { 0); auto dont_ask_button = std::make_unique( - this, + base::BindRepeating(&BraveTranslateBubbleView::ButtonPressed, + base::Unretained(this), BUTTON_ID_ALWAYS_TRANSLATE), l10n_util::GetStringUTF16(IDS_BRAVE_TRANSLATE_BUBBLE_DONT_ASK_AGAIN)); dont_ask_button->SetID(BUTTON_ID_ALWAYS_TRANSLATE); @@ -73,12 +74,16 @@ views::View* BraveTranslateBubbleView::BraveCreateViewBeforeTranslate() { dont_ask_button->SetTextColor(views::Button::STATE_NORMAL, color); auto accept_button = std::make_unique( - this, l10n_util::GetStringUTF16(IDS_BRAVE_TRANSLATE_BUBBLE_INSTALL)); + base::BindRepeating(&BraveTranslateBubbleView::ButtonPressed, + base::Unretained(this), BUTTON_ID_DONE), + l10n_util::GetStringUTF16(IDS_BRAVE_TRANSLATE_BUBBLE_INSTALL)); accept_button->SetID(BUTTON_ID_DONE); accept_button->SetIsDefault(true); auto cancel_button = std::make_unique( - this, l10n_util::GetStringUTF16(IDS_BRAVE_TRANSLATE_BUBBLE_CANCEL)); + base::BindRepeating(&BraveTranslateBubbleView::ButtonPressed, + base::Unretained(this), BUTTON_ID_CLOSE), + l10n_util::GetStringUTF16(IDS_BRAVE_TRANSLATE_BUBBLE_CANCEL)); cancel_button->SetID(BUTTON_ID_CLOSE); layout->StartRowWithPadding( @@ -128,9 +133,8 @@ void BraveTranslateBubbleView::DisableOfferTranslatePref() { prefs->SetBoolean(prefs::kOfferTranslateEnabled, false); } -void BraveTranslateBubbleView::ButtonPressed(views::Button* sender, - const ui::Event& event) { - switch (static_cast(sender->GetID())) { +void BraveTranslateBubbleView::ButtonPressed(ButtonID button_id) { + switch (button_id) { case BUTTON_ID_DONE: { InstallGoogleTranslate(); break; diff --git a/browser/ui/views/translate/brave_translate_bubble_view.h b/browser/ui/views/translate/brave_translate_bubble_view.h index 73155299cb98..a801b1d90cf4 100644 --- a/browser/ui/views/translate/brave_translate_bubble_view.h +++ b/browser/ui/views/translate/brave_translate_bubble_view.h @@ -29,7 +29,6 @@ class BraveTranslateBubbleView : public TranslateBubbleView { // views::BubbleDialogDelegateView methods. void Init() override; - void ButtonPressed(views::Button* sender, const ui::Event& event) override; // views::View methods. bool AcceleratorPressed(const ui::Accelerator& accelerator) override; @@ -44,6 +43,7 @@ class BraveTranslateBubbleView : public TranslateBubbleView { friend class BraveTranslateBubbleViewTest; views::View* BraveCreateViewBeforeTranslate(); void DisableOfferTranslatePref(); + void ButtonPressed(ButtonID button_id); DISALLOW_COPY_AND_ASSIGN(BraveTranslateBubbleView); }; diff --git a/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc b/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc index 3d55ee8ca45f..b383c2a015f0 100644 --- a/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc +++ b/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc @@ -200,9 +200,7 @@ class BraveTranslateBubbleViewTest : public ChromeViewsTestBase { views::LabelButton button(nullptr, base::ASCIIToUTF16("dummy")); button.SetID(id); - bubble_->ButtonPressed(&button, - ui::KeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, - ui::DomCode::ENTER, ui::EF_NONE)); + bubble_->ButtonPressed(id); } void TearDown() override { diff --git a/browser/ui/webui/brave_settings_ui.cc b/browser/ui/webui/brave_settings_ui.cc index 7b6fe5426e8d..1688204ca044 100644 --- a/browser/ui/webui/brave_settings_ui.cc +++ b/browser/ui/webui/brave_settings_ui.cc @@ -59,7 +59,7 @@ BraveSettingsUI::~BraveSettingsUI() { void BraveSettingsUI::AddResources(content::WebUIDataSource* html_source, Profile* profile) { constexpr char generated_prefix[] = - "@out_folder@/gen/brave/browser/resources/settings/"; + "@out_folder@/gen/brave/browser/resources/settings/preprocessed"; const auto generated_prefix_len = strlen(generated_prefix); for (size_t i = 0; i < kBraveSettingsResourcesSize; ++i) { // Rewrite path for any generated entries diff --git a/build/android/BUILD.gn b/build/android/BUILD.gn index bf1f27bf5dd1..3b6196a928fe 100755 --- a/build/android/BUILD.gn +++ b/build/android/BUILD.gn @@ -1,5 +1,6 @@ import("//brave/build/config.gni") import("//build/config/android/rules.gni") +import("//tools/grit/grit_rule.gni") action("sign_app") { script = "//brave/build/android/sign_apk.py" diff --git a/build/android/bytecode/BUILD.gn b/build/android/bytecode/BUILD.gn index db1a10fb375c..c7a315aef664 100644 --- a/build/android/bytecode/BUILD.gn +++ b/build/android/bytecode/BUILD.gn @@ -10,6 +10,7 @@ java_binary("java_bytecode_rewriter") { sources = [ "//brave/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveClassVisitor.java", + "//brave/build/android/bytecode/java/org/brave/bytecode/BraveActivityClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveAndroidSyncSettingsClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveAppMenuClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveBottomControlsCoordinatorClassAdapter.java", diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveActivityClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveActivityClassAdapter.java new file mode 100644 index 000000000000..c990fc36491d --- /dev/null +++ b/build/android/bytecode/java/org/brave/bytecode/BraveActivityClassAdapter.java @@ -0,0 +1,18 @@ +/* Copyright (c) 2020 The Brave Authors. All rights reserved. + * 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/. */ + +package org.brave.bytecode; + +import org.objectweb.asm.ClassVisitor; + +public class BraveActivityClassAdapter extends BraveClassVisitor { + static String sBraveActivityClassName = "org/chromium/chrome/browser/app/BraveActivity"; + + public BraveActivityClassAdapter(ClassVisitor visitor) { + super(visitor); + + deleteField(sBraveActivityClassName, "mTabModelProfileSupplier"); + } +} diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java index d514fbc8219c..648fa417c2a9 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java @@ -29,6 +29,7 @@ public static ClassVisitor createAdapter(ClassVisitor chain) { chain = new BraveToolbarLayoutClassAdapter(chain); chain = new BraveTileViewClassAdapter(chain); chain = new BraveMimeUtilsClassAdapter(chain); + chain = new BraveActivityClassAdapter(chain); return chain; } } diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveToolbarManagerClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveToolbarManagerClassAdapter.java index 39b7afbb6dab..66ea403988dd 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveToolbarManagerClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveToolbarManagerClassAdapter.java @@ -36,15 +36,9 @@ public BraveToolbarManagerClassAdapter(ClassVisitor visitor) { deleteField(sBraveToolbarManagerClassName, "mScrimCoordinator"); makeProtectedField(sToolbarManagerClassName, "mScrimCoordinator"); - deleteField(sBraveToolbarManagerClassName, "mActivity"); - makeProtectedField(sToolbarManagerClassName, "mActivity"); - deleteField(sBraveToolbarManagerClassName, "mShowStartSurfaceSupplier"); makeProtectedField(sToolbarManagerClassName, "mShowStartSurfaceSupplier"); - deleteField(sBraveToolbarManagerClassName, "mOverviewModeBehaviorSupplier"); - makeProtectedField(sToolbarManagerClassName, "mOverviewModeBehaviorSupplier"); - deleteField(sBraveToolbarManagerClassName, "mMenuButtonCoordinator"); makeProtectedField(sToolbarManagerClassName, "mMenuButtonCoordinator"); diff --git a/chromium_src/chrome/browser/browser_about_handler.cc b/chromium_src/chrome/browser/browser_about_handler.cc index 3615484687fa..2f42deec31a7 100644 --- a/chromium_src/chrome/browser/browser_about_handler.cc +++ b/chromium_src/chrome/browser/browser_about_handler.cc @@ -3,22 +3,25 @@ * 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/. */ -#define FixupBrowserAboutURL FixupBrowserAboutURL_ChromiumImpl -#include "../../../../chrome/browser/browser_about_handler.cc" // NOLINT -#undef FixupBrowserAboutURL +#define HandleChromeAboutAndChromeSyncRewrite \ + HandleChromeAboutAndChromeSyncRewrite_ChromiumImpl +#include "../../../../chrome/browser/browser_about_handler.cc" +#undef HandleChromeAboutAndChromeSyncRewrite #include "brave/common/url_constants.h" #include "brave/common/webui_url_constants.h" -bool FixupBrowserAboutURL(GURL* url, - content::BrowserContext* browser_context) { - bool result = FixupBrowserAboutURL_ChromiumImpl(url, browser_context); - +bool HandleChromeAboutAndChromeSyncRewrite( + GURL* url, + content::BrowserContext* browser_context) { if (url->SchemeIs(kBraveUIScheme)) { GURL::Replacements replacements; replacements.SetSchemeStr(content::kChromeUIScheme); *url = url->ReplaceComponents(replacements); } + bool result = + HandleChromeAboutAndChromeSyncRewrite_ChromiumImpl(url, browser_context); + return result; } diff --git a/chromium_src/chrome/browser/search/instant_service.cc b/chromium_src/chrome/browser/search/instant_service.cc index cffcf470efb7..a78c86b1c455 100644 --- a/chromium_src/chrome/browser/search/instant_service.cc +++ b/chromium_src/chrome/browser/search/instant_service.cc @@ -4,7 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "chrome/browser/search/instant_service.h" -#include "chrome/browser/search/search_provider_observer.h" +#include "components/search/search_provider_observer.h" class AlwaysGoogleSearchProviderObserver : public SearchProviderObserver { public: diff --git a/chromium_src/chrome/browser/search/instant_service.h b/chromium_src/chrome/browser/search/instant_service.h index 9e6caddd5de4..1f00296e4ba4 100644 --- a/chromium_src/chrome/browser/search/instant_service.h +++ b/chromium_src/chrome/browser/search/instant_service.h @@ -6,11 +6,7 @@ #ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ #define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_SEARCH_INSTANT_SERVICE_H_ -#include "chrome/browser/search/search_provider_observer.h" - -// Forward declaration for class defined in .cc override. -class AlwaysGoogleSearchProviderObserver; - +// Replaces forward declaration. Class is defined in .cc override. #define SearchProviderObserver AlwaysGoogleSearchProviderObserver #include "../../../../../chrome/browser/search/instant_service.h" #undef SearchProviderObserver diff --git a/chromium_src/chrome/browser/ui/browser_navigator.cc b/chromium_src/chrome/browser/ui/browser_navigator.cc index c7e2a343d57c..c216a1400d4b 100644 --- a/chromium_src/chrome/browser/ui/browser_navigator.cc +++ b/chromium_src/chrome/browser/ui/browser_navigator.cc @@ -26,8 +26,9 @@ bool HandleURLInParent(NavigateParams* params, Profile* profile) { // GetOrCreateBrowser is not accessible here Browser* BraveGetOrCreateBrowser(Profile* profile, bool user_gesture) { Browser* browser = chrome::FindTabbedBrowser(profile, false); - return browser ? browser - : new Browser(Browser::CreateParams(profile, user_gesture)); + return browser + ? browser + : Browser::Create(Browser::CreateParams(profile, user_gesture)); } void UpdateBraveScheme(NavigateParams* params) { diff --git a/chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.cc deleted file mode 100644 index 17a073ffed54..000000000000 --- a/chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2020 The Brave Authors. All rights reserved. - * 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/. */ - -#include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" - -#include "brave/browser/ui/content_settings/brave_content_setting_bubble_model.h" - -#define CreateContentSettingBubbleModel \ - CreateContentSettingBubbleModel_ChromiumImpl -#include "../../../../../../chrome/browser/ui/content_settings/content_setting_bubble_model.cc" -#undef CreateContentSettingBubbleModel - -// static -std::unique_ptr -ContentSettingBubbleModel::CreateContentSettingBubbleModel( - Delegate* delegate, - WebContents* web_contents, - ContentSettingsType content_type) { - DCHECK(web_contents); - if (content_type == ContentSettingsType::PLUGINS) { - return std::make_unique(delegate, - web_contents); - } - return ContentSettingBubbleModel:: - CreateContentSettingBubbleModel_ChromiumImpl(delegate, web_contents, - content_type); -} diff --git a/chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.h b/chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.h deleted file mode 100644 index 066da67a17ca..000000000000 --- a/chromium_src/chrome/browser/ui/content_settings/content_setting_bubble_model.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (c) 2020 The Brave Authors. All rights reserved. - * 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_CHROMIUM_SRC_CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ -#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ - -#define CreateContentSettingBubbleModel \ - CreateContentSettingBubbleModel_ChromiumImpl( \ - Delegate* delegate, content::WebContents* web_contents, \ - ContentSettingsType content_type); \ - static std::unique_ptr \ - CreateContentSettingBubbleModel - -#include "../../../../../../chrome/browser/ui/content_settings/content_setting_bubble_model.h" -#undef CreateContentSettingBubbleModel - -#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ diff --git a/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc b/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc index af75c0a08b1b..5f880412ddc3 100644 --- a/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc +++ b/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc @@ -24,14 +24,12 @@ namespace { #if BUILDFLAG(ENABLE_WIDEVINE) -class DontAskAgainCheckbox : public views::Checkbox, - public views::ButtonListener { +class DontAskAgainCheckbox : public views::Checkbox { public: explicit DontAskAgainCheckbox(WidevinePermissionRequest* request); private: - // views::ButtonListener overrides: - void ButtonPressed(Button* sender, const ui::Event& event) override; + void ButtonPressed(); WidevinePermissionRequest* request_; @@ -39,13 +37,13 @@ class DontAskAgainCheckbox : public views::Checkbox, }; DontAskAgainCheckbox::DontAskAgainCheckbox(WidevinePermissionRequest* request) - : Checkbox(l10n_util::GetStringUTF16(IDS_WIDEVINE_DONT_ASK_AGAIN_CHECKBOX), - this), - request_(request) { -} + : views::Checkbox( + l10n_util::GetStringUTF16(IDS_WIDEVINE_DONT_ASK_AGAIN_CHECKBOX), + base::BindRepeating(&DontAskAgainCheckbox::ButtonPressed, + base::Unretained(this))), + request_(request) {} -void DontAskAgainCheckbox::ButtonPressed(Button* sender, - const ui::Event& event) { +void DontAskAgainCheckbox::ButtonPressed() { request_->set_dont_ask_widevine_install(GetChecked()); } diff --git a/chromium_src/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chromium_src/chrome/browser/ui/webui/extensions/extensions_ui.cc index 0b9202d773fb..1549b768dfa1 100644 --- a/chromium_src/chrome/browser/ui/webui/extensions/extensions_ui.cc +++ b/chromium_src/chrome/browser/ui/webui/extensions/extensions_ui.cc @@ -17,7 +17,7 @@ namespace { #if !BUILDFLAG(OPTIMIZE_WEBUI) constexpr char kBraveGeneratedPath[] = - "@out_folder@/gen/brave/browser/resources/extensions/"; + "@out_folder@/gen/brave/browser/resources/extensions/preprocessed"; #endif // Called from the original extension_ui.cc's CreateMdExtensionsSource via a diff --git a/chromium_src/chrome/browser/ui/webui/webui_util.cc b/chromium_src/chrome/browser/ui/webui/webui_util.cc index 99d419d919d9..ec1ef5716312 100644 --- a/chromium_src/chrome/browser/ui/webui/webui_util.cc +++ b/chromium_src/chrome/browser/ui/webui/webui_util.cc @@ -5,19 +5,9 @@ #include "chrome/browser/ui/webui/webui_util.h" -#include "chrome/common/buildflags.h" - #define SetupWebUIDataSource SetupWebUIDataSource_ChromiumImpl -#if BUILDFLAG(OPTIMIZE_WEBUI) -#define SetupBundledWebUIDataSource SetupBundledWebUIDataSource_ChromiumImpl -#endif - #include "../../../../../../chrome/browser/ui/webui/webui_util.cc" - #undef SetupWebUIDataSource -#if BUILDFLAG(OPTIMIZE_WEBUI) -#undef SetupBundledWebUIDataSource -#endif namespace webui { @@ -37,16 +27,4 @@ void SetupWebUIDataSource(content::WebUIDataSource* source, network::mojom::CSPDirectiveName::ScriptSrc, kBraveCSP); } -#if BUILDFLAG(OPTIMIZE_WEBUI) -void SetupBundledWebUIDataSource(content::WebUIDataSource* source, - base::StringPiece bundled_path, - int bundle, - int default_resource) { - SetupBundledWebUIDataSource_ChromiumImpl(source, bundled_path, bundle, - default_resource); - source->OverrideContentSecurityPolicy( - network::mojom::CSPDirectiveName::ScriptSrc, kBraveCSP); -} -#endif - } // namespace webui diff --git a/chromium_src/chrome/common/chrome_constants.cc b/chromium_src/chrome/common/chrome_constants.cc index 79154c3df760..1397eaa3dc0b 100644 --- a/chromium_src/chrome/common/chrome_constants.cc +++ b/chromium_src/chrome/common/chrome_constants.cc @@ -123,6 +123,7 @@ const base::FilePath::CharType kStatusTrayWindowClass[] = const char kInitialProfile[] = "Default"; const char kMultiProfileDirPrefix[] = "Profile "; +const char kEphemeralGuestProfileDirPrefix[] = "Guest "; const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile"); const base::FilePath::CharType kSystemProfileDir[] = FPL("System Profile"); @@ -187,16 +188,6 @@ const base::FilePath::CharType kReportingAndNelStoreFilename[] = const base::FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons"); #endif -// File name of the Pepper Flash plugin on different platforms. -const base::FilePath::CharType kPepperFlashPluginFilename[] = -#if defined(OS_MAC) - FPL("PepperFlashPlayer.plugin"); -#elif defined(OS_WIN) - FPL("pepflashplayer.dll"); -#else // OS_LINUX, etc. - FPL("libpepflashplayer.so"); -#endif - // directory names #if defined(OS_WIN) const wchar_t kUserDataDirname[] = L"User Data"; diff --git a/chromium_src/chrome/utility/services.cc b/chromium_src/chrome/utility/services.cc index fc6f27371d54..47123d5a0d53 100644 --- a/chromium_src/chrome/utility/services.cc +++ b/chromium_src/chrome/utility/services.cc @@ -75,34 +75,29 @@ auto RunBatAdsService( #if defined(OS_ANDROID) #define BRAVE_PROFILE_IMPORTER #else -#define BRAVE_PROFILE_IMPORTER \ - RunBraveProfileImporter, +#define BRAVE_PROFILE_IMPORTER services.Add(RunBraveProfileImporter); #endif #if BUILDFLAG(IPFS_ENABLED) -#define BRAVE_IPFS_SERVICE \ - RunIpfsService, +#define BRAVE_IPFS_SERVICE services.Add(RunIpfsService); #else #define BRAVE_IPFS_SERVICE #endif #if BUILDFLAG(ENABLE_TOR) -#define BRAVE_TOR_LAUNCHER \ - RunTorLauncher, +#define BRAVE_TOR_LAUNCHER services.Add(RunTorLauncher); #else #define BRAVE_TOR_LAUNCHER #endif #if BUILDFLAG(BRAVE_REWARDS_ENABLED) -#define BRAVE_BAT_LEDGER_SERVICE \ - RunBatLedgerService, +#define BRAVE_BAT_LEDGER_SERVICE services.Add(RunBatLedgerService); #else #define BRAVE_BAT_LEDGER_SERVICE #endif #if BUILDFLAG(BRAVE_ADS_ENABLED) -#define BRAVE_BAT_ADS_SERVICE \ - RunBatAdsService, +#define BRAVE_BAT_ADS_SERVICE services.Add(RunBatAdsService); #else #define BRAVE_BAT_ADS_SERVICE #endif diff --git a/chromium_src/components/content_settings/core/browser/content_settings_registry.cc b/chromium_src/components/content_settings/core/browser/content_settings_registry.cc index e806f25f0fcf..a31f0ed155e1 100644 --- a/chromium_src/components/content_settings/core/browser/content_settings_registry.cc +++ b/chromium_src/components/content_settings/core/browser/content_settings_registry.cc @@ -14,7 +14,7 @@ void ContentSettingsRegistry::BraveInit() { content_settings_info_.erase(ContentSettingsType::AUTOPLAY); website_settings_registry_->UnRegister(ContentSettingsType::AUTOPLAY); Register(ContentSettingsType::AUTOPLAY, "autoplay", CONTENT_SETTING_ALLOW, - WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(), + WebsiteSettingsInfo::UNSYNCABLE, AllowlistedSchemes(), ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, CONTENT_SETTING_ASK), WebsiteSettingsInfo::SINGLE_ORIGIN_ONLY_SCOPE, @@ -29,7 +29,7 @@ void ContentSettingsRegistry::BraveInit() { website_settings_registry_->UnRegister(ContentSettingsType::PLUGINS); Register(ContentSettingsType::PLUGINS, "plugins", CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::SYNCABLE, - WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme), + AllowlistedSchemes(kChromeUIScheme, kChromeDevToolsScheme), ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, CONTENT_SETTING_ASK, CONTENT_SETTING_DETECT_IMPORTANT_CONTENT), @@ -45,7 +45,7 @@ void ContentSettingsRegistry::BraveInit() { website_settings_registry_->UnRegister(ContentSettingsType::BACKGROUND_SYNC); Register(ContentSettingsType::BACKGROUND_SYNC, "background-sync", CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::UNSYNCABLE, - WhitelistedSchemes(), + AllowlistedSchemes(), ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK), WebsiteSettingsInfo::SINGLE_ORIGIN_ONLY_SCOPE, WebsiteSettingsRegistry::DESKTOP | @@ -58,7 +58,7 @@ void ContentSettingsRegistry::BraveInit() { content_settings_info_.erase(ContentSettingsType::SENSORS); website_settings_registry_->UnRegister(ContentSettingsType::SENSORS); Register(ContentSettingsType::SENSORS, "sensors", CONTENT_SETTING_BLOCK, - WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(), + WebsiteSettingsInfo::UNSYNCABLE, AllowlistedSchemes(), ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK), WebsiteSettingsInfo::SINGLE_ORIGIN_ONLY_SCOPE, WebsiteSettingsRegistry::DESKTOP | diff --git a/chromium_src/components/content_settings/renderer/content_settings_agent_impl.cc b/chromium_src/components/content_settings/renderer/content_settings_agent_impl.cc index 9ab07b68c088..a7ce63d4a5fb 100644 --- a/chromium_src/components/content_settings/renderer/content_settings_agent_impl.cc +++ b/chromium_src/components/content_settings/renderer/content_settings_agent_impl.cc @@ -6,12 +6,12 @@ #include "components/content_settings/renderer/content_settings_agent_impl.h" #define BRAVE_CONTENT_SETTINGS_AGENT_IMPL_IS_WHITELISTED_FOR_CONTENT_SETTINGS \ - return IsWhitelistedForContentSettings(origin, document_url); \ + return IsAllowlistedForContentSettings(origin, document_url); \ } \ \ -bool ContentSettingsAgentImpl::IsWhitelistedForContentSettings( \ +bool ContentSettingsAgentImpl::IsAllowlistedForContentSettings( \ const WebSecurityOrigin& origin, const WebURL& document_url) const { // #define BRAVE_CONTENT_SETTINGS_AGENT_IMPL_IS_WHITELISTED_FOR_CONTENT_SETTINGS #include "../../../../../components/content_settings/renderer/content_settings_agent_impl.cc" -#undef IsWhitelistedForContentSettings +#undef IsAllowlistedForContentSettings diff --git a/chromium_src/components/content_settings/renderer/content_settings_agent_impl.h b/chromium_src/components/content_settings/renderer/content_settings_agent_impl.h index 79f7156aa4b0..a2411d1b79f8 100644 --- a/chromium_src/components/content_settings/renderer/content_settings_agent_impl.h +++ b/chromium_src/components/content_settings/renderer/content_settings_agent_impl.h @@ -9,12 +9,12 @@ #define BRAVE_CONTENT_SETTINGS_AGENT_IMPL_H_ \ friend class BraveContentSettingsAgentImpl; -#define IsWhitelistedForContentSettings \ - IsWhitelistedForContentSettings(const blink::WebSecurityOrigin& origin, \ +#define IsAllowlistedForContentSettings \ + IsAllowlistedForContentSettings(const blink::WebSecurityOrigin& origin, \ const blink::WebURL& document_url) const; \ - bool IsWhitelistedForContentSettings + bool IsAllowlistedForContentSettings #include "../../../../../components/content_settings/renderer/content_settings_agent_impl.h" -#undef IsWhitelistedForContentSettings +#undef IsAllowlistedForContentSettings #endif // BRAVE_CHROMIUM_SRC_COMPONENTS_CONTENT_SETTINGS_RENDERER_CONTENT_SETTINGS_AGENT_IMPL_H_ diff --git a/chromium_src/components/favicon/core/favicon_database_browsertest.cc b/chromium_src/components/favicon/core/favicon_database_browsertest.cc index 31ae6f2af966..de0c7fe0f752 100644 --- a/chromium_src/components/favicon/core/favicon_database_browsertest.cc +++ b/chromium_src/components/favicon/core/favicon_database_browsertest.cc @@ -3,6 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "base/files/file_util.h" #include "base/path_service.h" #include "brave/browser/brave_content_browser_client.h" #include "brave/common/brave_paths.h" diff --git a/chromium_src/ios/chrome/browser/application_context_impl.mm b/chromium_src/ios/chrome/browser/application_context_impl.mm index 92fc35948f7a..db3e775a66b4 100644 --- a/chromium_src/ios/chrome/browser/application_context_impl.mm +++ b/chromium_src/ios/chrome/browser/application_context_impl.mm @@ -36,6 +36,7 @@ #include "ios/chrome/browser/chrome_paths.h" #import "ios/chrome/browser/crash_report/breadcrumbs/application_breadcrumbs_logger.h" #include "ios/chrome/browser/crash_report/breadcrumbs/breadcrumb_manager.h" +#include "ios/chrome/browser/crash_report/breadcrumbs/breadcrumb_persistent_storage_manager.h" #include "ios/chrome/browser/history/history_service_factory.h" #include "ios/chrome/browser/ios_chrome_io_thread.h" #include "ios/chrome/browser/policy/browser_policy_connector_ios.h" @@ -311,6 +312,12 @@ void BindNetworkChangeManagerReceiver( return nullptr; } +BreadcrumbPersistentStorageManager* +ApplicationContextImpl::GetBreadcrumbPersistentStorageManager() { + DCHECK(thread_checker_.CalledOnValidThread()); + return nullptr; +} + void ApplicationContextImpl::SetApplicationLocale(const std::string& locale) { DCHECK(thread_checker_.CalledOnValidThread()); application_locale_ = locale; diff --git a/chromium_src/ios/chrome/browser/prefs/browser_prefs.mm b/chromium_src/ios/chrome/browser/prefs/browser_prefs.mm index e5e747dadb01..c45a86b18731 100644 --- a/chromium_src/ios/chrome/browser/prefs/browser_prefs.mm +++ b/chromium_src/ios/chrome/browser/prefs/browser_prefs.mm @@ -5,7 +5,7 @@ #include "brave/components/brave_sync/brave_sync_prefs.h" -void BraveRegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) { +void BraveRegisterBrowserStatePrefs(PrefRegistrySimple* registry) { brave_sync::Prefs::RegisterProfilePrefs(registry); } diff --git a/chromium_src/net/base/network_isolation_key.cc b/chromium_src/net/base/network_isolation_key.cc deleted file mode 100644 index 5b300c7da711..000000000000 --- a/chromium_src/net/base/network_isolation_key.cc +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright (c) 2020 The Brave Authors. All rights reserved. - * 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/. */ - -#include "net/base/network_isolation_key.h" - -#include "../../../../net/base/network_isolation_key.cc" - -namespace net { - -const base::Optional& -NetworkIsolationKey::GetEffectiveTopFrameOrigin() const { - DCHECK_EQ(original_top_frame_origin_.has_value(), - top_frame_origin_.has_value()); - return top_frame_origin_; -} - -} // namespace net diff --git a/chromium_src/net/base/network_isolation_key.h b/chromium_src/net/base/network_isolation_key.h deleted file mode 100644 index b25eb93c640c..000000000000 --- a/chromium_src/net/base/network_isolation_key.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (c) 2020 The Brave Authors. All rights reserved. - * 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_CHROMIUM_SRC_NET_BASE_NETWORK_ISOLATION_KEY_H_ -#define BRAVE_CHROMIUM_SRC_NET_BASE_NETWORK_ISOLATION_KEY_H_ - -#define GetTopFrameOrigin \ - GetEffectiveTopFrameOrigin() const; \ - const base::Optional& GetTopFrameOrigin - -#include "../../../../net/base/network_isolation_key.h" // NOLINT - -#undef GetTopFrameOrigin - -#endif // BRAVE_CHROMIUM_SRC_NET_BASE_NETWORK_ISOLATION_KEY_H_ diff --git a/chromium_src/third_party/blink/common/features.cc b/chromium_src/third_party/blink/common/features.cc index f7dad536f8ee..45e76b474a27 100644 --- a/chromium_src/third_party/blink/common/features.cc +++ b/chromium_src/third_party/blink/common/features.cc @@ -3,7 +3,7 @@ * 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/. */ -#include "../../../../../../../third_party/blink/common/features.cc" +#include "../../../../../third_party/blink/common/features.cc" namespace blink { namespace features { diff --git a/chromium_src/third_party/blink/renderer/core/frame/navigator.cc b/chromium_src/third_party/blink/renderer/core/frame/navigator.cc index 8ab03b7f97ec..0910ffbd61fe 100644 --- a/chromium_src/third_party/blink/renderer/core/frame/navigator.cc +++ b/chromium_src/third_party/blink/renderer/core/frame/navigator.cc @@ -9,13 +9,13 @@ #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/loader/frame_loader.h" -#define BRAVE_NAVIGATOR_USERAGENT \ - if (blink::WebContentSettingsClient* settings = \ - brave::GetContentSettingsClientFor(GetExecutionContext())) { \ - if (!settings->AllowFingerprinting(true)) { \ - return brave::BraveSessionCache::From(*(GetExecutionContext())) \ - .FarbledUserAgent(GetFrame()->Loader().UserAgent()); \ - } \ +#define BRAVE_NAVIGATOR_USERAGENT \ + if (blink::WebContentSettingsClient* settings = \ + brave::GetContentSettingsClientFor(GetExecutionContext())) { \ + if (!settings->AllowFingerprinting(true)) { \ + return brave::BraveSessionCache::From(*(GetExecutionContext())) \ + .FarbledUserAgent(DomWindow()->GetFrame()->Loader().UserAgent()); \ + } \ } #include "../../../../../../../third_party/blink/renderer/core/frame/navigator.cc" diff --git a/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc b/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc index c5c4219c6efb..04088e99edb7 100644 --- a/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc +++ b/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc @@ -52,7 +52,9 @@ String PluginReplacementName(std::mt19937_64* prng) { void FarblePlugins(DOMPluginArray* owner, HeapVector>* dom_plugins) { - LocalFrame* frame = owner->GetFrame(); + if (!owner->DomWindow()) + return; + LocalFrame* frame = owner->DomWindow()->GetFrame(); if (!frame || !frame->GetContentSettingsClient()) return; switch (frame->GetContentSettingsClient()->GetBraveFarblingLevel()) { @@ -86,7 +88,8 @@ void FarblePlugins(DOMPluginArray* owner, BraveSessionCache::From(*(frame->DomWindow())) .GenerateRandomString(plugin->Filename().Ascii(), 32)); } - (*dom_plugins)[index] = MakeGarbageCollected(frame, *plugin); + (*dom_plugins)[index] = + MakeGarbageCollected(frame->DomWindow(), *plugin); } // Add fake plugin #1. auto* fake_plugin_info_1 = MakeGarbageCollected( @@ -103,8 +106,8 @@ void FarblePlugins(DOMPluginArray* owner, .GenerateRandomString("MIME_1_DESCRIPTION", 32), *fake_plugin_info_1); fake_plugin_info_1->AddMimeType(fake_mime_info_1); - auto* fake_dom_plugin_1 = - MakeGarbageCollected(frame, *fake_plugin_info_1); + auto* fake_dom_plugin_1 = MakeGarbageCollected( + frame->DomWindow(), *fake_plugin_info_1); dom_plugins->push_back(fake_dom_plugin_1); // Add fake plugin #2. auto* fake_plugin_info_2 = MakeGarbageCollected( @@ -121,8 +124,8 @@ void FarblePlugins(DOMPluginArray* owner, .GenerateRandomString("MIME_2_DESCRIPTION", 32), *fake_plugin_info_2); fake_plugin_info_2->AddMimeType(fake_mime_info_2); - auto* fake_dom_plugin_2 = - MakeGarbageCollected(frame, *fake_plugin_info_2); + auto* fake_dom_plugin_2 = MakeGarbageCollected( + frame->DomWindow(), *fake_plugin_info_2); dom_plugins->push_back(fake_dom_plugin_2); // Shuffle the list of plugins pseudo-randomly, based on the domain key. std::shuffle(dom_plugins->begin(), dom_plugins->end(), prng); diff --git a/chromium_src/third_party/blink/renderer/modules/storage/dom_window_storage.cc b/chromium_src/third_party/blink/renderer/modules/storage/dom_window_storage.cc index a45aed40b3aa..caf6e15a4ab7 100644 --- a/chromium_src/third_party/blink/renderer/modules/storage/dom_window_storage.cc +++ b/chromium_src/third_party/blink/renderer/modules/storage/dom_window_storage.cc @@ -199,7 +199,7 @@ StorageArea* BraveDOMWindowStorage::ephemeralSessionStorage() { namespaces->session_storage()->GetCachedArea(window->GetSecurityOrigin()); ephemeral_session_storage_ = - StorageArea::Create(window->GetFrame(), std::move(storage_area), + StorageArea::Create(window, std::move(storage_area), StorageArea::StorageType::kSessionStorage); return ephemeral_session_storage_; } @@ -242,7 +242,7 @@ StorageArea* BraveDOMWindowStorage::ephemeralLocalStorage() { // sessionStorage works. Due to this, when opening up a new ephemeral // localStorage area, we use the sessionStorage infrastructure. ephemeral_local_storage_ = - StorageArea::Create(window->GetFrame(), std::move(storage_area), + StorageArea::Create(window, std::move(storage_area), StorageArea::StorageType::kSessionStorage); return ephemeral_local_storage_; } diff --git a/chromium_src/ui/base/webui/web_ui_util.cc b/chromium_src/ui/base/webui/web_ui_util.cc index 4d44d431f3a7..7bde1c4cbaa2 100644 --- a/chromium_src/ui/base/webui/web_ui_util.cc +++ b/chromium_src/ui/base/webui/web_ui_util.cc @@ -10,12 +10,14 @@ // Replace text_defaults.css with brave's text_defaults.css // which is defined in brave_webui_resources.grd. -#define IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_PREVIOUS IDR_WEBUI_CSS_TEXT_DEFAULTS_MD -#undef IDR_WEBUI_CSS_TEXT_DEFAULTS_MD -#define IDR_WEBUI_CSS_TEXT_DEFAULTS_MD IDR_BRAVE_WEBUI_CSS_TEXT_DEFAULTS -#include "../../../../../ui/base/webui/web_ui_util.cc" // NOLINT -#undef IDR_WEBUI_CSS_TEXT_DEFAULTS_MD -#define IDR_WEBUI_CSS_TEXT_DEFAULTS_MD IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_PREVIOUS +#define IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS_PREVIOUS \ + IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS -#if !defined(OS_ANDROID) -#endif +#undef IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS +#define IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS IDR_BRAVE_WEBUI_CSS_TEXT_DEFAULTS + +#include "../../../../../ui/base/webui/web_ui_util.cc" + +#undef IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS +#define IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS \ + IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS_PREVIOUS diff --git a/common/resource_bundle_helper.cc b/common/resource_bundle_helper.cc index 6de1eb4f5180..b9feb507f6aa 100644 --- a/common/resource_bundle_helper.cc +++ b/common/resource_bundle_helper.cc @@ -101,7 +101,6 @@ bool SubprocessNeedsResourceBundle() { // Mac needs them too for scrollbar related images and for sandbox // profiles. process_type == switches::kPpapiPluginProcess || - process_type == switches::kPpapiBrokerProcess || process_type == switches::kGpuProcess || #endif // defined(OS_MAC) process_type == switches::kRendererProcess || diff --git a/components/brave_ads/browser/ads_service_browsertest.cc b/components/brave_ads/browser/ads_service_browsertest.cc index 51d722f2cd44..3014dd13c058 100644 --- a/components/brave_ads/browser/ads_service_browsertest.cc +++ b/components/brave_ads/browser/ads_service_browsertest.cc @@ -9,6 +9,7 @@ #include #include "base/containers/flat_map.h" +#include "base/files/file_util.h" #include "base/path_service.h" #include "base/run_loop.h" #include "base/strings/string_split.h" diff --git a/components/brave_ads/browser/ads_service_impl.cc b/components/brave_ads/browser/ads_service_impl.cc index f3518a9dde10..1e7dd91fca32 100644 --- a/components/brave_ads/browser/ads_service_impl.cc +++ b/components/brave_ads/browser/ads_service_impl.cc @@ -1053,7 +1053,7 @@ void AdsServiceImpl::OpenNewTabWithUrl( #else Browser* browser = chrome::FindTabbedBrowser(profile_, false); if (!browser) { - browser = new Browser(Browser::CreateParams(profile_, true)); + browser = Browser::Create(Browser::CreateParams(profile_, true)); } NavigateParams nav_params(browser, gurl, ui::PAGE_TRANSITION_LINK); diff --git a/components/brave_rewards/browser/test/rewards_database_browsertest.cc b/components/brave_rewards/browser/test/rewards_database_browsertest.cc index 1a9a13c3dec7..148253d73ef1 100644 --- a/components/brave_rewards/browser/test/rewards_database_browsertest.cc +++ b/components/brave_rewards/browser/test/rewards_database_browsertest.cc @@ -4,6 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "base/containers/flat_map.h" +#include "base/files/file_util.h" #include "base/path_service.h" #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" diff --git a/components/brave_rewards/browser/test/rewards_state_browsertest.cc b/components/brave_rewards/browser/test/rewards_state_browsertest.cc index 99c8f244eee7..2d197d7973c6 100644 --- a/components/brave_rewards/browser/test/rewards_state_browsertest.cc +++ b/components/brave_rewards/browser/test/rewards_state_browsertest.cc @@ -4,6 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "base/containers/flat_map.h" +#include "base/files/file_util.h" #include "base/path_service.h" #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" diff --git a/components/brave_sync/BUILD.gn b/components/brave_sync/BUILD.gn index 8ef5e2f076e2..322e77bdbfbb 100644 --- a/components/brave_sync/BUILD.gn +++ b/components/brave_sync/BUILD.gn @@ -71,7 +71,6 @@ source_set("prefs") { "//base", "//components/os_crypt", "//components/prefs", - "//components/pref_registry", ] } diff --git a/components/brave_sync/brave_sync_prefs.cc b/components/brave_sync/brave_sync_prefs.cc index 842d35fe4ec9..d7f5cb1f2489 100644 --- a/components/brave_sync/brave_sync_prefs.cc +++ b/components/brave_sync/brave_sync_prefs.cc @@ -10,7 +10,7 @@ #include "base/base64.h" #include "base/logging.h" #include "components/os_crypt/os_crypt.h" -#include "components/pref_registry/pref_registry_syncable.h" +#include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" @@ -64,7 +64,7 @@ Prefs::Prefs(PrefService* pref_service) : pref_service_(pref_service) {} Prefs::~Prefs() {} // static -void Prefs::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { +void Prefs::RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterStringPref(kSyncV2Seed, std::string()); registry->RegisterBooleanPref(kSyncV1Migrated, false); registry->RegisterBooleanPref(kSyncV1MetaInfoCleared, false); diff --git a/components/brave_sync/brave_sync_prefs.h b/components/brave_sync/brave_sync_prefs.h index 3cd0f4515bdd..81abd2edd4f7 100644 --- a/components/brave_sync/brave_sync_prefs.h +++ b/components/brave_sync/brave_sync_prefs.h @@ -13,16 +13,13 @@ #include "base/macros.h" #include "base/values.h" +class PrefRegistrySimple; class PrefService; namespace base { class Time; } -namespace user_prefs { -class PrefRegistrySyncable; -} - namespace brave_sync { class Prefs { @@ -30,7 +27,7 @@ class Prefs { explicit Prefs(PrefService* pref_service); virtual ~Prefs(); - static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); + static void RegisterProfilePrefs(PrefRegistrySimple* registry); static std::string GetSeedPath(); diff --git a/components/brave_wayback_machine/buildflags/buildflags.gni b/components/brave_wayback_machine/buildflags/buildflags.gni index ff51d2517557..16a9a6112a84 100644 --- a/components/brave_wayback_machine/buildflags/buildflags.gni +++ b/components/brave_wayback_machine/buildflags/buildflags.gni @@ -1,3 +1,3 @@ declare_args() { - enable_brave_wayback_machine = is_win || is_mac || is_desktop_linux + enable_brave_wayback_machine = is_win || is_mac || is_linux } diff --git a/components/components_strings.grd b/components/components_strings.grd index 9deb485b08fe..885c56491e3f 100644 --- a/components/components_strings.grd +++ b/components/components_strings.grd @@ -313,6 +313,7 @@ + @@ -328,6 +329,9 @@ + + + @@ -348,6 +352,9 @@ OK + + Reload + Add @@ -360,6 +367,12 @@ Menu + + Install + + + Update + Show diff --git a/components/components_strings_override.grd b/components/components_strings_override.grd index 3facb2a55194..4fe8da84ac06 100644 --- a/components/components_strings_override.grd +++ b/components/components_strings_override.grd @@ -96,6 +96,8 @@ + + diff --git a/components/content_settings/renderer/brave_content_settings_agent_impl.cc b/components/content_settings/renderer/brave_content_settings_agent_impl.cc index db892317181e..5be16861b636 100644 --- a/components/content_settings/renderer/brave_content_settings_agent_impl.cc +++ b/components/content_settings/renderer/brave_content_settings_agent_impl.cc @@ -151,7 +151,7 @@ bool BraveContentSettingsAgentImpl::AllowScriptFromSource( // scripts with whitelisted protocols, such as chrome://extensions should // be allowed - bool should_white_list = IsWhitelistedForContentSettings( + bool should_white_list = IsAllowlistedForContentSettings( blink::WebSecurityOrigin::Create(script_url), render_frame()->GetWebFrame()->GetDocument().Url()); diff --git a/components/content_settings/renderer/brave_content_settings_agent_impl_flash_browsertest.cc b/components/content_settings/renderer/brave_content_settings_agent_impl_flash_browsertest.cc deleted file mode 100644 index ac5b9373ae1d..000000000000 --- a/components/content_settings/renderer/brave_content_settings_agent_impl_flash_browsertest.cc +++ /dev/null @@ -1,197 +0,0 @@ -/* Copyright 2020 The Brave Authors. All rights reserved. - * 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/. */ - -#include "base/path_service.h" -#include "brave/browser/brave_content_browser_client.h" -#include "brave/common/brave_paths.h" -#include "brave/components/brave_shields/common/brave_shield_constants.h" -#include "chrome/browser/content_settings/host_content_settings_map_factory.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_content_client.h" -#include "chrome/test/base/in_process_browser_test.h" -#include "chrome/test/base/ui_test_utils.h" -#include "content/public/browser/render_frame_host.h" -#include "content/public/common/content_switches.h" -#include "content/public/test/browser_test_utils.h" -#include "content/public/test/ppapi_test_utils.h" -#include "components/content_settings/core/browser/host_content_settings_map.h" -#include "components/content_settings/core/common/content_settings.h" -#include "components/content_settings/core/common/content_settings_types.h" -#include "components/permissions/test/mock_permission_prompt_factory.h" -#include "content/public/test/browser_test.h" -#include "net/dns/mock_host_resolver.h" - -const char kFlashPluginExists[] = - "domAutomationController.send(Array.from(navigator.plugins).filter(" - " x => Array.from(x).some(" - " y => y.type === 'application/x-shockwave-flash')).length)"; - -namespace { - -class PageReloadWaiter { - public: - explicit PageReloadWaiter(content::WebContents* web_contents) - : web_contents_(web_contents), - navigation_observer_(web_contents, - web_contents->GetLastCommittedURL()) {} - - bool Wait() { - navigation_observer_.WaitForNavigationFinished(); - return content::WaitForLoadStop(web_contents_); - } - - private: - content::WebContents* web_contents_; - content::TestNavigationManager navigation_observer_; -}; - -} // namespace - -class BraveContentSettingsAgentImplFlashBrowserTest - : public InProcessBrowserTest { - public: - void SetUpOnMainThread() override { - InProcessBrowserTest::SetUpOnMainThread(); - - content_client_.reset(new ChromeContentClient); - content::SetContentClient(content_client_.get()); - browser_content_client_.reset(new BraveContentBrowserClient()); - content::SetBrowserClientForTesting(browser_content_client_.get()); - - host_resolver()->AddRule("*", "127.0.0.1"); - content::SetupCrossSiteRedirector(embedded_test_server()); - - brave::RegisterPathProvider(); - base::FilePath test_data_dir; - base::PathService::Get(brave::DIR_TEST_DATA, &test_data_dir); - embedded_test_server()->ServeFilesFromDirectory(test_data_dir); - - ASSERT_TRUE(embedded_test_server()->Start()); - - url_ = embedded_test_server()->GetURL("a.com", "/flash.html"); - top_level_page_pattern_ = - ContentSettingsPattern::FromString("http://a.com/*"); - } - - void SetUpCommandLine(base::CommandLine* command_line) override { - InProcessBrowserTest::SetUpCommandLine(command_line); - ASSERT_TRUE(ppapi::RegisterFlashTestPlugin(command_line)); - // These tests are for the permission prompt to add and remove Flash from - // navigator.plugins. We disable Plugin Power Saver, because its plugin - // throttling make it harder to test if Flash was succcessfully enabled. - command_line->AppendSwitchASCII( - switches::kOverridePluginPowerSaverForTesting, "never"); - } - - void TearDown() override { - browser_content_client_.reset(); - content_client_.reset(); - } - - const GURL& url() { return url_; } - - const ContentSettingsPattern& top_level_page_pattern() { - return top_level_page_pattern_; - } - - const ContentSettingsPattern& empty_pattern() { return empty_pattern_; } - - HostContentSettingsMap* content_settings() { - return HostContentSettingsMapFactory::GetForProfile(browser()->profile()); - } - - void UnblockFlash() { - content_settings()->SetContentSettingCustomScope( - top_level_page_pattern_, ContentSettingsPattern::Wildcard(), - ContentSettingsType::PLUGINS, std::string(), - CONTENT_SETTING_DETECT_IMPORTANT_CONTENT); - } - - void AllowFlash() { - content_settings()->SetContentSettingCustomScope( - top_level_page_pattern_, ContentSettingsPattern::Wildcard(), - ContentSettingsType::PLUGINS, std::string(), CONTENT_SETTING_ALLOW); - } - - content::WebContents* contents() { - return browser()->tab_strip_model()->GetActiveWebContents(); - } - - bool NavigateToURLUntilLoadStop(const GURL& url) { - ui_test_utils::NavigateToURL(browser(), url); - return WaitForLoadStop(contents()); - } - - private: - GURL url_; - ContentSettingsPattern top_level_page_pattern_; - ContentSettingsPattern empty_pattern_; - std::unique_ptr content_client_; - std::unique_ptr browser_content_client_; - - base::ScopedTempDir temp_user_data_dir_; -}; - -// Flash is blocked by default -IN_PROC_BROWSER_TEST_F(BraveContentSettingsAgentImplFlashBrowserTest, - BlockFlashByDefault) { - NavigateToURLUntilLoadStop(url()); - int len; - ASSERT_TRUE(ExecuteScriptAndExtractInt(contents(), - kFlashPluginExists, &len)); - ASSERT_EQ(len, 0); -} - -// Flash is unblocked and click to play eventually allows -IN_PROC_BROWSER_TEST_F(BraveContentSettingsAgentImplFlashBrowserTest, - UnblockFlash) { - UnblockFlash(); - NavigateToURLUntilLoadStop(url()); - int len; - ASSERT_TRUE(ExecuteScriptAndExtractInt(contents(), - kFlashPluginExists, &len)); - ASSERT_EQ(len, 0); - - permissions::PermissionRequestManager* manager = - permissions::PermissionRequestManager::FromWebContents(contents()); - - auto popup_prompt_factory = - std::make_unique(manager); - - EXPECT_EQ(0, popup_prompt_factory->TotalRequestCount()); - popup_prompt_factory->set_response_type( - permissions::PermissionRequestManager::ACCEPT_ALL); - - PageReloadWaiter reload_waiter(contents()); - - bool value; - EXPECT_TRUE(ExecuteScriptAndExtractBool(contents(), "triggerPrompt();", - &value)); - EXPECT_TRUE(value); - EXPECT_TRUE(reload_waiter.Wait()); - - EXPECT_EQ(1, popup_prompt_factory->TotalRequestCount()); - - // Shut down the popup window tab, as the normal test teardown assumes there - // is only one test tab. - popup_prompt_factory.reset(); - - ASSERT_TRUE(ExecuteScriptAndExtractInt(contents(), - kFlashPluginExists, &len)); - ASSERT_GT(len, 0); -} - -// Flash is explicitly allowed -IN_PROC_BROWSER_TEST_F(BraveContentSettingsAgentImplFlashBrowserTest, - AllowFlashExplicitAllows) { - AllowFlash(); - NavigateToURLUntilLoadStop(url()); - int len; - ASSERT_TRUE(ExecuteScriptAndExtractInt(contents(), - kFlashPluginExists, &len)); - ASSERT_GT(len, 0); -} - diff --git a/components/ipfs/brave_ipfs_client_updater_browsertest.cc b/components/ipfs/brave_ipfs_client_updater_browsertest.cc index a2e743ddbe3d..9ef251d091a3 100644 --- a/components/ipfs/brave_ipfs_client_updater_browsertest.cc +++ b/components/ipfs/brave_ipfs_client_updater_browsertest.cc @@ -3,6 +3,7 @@ * 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/. */ +#include "base/files/file_util.h" #include "base/path_service.h" #include "base/test/thread_test_helper.h" #include "brave/browser/brave_browser_process_impl.h" diff --git a/components/new_or_sad_tab_strings.grdp b/components/new_or_sad_tab_strings.grdp index 1c7aa575a730..71d3b72c7749 100644 --- a/components/new_or_sad_tab_strings.grdp +++ b/components/new_or_sad_tab_strings.grdp @@ -170,4 +170,49 @@ When on, sites can't use cookies that track you across the web. Features on some sites may break. + + + + + You’re browsing as a Guest + + + Hi %sMariam, + <br> + You’re browsing as a Guest + + + You won't see any Brave profile's info in Guest mode. You can <a id="change-sign-in-status">sign in</a> to access your Brave account info like passwords and payment methods. + + + Close all Guest windows so your browsing activity is deleted from this device. + + + <b> + Activity that won't stay on this device: + </b> + <ul> + <li>Pages you view in this window + <li>Cookies and site data + </ul> + + + <b> + Activity that won't stay on this device: + </b> + <ul> + <li>Pages you view in this window + <li>Cookies and site data + <li>Account information (<a id="change-sign-in-status">sign out</a>) + </ul> + + + <b> + Your activity that stays on this device: + </b> + <ul> + <li>Any files you download in this window + </ul> + + diff --git a/components/ntp_snippets_strings.grdp b/components/ntp_snippets_strings.grdp index 888c6d44953f..f60ddee9c656 100644 --- a/components/ntp_snippets_strings.grdp +++ b/components/ntp_snippets_strings.grdp @@ -2,7 +2,7 @@ - + That’s all for now diff --git a/components/page_info_strings.grdp b/components/page_info_strings.grdp index c9cb885b7eff..fd52bdadb2ab 100644 --- a/components/page_info_strings.grdp +++ b/components/page_info_strings.grdp @@ -8,9 +8,15 @@ Your connection to this site is not fully secure + + Connection is not fully secure + Your connection to this site is not secure + + Connection is not secure + This site contains malware @@ -247,7 +253,7 @@ Background Sync - User presence + Your presence Images diff --git a/components/policy_strings.grdp b/components/policy_strings.grdp index 61d9a3d5d5da..8994a70595eb 100644 --- a/components/policy_strings.grdp +++ b/components/policy_strings.grdp @@ -586,8 +586,11 @@ Additional details: Android apps - - Printing of this content is blocked by your administrator + + Printing is blocked + + + Printing of this content is blocked by your administrator. diff --git a/components/subresource_filter_strings.grdp b/components/subresource_filter_strings.grdp new file mode 100644 index 000000000000..daed0e66e8b0 --- /dev/null +++ b/components/subresource_filter_strings.grdp @@ -0,0 +1,19 @@ + + + + + Always allow ads on this site + + + Ads blocked + + + This site shows intrusive or misleading ads. + + + + + Ads blocked. + + + diff --git a/components/vector_icons/BUILD.gn b/components/vector_icons/BUILD.gn index 7c74295f992f..ef48901c9687 100644 --- a/components/vector_icons/BUILD.gn +++ b/components/vector_icons/BUILD.gn @@ -5,7 +5,7 @@ import("//components/vector_icons/vector_icons.gni") -aggregate_vector_icons2("brave_components_vector_icons") { +aggregate_vector_icons("brave_components_vector_icons") { icon_directory = "." sources = [ "autoplay_status.icon" ] diff --git a/components/webxr_strings.grdp b/components/webxr_strings.grdp new file mode 100644 index 000000000000..924fc36acab6 --- /dev/null +++ b/components/webxr_strings.grdp @@ -0,0 +1,14 @@ + + + + + + + + To view augmented reality content, install ARCore + + + To view augmented reality content, update ARCore + + + diff --git a/ios/browser/api/sync/brave_sync_worker.cc b/ios/browser/api/sync/brave_sync_worker.cc index d3cd208375b0..670f6b1e440c 100644 --- a/ios/browser/api/sync/brave_sync_worker.cc +++ b/ios/browser/api/sync/brave_sync_worker.cc @@ -299,14 +299,9 @@ void BraveSyncWorker::OnStateChanged(syncer::SyncService* service) { DCHECK_NE(sync_code.size(), 0u); if (!service->GetUserSettings()->IsEncryptEverythingAllowed()) { - configuration.encrypt_all = false; configuration.set_new_passphrase = false; } - if (configuration.encrypt_all) { - service->GetUserSettings()->EnableEncryptEverything(); - } - bool passphrase_failed = false; if (!sync_code.empty()) { if (service->GetUserSettings()->IsPassphraseRequired()) { diff --git a/net/proxy_resolution/proxy_config_service_tor.cc b/net/proxy_resolution/proxy_config_service_tor.cc index 5dc475053b41..812de09c81c0 100644 --- a/net/proxy_resolution/proxy_config_service_tor.cc +++ b/net/proxy_resolution/proxy_config_service_tor.cc @@ -141,7 +141,7 @@ std::string ProxyConfigServiceTor::CircuitIsolationKey(const GURL& url) { net::NetworkIsolationKey network_isolation_key(url_origin, url_origin); const base::Optional& network_isolation_key_origin = - network_isolation_key.GetEffectiveTopFrameOrigin(); + network_isolation_key.GetTopFrameSite(); DCHECK(network_isolation_key_origin.has_value()); return network_isolation_key_origin->host(); } diff --git a/patches/base-BUILD.gn.patch b/patches/base-BUILD.gn.patch index 9a8f0d4a4525..6546c3e46711 100644 --- a/patches/base-BUILD.gn.patch +++ b/patches/base-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn -index 1d97f72804f29f5eac4e13a77627672078b0548d..bdb8e74e3a5e5ecb03ae6d9527085bef12385bfa 100644 +index 928b2bc161e968f9ea75c7f73f1149a11065a9a4..015e7c7a47c77540606442420a6990d756cfd652 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -3705,6 +3705,7 @@ if (is_android) { +@@ -3733,6 +3733,7 @@ if (is_android) { "android/java/src/org/chromium/base/task/TaskTraits.java", "android/java/src/org/chromium/base/task/TaskTraitsExtensionDescriptor.java", ] diff --git a/patches/build-config-BUILDCONFIG.gn.patch b/patches/build-config-BUILDCONFIG.gn.patch index 1e894a8f74e5..8bbe992e8755 100644 --- a/patches/build-config-BUILDCONFIG.gn.patch +++ b/patches/build-config-BUILDCONFIG.gn.patch @@ -1,8 +1,8 @@ diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 3082046a91da5fe400d8405da61f55ad66fa5e74..fed50d2b9c2350a1c159d7be696d6e0a4c1cd4f4 100644 +index e0984fa527dd5bb141e2cc54a2726bba18eeb410..47da55a74d44756e891fc04ea0a47c81d228306b 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn -@@ -315,6 +315,7 @@ is_posix = !is_win && !is_fuchsia +@@ -312,6 +312,7 @@ is_posix = !is_win && !is_fuchsia # Holds all configs used for running the compiler. default_compiler_configs = [ diff --git a/patches/build-config-android-config.gni.patch b/patches/build-config-android-config.gni.patch index d07ed9ea2f15..30f4aef1c068 100644 --- a/patches/build-config-android-config.gni.patch +++ b/patches/build-config-android-config.gni.patch @@ -1,9 +1,9 @@ diff --git a/build/config/android/config.gni b/build/config/android/config.gni -index 0b942fa4cf9ce965d9ba5d93ac25e42baf7bbfe8..ee0e84a822681db8282e35d6d9e1f0d0c7aa7cb6 100644 +index 4c363465c3c7a153c7934ba99b665435d8fdaf12..25e1033577f9821d0e6fce4d87d49aac2aea57d9 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni -@@ -3,6 +3,7 @@ - # found in the LICENSE file. +@@ -7,6 +7,7 @@ + import("//build/config/chromeos/ui_mode.gni") # This file contains common system config stuff for the Android build. +import("//brave/build/android/config.gni") diff --git a/patches/build-config-android-internal_rules.gni.patch b/patches/build-config-android-internal_rules.gni.patch index 04bb2ff5613f..d41683b4bf2f 100644 --- a/patches/build-config-android-internal_rules.gni.patch +++ b/patches/build-config-android-internal_rules.gni.patch @@ -1,8 +1,8 @@ diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni -index af22e3e45c0b0f1d90e73a9eb2785bc5eb67c2f8..0e1d64b187e2c5c2c788278ded92513764a63173 100644 +index c01294f793e85040bc3d258c277cb82869609eb8..a91d163dafe8c60c41b20ad9601542b364c4c664 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni -@@ -2028,6 +2028,7 @@ if (enable_java_templates) { +@@ -2023,6 +2023,7 @@ if (enable_java_templates) { _deps = [ ":$_desugar_target" ] _previous_output_jar = _desugar_output_jar } diff --git a/patches/build-config-android-rules.gni.patch b/patches/build-config-android-rules.gni.patch index 104ff9640db0..7dc652e9fd9e 100644 --- a/patches/build-config-android-rules.gni.patch +++ b/patches/build-config-android-rules.gni.patch @@ -1,5 +1,5 @@ diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni -index f5c704898d06ee71905b0f81f786cdc4f76bdfd1..0aacd27c927d97c1f2bbadc1956d350c3f6e01b3 100644 +index 588b619121a62905a0b056b1a4640f3d62446c4b..d68609ee34a09075d3b48eb36dadccab63e9d644 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni @@ -509,6 +509,7 @@ if (enable_java_templates) { @@ -10,7 +10,7 @@ index f5c704898d06ee71905b0f81f786cdc4f76bdfd1..0aacd27c927d97c1f2bbadc1956d350c action_with_pydeps(target_name) { forward_variables_from(invoker, [ -@@ -622,6 +623,7 @@ if (enable_java_templates) { +@@ -658,6 +659,7 @@ if (enable_java_templates) { # output = "$target_gen_dir/AndroidManifest.xml" # } template("jinja_template") { diff --git a/patches/build-config-compiler-BUILD.gn.patch b/patches/build-config-compiler-BUILD.gn.patch index 9cc37a2ee528..d448011ac9f7 100644 --- a/patches/build-config-compiler-BUILD.gn.patch +++ b/patches/build-config-compiler-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 4f6461b6b5f5b42669e03e4334a297011caa2e98..ed4e2540fc50bb3d20ce65fd4db9dce12815039c 100644 +index ed3d81786b0dd16f998ece213f7cd66723bed5fb..84b1e1aac1b113688f4b6bd527be846db2a8aee1 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1646,6 +1646,7 @@ config("chromium_code") { +@@ -1670,6 +1670,7 @@ config("chromium_code") { cflags += [ "-Wextra-semi" ] } } diff --git a/patches/chrome-BUILD.gn.patch b/patches/chrome-BUILD.gn.patch index 10670efb2e21..88e9041a697d 100644 --- a/patches/chrome-BUILD.gn.patch +++ b/patches/chrome-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d689dbb98a 100644 +index a1f8f46f3055f412aff2a883b5e8ca3d609468cf..3ffae4dcc3fb330c75b80ede23b26721c31746c4 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -154,6 +154,10 @@ if (!is_android && !is_mac) { +@@ -150,6 +150,10 @@ if (!is_android && !is_mac) { "common/crash_keys.cc", "common/crash_keys.h", ] @@ -13,7 +13,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 deps += [ ":chrome_dll", -@@ -419,11 +423,12 @@ if (is_win) { +@@ -418,11 +422,12 @@ if (is_win) { args += [ "--keystone=0" ] } } @@ -27,7 +27,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 extra_substitutions = [ "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", "CHROMIUM_SHORT_NAME=$chrome_product_short_name", -@@ -441,6 +446,7 @@ if (is_win) { +@@ -440,6 +445,7 @@ if (is_win) { "//chrome/common:buildflags", "//chrome/common:version_header", ] @@ -35,7 +35,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 if (enable_stripping) { # At link time, preserve the global symbols specified in the .exports -@@ -509,7 +515,7 @@ if (is_win) { +@@ -508,7 +514,7 @@ if (is_win) { args = [ "-b", @@ -44,7 +44,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 "-v", rebase_path(chrome_version_file, root_build_dir), "-g", -@@ -578,6 +584,7 @@ if (is_win) { +@@ -577,6 +583,7 @@ if (is_win) { # this dependency directly copies the file into the framework's # resources directory. public_deps += [ ":chrome_framework_widevine_signature" ] @@ -52,7 +52,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 } } -@@ -610,9 +617,11 @@ if (is_win) { +@@ -609,9 +616,11 @@ if (is_win) { "--scm=0", ] } @@ -64,7 +64,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 if (is_chrome_branded) { # These entitlements are bound to the official Google Chrome signing # certificate and will not necessarily work in any other build. -@@ -633,7 +642,7 @@ if (is_win) { +@@ -632,7 +641,7 @@ if (is_win) { output_name = chrome_helper_name + invoker.helper_name_suffix @@ -73,7 +73,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 extra_substitutions = [ "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", "CHROMIUM_SHORT_NAME=$chrome_product_short_name", -@@ -1020,6 +1029,10 @@ if (is_win) { +@@ -1019,6 +1028,10 @@ if (is_win) { if (is_chrome_branded) { deps += [ ":default_apps" ] } @@ -84,7 +84,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$chrome_framework_name.framework/Versions/$chrome_version_full/$chrome_framework_name" ] -@@ -1177,6 +1190,7 @@ if (is_win) { +@@ -1176,6 +1189,7 @@ if (is_win) { group("browser_dependencies") { public_deps = [ @@ -92,7 +92,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 "//build:branding_buildflags", "//build:chromeos_buildflags", "//chrome/app:shutdown_signal_handlers", -@@ -1277,12 +1291,13 @@ group("child_dependencies") { +@@ -1276,12 +1290,13 @@ group("child_dependencies") { # this is OK because all of content is linked into one library. "//content/browser", ] @@ -107,7 +107,7 @@ index 7913e9c6bd0a275543b2183761134826aa14a5c8..8b0c06a7e59f72848c980a6157fd69d6 output = "$target_gen_dir/chrome_exe_version.rc" } -@@ -1336,6 +1351,7 @@ group("resources") { +@@ -1335,6 +1350,7 @@ group("resources") { "//chrome/browser:resources", "//chrome/common:resources", "//chrome/renderer:resources", diff --git a/patches/chrome-VERSION.patch b/patches/chrome-VERSION.patch index 5c7fa6a0a2cb..d29e1f44f4ca 100644 --- a/patches/chrome-VERSION.patch +++ b/patches/chrome-VERSION.patch @@ -1,12 +1,12 @@ diff --git a/chrome/VERSION b/chrome/VERSION -index bdcbed85760245da8181fd4e93d7427320c7afdf..daf8da829397ca5166e90ec08c8d1efba27c0c45 100644 +index d401c3cf23a1cd9fe195b62e459c064dd560f09a..3aad6b7ef812917133410ee2a89168de1be6d8c0 100644 --- a/chrome/VERSION +++ b/chrome/VERSION @@ -1,4 +1,4 @@ - MAJOR=87 + MAJOR=88 -MINOR=0 --BUILD=4280 --PATCH=141 +-BUILD=4315 +-PATCH=5 +MINOR=1 +BUILD=19 +PATCH=80 diff --git a/patches/chrome-android-BUILD.gn.patch b/patches/chrome-android-BUILD.gn.patch index 0a9836debaba..8bd9470ee014 100644 --- a/patches/chrome-android-BUILD.gn.patch +++ b/patches/chrome-android-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index ee79b021ff01df61be82971d20d220d94a0355b2..fb512b14d2049ee875d14d28894c2dd7b41e71b6 100644 +index e6f1f636018d937841567678bc90c1b77e48e0ef..1ffcce76316faf5f842549828f5d42018e7dac5b 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -234,6 +234,7 @@ android_resources("chrome_app_java_resources") { +@@ -231,6 +231,7 @@ android_resources("chrome_app_java_resources") { "//third_party/android_deps:androidx_recyclerview_recyclerview_java", "//third_party/android_deps:material_design_java", ] @@ -10,7 +10,7 @@ index ee79b021ff01df61be82971d20d220d94a0355b2..fb512b14d2049ee875d14d28894c2dd7 } if (enable_vr) { -@@ -526,6 +527,7 @@ android_library("chrome_java") { +@@ -530,6 +531,7 @@ android_library("chrome_java") { ] deps += feed_deps @@ -18,7 +18,7 @@ index ee79b021ff01df61be82971d20d220d94a0355b2..fb512b14d2049ee875d14d28894c2dd7 srcjar_deps = [ ":chrome_android_java_enums_srcjar", -@@ -557,6 +559,7 @@ android_library("chrome_java") { +@@ -560,6 +562,7 @@ android_library("chrome_java") { "//components/ui_metrics:ui_metrics_enums_java", "//net:effective_connection_type_java", ] @@ -26,7 +26,7 @@ index ee79b021ff01df61be82971d20d220d94a0355b2..fb512b14d2049ee875d14d28894c2dd7 # From java_sources.gni. sources = chrome_java_sources + [ app_hooks_impl ] -@@ -677,6 +680,7 @@ group("jni_headers") { +@@ -683,6 +686,7 @@ group("jni_headers") { "//chrome/browser/webauthn/android:jni_headers", "//components/media_router/browser/android:jni_headers", ] @@ -34,7 +34,7 @@ index ee79b021ff01df61be82971d20d220d94a0355b2..fb512b14d2049ee875d14d28894c2dd7 } action("chrome_android_java_google_api_keys_srcjar") { -@@ -1763,6 +1767,7 @@ if (current_toolchain == default_toolchain) { +@@ -1799,6 +1803,7 @@ if (current_toolchain == default_toolchain) { ":${_variant}_locale_pak_assets", ":${_variant}_paks", ] diff --git a/patches/chrome-android-chrome_java_sources.gni.patch b/patches/chrome-android-chrome_java_sources.gni.patch index 6f6fae83654d..777159fb7164 100644 --- a/patches/chrome-android-chrome_java_sources.gni.patch +++ b/patches/chrome-android-chrome_java_sources.gni.patch @@ -1,9 +1,9 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni -index 5353c2b915eb5e586f3e7a0f085c1d311baf741d..50503143f0a93ee8968a59fd57eea10021e5776e 100644 +index f8040f5bf4374f5eb81bc264282fb56562b2cc80..984762215631a61efadf6b0094cfb957fbc9068b 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni -@@ -1707,3 +1707,4 @@ chrome_java_sources = [ - "java/src/org/chromium/chrome/browser/webauth/HandlerResponseCallback.java", +@@ -1682,3 +1682,4 @@ chrome_java_sources = [ + "java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorActivity.java", "java/src/org/chromium/chrome/browser/webshare/ShareServiceImplementationFactory.java", ] +chrome_java_sources -= ["java/src/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java",] diff --git a/patches/chrome-android-chrome_public_apk_tmpl.gni.patch b/patches/chrome-android-chrome_public_apk_tmpl.gni.patch index 2dd3c416e287..890f27558338 100644 --- a/patches/chrome-android-chrome_public_apk_tmpl.gni.patch +++ b/patches/chrome-android-chrome_public_apk_tmpl.gni.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni -index 44cbc2fdde8c1c0b74aa38d70df63286426c5643..f037d055863b1d900da4e85fa592670b670bfc0d 100644 +index 45b925f5df82cb1ed624ca357a49b8d044df1c6f..fd06f89a8ff95f6c96601de59a6762ac58b04bc6 100644 --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni -@@ -212,6 +212,7 @@ template("chrome_public_common_apk_or_module_tmpl") { +@@ -207,6 +207,7 @@ template("chrome_public_common_apk_or_module_tmpl") { "${_material_package}:[Ss]lider", "${_material_package}:[Tt]oolbarLayout", ] @@ -10,7 +10,7 @@ index 44cbc2fdde8c1c0b74aa38d70df63286426c5643..f037d055863b1d900da4e85fa592670b if (!_is_monochrome) { product_config_java_packages = [ "org.chromium.chrome.browser" ] -@@ -321,6 +322,7 @@ template("chrome_public_common_apk_or_module_tmpl") { +@@ -316,6 +317,7 @@ template("chrome_public_common_apk_or_module_tmpl") { if (!defined(proguard_configs)) { proguard_configs = [] } diff --git a/patches/chrome-android-expectations-lint-suppressions.xml.patch b/patches/chrome-android-expectations-lint-suppressions.xml.patch index 1dc7a3c50f10..f7c533924861 100644 --- a/patches/chrome-android-expectations-lint-suppressions.xml.patch +++ b/patches/chrome-android-expectations-lint-suppressions.xml.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/expectations/lint-suppressions.xml b/chrome/android/expectations/lint-suppressions.xml -index 203124f2932a9badc43045335a8d1140bc01e367..ee0a860dea77afdf362d5aea0a679cc3641c9642 100644 +index b7143fd76a6114e222cabdb2e298d424622cde1d..7a28c11c2be01a03cc56d5bc6c6a394d2acc1811 100644 --- a/chrome/android/expectations/lint-suppressions.xml +++ b/chrome/android/expectations/lint-suppressions.xml -@@ -366,4 +366,5 @@ Still reading? +@@ -342,4 +342,5 @@ Still reading? diff --git a/patches/chrome-android-java-AndroidManifest.xml.patch b/patches/chrome-android-java-AndroidManifest.xml.patch index 91af7f454206..f0623b209ab7 100644 --- a/patches/chrome-android-java-AndroidManifest.xml.patch +++ b/patches/chrome-android-java-AndroidManifest.xml.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml -index 4b942ff06700f6d8c6ccc1cb94878de7c7412d0d..23e10e5555a9990e5495c60a21a4a8b6055de769 100644 +index 2948f6a58cafde782ca2a7860d352ed56cf3cd20..c1cad83439f8da614abbd8c69db13e88d8d6e0ab 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml @@ -38,7 +38,9 @@ by a child template that "extends" this file. @@ -37,7 +37,7 @@ index 4b942ff06700f6d8c6ccc1cb94878de7c7412d0d..23e10e5555a9990e5495c60a21a4a8b6 -@@ -105,7 +114,9 @@ by a child template that "extends" this file. +@@ -107,7 +116,9 @@ by a child template that "extends" this file. @@ -47,7 +47,7 @@ index 4b942ff06700f6d8c6ccc1cb94878de7c7412d0d..23e10e5555a9990e5495c60a21a4a8b6 {% block extra_uses_permissions %} {% endblock %} -@@ -158,6 +169,7 @@ by a child template that "extends" this file. +@@ -160,6 +171,7 @@ by a child template that "extends" this file. org.chromium.chrome.browser.ChromeApplication {%- endif -%} {% endblock %}" @@ -55,19 +55,19 @@ index 4b942ff06700f6d8c6ccc1cb94878de7c7412d0d..23e10e5555a9990e5495c60a21a4a8b6 android:icon="@drawable/ic_launcher" android:roundIcon="@drawable/ic_launcher_round" android:label="{% block application_label %}@string/app_name{% endblock %}" -@@ -209,6 +221,7 @@ by a child template that "extends" this file. - - - -+ - {% endif %} - - -@@ -1171,6 +1184,7 @@ by a child template that "extends" this file. +@@ -1166,6 +1178,7 @@ by a child template that "extends" this file. {% endif %} + {% include "//brave/android/java/AndroidManifest.xml" %} {% block extra_application_definitions %} - + + ++ + {% endif %} + + diff --git a/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch b/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch index 129cfde05df4..248dc7eecfb5 100644 --- a/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch +++ b/patches/chrome-android-java-res-layout-custom_tabs_toolbar.xml.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/res/layout/custom_tabs_toolbar.xml b/chrome/android/java/res/layout/custom_tabs_toolbar.xml -index 1bf7d593480f8dc9dcd4574c8f5499d9a9604b13..3044833633f8268dd4309b77130ecb4132b74317 100644 +index fac032cb776a45e52839a5861d4cf0d62fd2ddae..e0c88613e85de00aa9c59c7ebbdb318e656de9de 100644 --- a/chrome/android/java/res/layout/custom_tabs_toolbar.xml +++ b/chrome/android/java/res/layout/custom_tabs_toolbar.xml -@@ -97,7 +97,7 @@ +@@ -106,7 +106,7 @@ android:gravity="center_vertical" android:orientation="horizontal" /> diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-AppHooks.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-AppHooks.java.patch index c14e7b0be524..49aa30483b4b 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-AppHooks.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-AppHooks.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java -index 51a5f2c7e7181f787a65c9b774f11d256e6701ba..05df80deecfd8ee0ffd848c8ad206d3558a3ec72 100644 +index 7463c1449dae81fc33d1518c4a95d71b16072a5b..283cb6c535f16e5914305565862a6c789f2711d2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java -@@ -76,7 +76,7 @@ public abstract class AppHooks { +@@ -77,7 +77,7 @@ public abstract class AppHooks { @CalledByNative public static AppHooks get() { diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch index 510002668d5d..458adcd782fa 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -index 266a8fc9bf03d482799ef11b568b9ffb643edc19..1141e8f0fb13203d898f17fee996cb4b02ead17f 100644 +index 827071978fd601856fd0bcbd5319e6bdb6e22f76..97d64dc1c38d14a5cbffbf3b7531bfd3dfdc2357 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -@@ -183,7 +183,7 @@ import java.util.Locale; +@@ -186,7 +186,7 @@ import java.util.Locale; * This is the main activity for ChromeMobile when not running in document mode. All the tabs * are accessible via a chrome specific tab switching UI. */ @@ -11,25 +11,16 @@ index 266a8fc9bf03d482799ef11b568b9ffb643edc19..1141e8f0fb13203d898f17fee996cb4b implements ChromeAccessibilityUtil.Observer { private static final String TAG = "ChromeTabbedActivity"; -@@ -998,7 +998,7 @@ public class ChromeTabbedActivity extends ChromeActivity( -- mTabModelProfileSupplier, mCallbackController.makeCancelable(profile -> { -+ mTabModelProfileSupplier, mCallbackController.makeCancelable((Profile profile) -> { - assert profile != null : "Unexpectedly null profile from TabModel."; - if (profile == null) return; - -@@ -1440,7 +1440,7 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -331,7 +331,7 @@ public abstract class ChromeActivity NightModeReparentingController mNightModeReparentingController; protected ChromeActivity() { diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-contextualsearch-ContextualSearchPreferenceFragment.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-contextualsearch-ContextualSearchPreferenceFragment.java.patch index ae132fae1179..b6fa5923b525 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-contextualsearch-ContextualSearchPreferenceFragment.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-contextualsearch-ContextualSearchPreferenceFragment.java.patch @@ -1,10 +1,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java -index 31cfa8aa6f5c65a31edafdde3bb3be4d28504807..34073507597b629bca655e523fd10b2c5e5d0a22 100644 +index cbf437162aa4ed102924e1f7ee6b15f5526b3426..71771cd48c7311aa3495616426e657f7bb35be72 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java -@@ -18,7 +18,7 @@ import org.chromium.components.browser_ui.settings.SettingsUtils; - /** - * Fragment to manage the Contextual Search preference and to explain to the user what it does. +@@ -19,7 +19,7 @@ import org.chromium.components.browser_ui.settings.SettingsUtils; + * Fragment to manage the Contextual Search preference in Chrome Settings, and to explain to the + * user what Contextual Search (aka Touch to Search) actually does. */ -public class ContextualSearchPreferenceFragment extends PreferenceFragmentCompat { +public class ContextualSearchPreferenceFragment extends org.chromium.chrome.browser.settings.BravePreferenceFragment { diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-homepage-settings-HomepageSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-homepage-settings-HomepageSettings.java.patch index 2b9d01707247..0b74e6ebde75 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-homepage-settings-HomepageSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-homepage-settings-HomepageSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java -index 156eea09b9e0cc894b4263826f54055184970791..b62852518ef915d435ec6712ec5c470640f87f01 100644 +index cf2c13f43b168f69f59df0b318e0a9f4fa9967c2..c3a645b8fb6a6617efaac5142f25fda519014dd5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java @@ -28,7 +28,7 @@ import org.chromium.components.url_formatter.UrlFormatter; diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-native_page-NativePageFactory.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-native_page-NativePageFactory.java.patch index 3ca2c34d7528..9474166127b2 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-native_page-NativePageFactory.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-native_page-NativePageFactory.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java -index 86ef4706aa58eacbc62b738169ef60ea69aa3bdb..be460d37eb15a43ca08689a9f4d20cac96fd320b 100644 +index b7752eedeba7baa1f1db12264fd8e05a5359c7f1..f8fe6482d9a8934f081b2a718fc7b16c1c37700c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java -@@ -90,7 +90,7 @@ public class NativePageFactory { +@@ -85,7 +85,7 @@ public class NativePageFactory { NativePageHost nativePageHost = new TabShim(tab, mActivity); if (tab.isIncognito()) return new IncognitoNewTabPage(mActivity, nativePageHost); diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationPlatformBridge.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationPlatformBridge.java.patch index 1e51b3f270e1..a41c0a52c7e2 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationPlatformBridge.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationPlatformBridge.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java -index cf9d0ae8eb8923d588c24fde4495cfa3854d6d96..471637648acf1f87dd57e6dbb0aa9f29b873b908 100644 +index ede170ca236090a9b8a54f7ba3204a1e901662a0..e8241afbd5a709cbd037225a232b882110db9e97 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java @@ -81,7 +81,7 @@ public class NotificationPlatformBridge { diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationService.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationServiceImpl.java.patch similarity index 61% rename from patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationService.java.patch rename to patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationServiceImpl.java.patch index 4c5cb073d39f..9d00201fa8d0 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationService.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-notifications-NotificationServiceImpl.java.patch @@ -1,8 +1,8 @@ -diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationService.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationService.java -index c72c14123e2e6eae4be3185a67820aa538f1d1fb..9e8cfc74b4bfbd23017efcd6e0c8c945a73904b2 100644 ---- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationService.java -+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationService.java -@@ -109,7 +109,7 @@ public class NotificationService extends IntentService { +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationServiceImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationServiceImpl.java +index ecbbe843ea298e784d9dc06b8bcbee7c0e0f0b63..6453659ca927d0abe6e00770a4728e74f2c38556 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationServiceImpl.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationServiceImpl.java +@@ -105,7 +105,7 @@ public class NotificationServiceImpl extends NotificationService.Impl { // Now that the browser process is initialized, we pass forward the call to the // NotificationPlatformBridge which will take care of delivering the appropriate events. diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-omnibox-suggestions-DropdownItemViewInfoListBuilder.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-omnibox-suggestions-DropdownItemViewInfoListBuilder.java.patch index 35f899438b23..e67aa671a45a 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-omnibox-suggestions-DropdownItemViewInfoListBuilder.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-omnibox-suggestions-DropdownItemViewInfoListBuilder.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder.java -index f67ca5ec93922f0fc10a518d5aadd270aed185c0..aa6b7102dd2d2c8d63bcfb470384b332b0eb5e09 100644 +index 1c5fdf4a3d1102ce3978c74d04496ca27ac95df0..a784a0e4ed04244df59710426ebf712535bb5c06 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilder.java -@@ -91,7 +91,7 @@ class DropdownItemViewInfoListBuilder { +@@ -92,7 +92,7 @@ class DropdownItemViewInfoListBuilder { () -> mShareDelegateSupplier == null ? null : mShareDelegateSupplier.get(); mHeaderProcessor = new HeaderProcessor(context, host, delegate); diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-password_manager-settings-PasswordSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-password_manager-settings-PasswordSettings.java.patch index 7886dd301473..cee5809cdab1 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-password_manager-settings-PasswordSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-password_manager-settings-PasswordSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java -index 58dacf01c3693c8bca33dfdb52825d53f5f1ecaa..180f30a38a0293cb756fcd6f22bef28fda72c381 100644 +index e857d81ad38bdcf73b3b75607b3d6144f1588e91..88dd035856cc0c0f060a3c1eaae4eb849f95ed63 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java @@ -58,7 +58,7 @@ import java.util.Locale; diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch index 68873d8c92f8..dd474ac99781 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java -index 12713055582e86326be472da0e2d83fd39ab02b7..e67e1ab2d5aef2290f9ade198d4863a2748adb19 100644 +index 074b32057372306486a3d4847f5083351a8dbb2e..88adea83c5ad55fd8427b7f154da97c3c71e64e3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java @@ -44,7 +44,7 @@ import org.chromium.ui.text.SpanApplier; diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-AndroidSyncSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-AndroidSyncSettings.java.patch index 2864bcc0b87d..69dffdb2518f 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-AndroidSyncSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-AndroidSyncSettings.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java -index ff9f5ccac61823d09b6f98c91e6dbc16bc035ab8..683ed920aa2440e6d40911d19aeade983eb05f62 100644 +index 21aef45434541b4650858816087c70ccd3f34e74..0e42ea8fe2edb7bb6a0352323f72d93eca3f78f9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java -@@ -74,7 +74,7 @@ public class AndroidSyncSettings { +@@ -73,7 +73,7 @@ public class AndroidSyncSettings { public static AndroidSyncSettings get() { ThreadUtils.assertOnUiThread(); if (sInstance == null) { diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch index b627a419260e..9763184e0f5b 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java -index 2838a1246cb0c8e1967d877919cc9a192e773545..c90744ccf003fdd855c1cf47d2908861e8419e81 100644 +index c437801b2a1f8d69acf5c6d9aa28478f4656027e..aefc7b706f29763af10a3a78aece2b215c0b7ddf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java @@ -26,7 +26,7 @@ import androidx.appcompat.app.AlertDialog; diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-SyncAndServicesSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-SyncAndServicesSettings.java.patch index 6453aa156a94..f3316c580276 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-SyncAndServicesSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-SyncAndServicesSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java -index 6e7dd0b39f10fd13f91fb4ddc2315961c2635aa2..ec1806a51f9ff59ffc921fafd91fda7a0a7eb3c3 100644 +index e29316630cceb054aef4ab270f3aa325dc62a075..1ae510a0255511d65d4292711aa2115c0f0af128 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java @@ -76,7 +76,7 @@ import org.chromium.ui.widget.ButtonCompat; diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarColors.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarColors.java.patch index c81b582cdafc..587862ba3aa1 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarColors.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarColors.java.patch @@ -1,9 +1,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarColors.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarColors.java -index c4fa5be5f84343008040b584597238e4ddf5f382..568d1bd438a070ac5d676fcc59e980dcb6edb2e9 100644 +index e67eefee2a8c80ae02929df776f459e3a3292366..e36691c9013ae66ce034ccb80568537d28572e0a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarColors.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarColors.java -@@ -66,6 +66,7 @@ public class ToolbarColors { - Resources res, int color, boolean isIncognito) { +@@ -61,6 +61,7 @@ public class ToolbarColors { + Resources res, @ColorInt int color, boolean isIncognito) { // Text box color on default toolbar background in incognito mode is a pre-defined // color. We calculate the equivalent opaque color from the pre-defined translucent color. + if (isIncognito) {return ApiCompatibilityUtils.getColor(res, R.color.toolbar_text_box_background_incognito);} diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarManager.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarManager.java.patch index d770a6bce867..22ad8de936a1 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarManager.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-ToolbarManager.java.patch @@ -1,31 +1,30 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java -index cdeb6d2ebb3d550265e00ac74a3455da20c590a7..47df8bb6927003fb6fd5e66646360b22c7ca15de 100644 +index ec684d7d473d0c8d96acbacdb25ec0b349361f3a..3cfa37bd82493689b7cbfdb1de6d7f6eb918aa9d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java -@@ -308,7 +308,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve +@@ -379,14 +379,14 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve ThemeColorProvider overviewModeThemeColorProvider = mAppThemeColorProvider; - ToolbarLayout toolbarLayout = mActivity.findViewById(R.id.toolbar); + Runnable requestFocusRunnable = compositorViewHolder::requestFocus; - mMenuButtonCoordinator = new MenuButtonCoordinator(appMenuCoordinatorSupplier, + mMenuButtonCoordinator = new org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator(appMenuCoordinatorSupplier, mControlsVisibilityDelegate, mActivity, (focus, type) -> setUrlBarFocus(focus, type), -@@ -317,7 +317,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve - mActivity.isCustomTab() ? mCustomTabThemeColorProvider - : browsingModeThemeColorProvider, + requestFocusRunnable, shouldShowUpdateBadge, isInOverviewModeSupplier, + isCustomTab ? mCustomTabThemeColorProvider : browsingModeThemeColorProvider, R.id.menu_button_wrapper); - MenuButtonCoordinator startSurfaceMenuButtonCoordinator = new MenuButtonCoordinator( + MenuButtonCoordinator startSurfaceMenuButtonCoordinator = new org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator( appMenuCoordinatorSupplier, mControlsVisibilityDelegate, mActivity, (focus, type) -> setUrlBarFocus(focus, type), -@@ -635,7 +635,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve - ThemeColorProvider browsingModeThemeColorProvider, - MenuButtonCoordinator startSurfaceMenuButtonCoordinator, Invalidator invalidator, - IdentityDiscController identityDiscController) { +@@ -735,7 +735,7 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve + IdentityDiscController identityDiscController, + OneshotSupplier startSurfaceSupplier) { + // clang-format off - TopToolbarCoordinator toolbar = new TopToolbarCoordinator(controlContainer, toolbarLayout, + TopToolbarCoordinator toolbar = new org.chromium.chrome.browser.toolbar.top.BraveTopToolbarCoordinator(controlContainer, toolbarLayout, mLocationBarModel, mToolbarTabController, new UserEducationHelper(mActivity, mHandler, TrackerFactory::getTrackerForProfile), - buttonDataProviders, mOverviewModeBehaviorSupplier, browsingModeThemeColorProvider, + buttonDataProviders, mLayoutStateProviderSupplier, browsingModeThemeColorProvider, diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-bottom-BottomControlsCoordinator.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-bottom-BottomControlsCoordinator.java.patch index da86d88ef93e..b80b0aaf18ff 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-bottom-BottomControlsCoordinator.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-bottom-BottomControlsCoordinator.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java -index 16658d24fa113947cdba81456df81af11fe3f5ba..a0a8fe960bbfdbe28a864612d427c16d3e562a17 100644 +index e3b12ac8f13bc16a55b244d25075bb944ff7de6d..9be68e7dc5641bc5bbec56e3fc4c76b050d42a9f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator.java -@@ -103,7 +103,7 @@ public class BottomControlsCoordinator { +@@ -98,7 +98,7 @@ public class BottomControlsCoordinator { View container = root.findViewById(R.id.bottom_container_slot); ViewGroup.LayoutParams params = container.getLayoutParams(); params.height = root.getResources().getDimensionPixelOffset(bottomControlsHeightId); diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch index a779b39799e6..c1a44d38c4f5 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarPhone.java.patch @@ -1,17 +1,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java -index 240092291ede662693256ef3560607659a149b2c..d6df81377fb628f05fc0fbfcf2338214ed2401ba 100644 +index 9170c4523a4208a074e8530393b53854dbed672b..fdbec35de197cbfd4ebd5daa2f907ad601409273 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarPhone.java -@@ -88,7 +88,7 @@ import java.util.List; +@@ -86,7 +86,7 @@ import java.util.List; /** * Phone specific toolbar implementation. */ --public class ToolbarPhone extends ToolbarLayout -+public class ToolbarPhone extends BraveToolbarLayout - implements OnClickListener, NewTabPage.OnSearchBoxScrollListener, TabCountObserver { +-public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabCountObserver { ++public class ToolbarPhone extends BraveToolbarLayout implements OnClickListener, TabCountObserver { /** The amount of time transitioning from one theme color to another should take in ms. */ public static final long THEME_COLOR_TRANSITION_DURATION = 250; -@@ -409,10 +409,12 @@ public class ToolbarPhone extends ToolbarLayout + +@@ -399,10 +399,12 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC /** * Set the background color of the location bar to appropriately match the theme color. */ @@ -25,7 +25,7 @@ index 240092291ede662693256ef3560607659a149b2c..d6df81377fb628f05fc0fbfcf2338214 } /** -@@ -529,6 +531,7 @@ public class ToolbarPhone extends ToolbarLayout +@@ -512,6 +514,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC EventConstants.PARTNER_HOME_PAGE_BUTTON_PRESSED); } } @@ -33,7 +33,7 @@ index 240092291ede662693256ef3560607659a149b2c..d6df81377fb628f05fc0fbfcf2338214 } @Override -@@ -697,7 +700,7 @@ public class ToolbarPhone extends ToolbarLayout +@@ -681,7 +684,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC * @return The right bounds of the location bar after accounting for any visible left buttons. */ private int getBoundsAfterAccountingForRightButtons() { @@ -42,11 +42,11 @@ index 240092291ede662693256ef3560607659a149b2c..d6df81377fb628f05fc0fbfcf2338214 } private void updateToolbarBackground(int color) { -@@ -2131,6 +2134,7 @@ public class ToolbarPhone extends ToolbarLayout +@@ -2087,6 +2090,7 @@ public class ToolbarPhone extends ToolbarLayout implements OnClickListener, TabC } else { populateUrlClearFocusingAnimatorSet(animators); } -+ populateUrlAnimatorSet(hasFocus, URL_FOCUS_TOOLBAR_BUTTONS_DURATION_MS, URL_CLEAR_FOCUS_TABSTACK_DELAY_MS, URL_FOCUS_TOOLBAR_BUTTONS_TRANSLATION_X_DP, animators); ++ populateUrlAnimatorSet(hasFocus, URL_FOCUS_TOOLBAR_BUTTONS_DURATION_MS, URL_CLEAR_FOCUS_TABSTACK_DELAY_MS, animators); mUrlFocusLayoutAnimator = new AnimatorSet(); mUrlFocusLayoutAnimator.playTogether(animators); diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch index 439874d0b046..4cbf19723417 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-toolbar-top-ToolbarTablet.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java -index 5391fe73ac8f0ae90ac427fe04a4b64a6a5324fe..571a80a03fb674e9055412d75d1b45c0261efa4d 100644 +index 5b7700ea85a2a8985d48372e0915b5a6a06aba54..58fe1ec90f1ec227bb2e2234527075f70dfb038a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarTablet.java -@@ -59,7 +59,7 @@ import java.util.Collection; +@@ -58,7 +58,7 @@ import java.util.Collection; * The Toolbar object for Tablet screens. */ @SuppressLint("Instantiatable") @@ -11,7 +11,7 @@ index 5391fe73ac8f0ae90ac427fe04a4b64a6a5324fe..571a80a03fb674e9055412d75d1b45c0 implements OnClickListener, View.OnLongClickListener, TabCountObserver { // The number of toolbar buttons that can be hidden at small widths (reload, back, forward). public static final int HIDEABLE_BUTTON_COUNT = 3; -@@ -326,10 +326,12 @@ public class ToolbarTablet extends ToolbarLayout +@@ -316,10 +316,12 @@ public class ToolbarTablet extends ToolbarLayout DownloadUtils.downloadOfflinePage(getContext(), getToolbarDataProvider().getTab()); RecordUserAction.record("MobileToolbarDownloadPage"); } @@ -24,8 +24,8 @@ index 5391fe73ac8f0ae90ac427fe04a4b64a6a5324fe..571a80a03fb674e9055412d75d1b45c0 String description = null; Context context = getContext(); Resources resources = context.getResources(); -@@ -394,6 +396,7 @@ public class ToolbarTablet extends ToolbarLayout - mLocationBar.getBackground().setColorFilter(textBoxColor, PorterDuff.Mode.SRC_IN); +@@ -385,6 +387,7 @@ public class ToolbarTablet extends ToolbarLayout + textBoxColor, PorterDuff.Mode.SRC_IN); mLocationBar.updateVisualsForState(); + super.onThemeColorChanged(color, shouldAnimate); diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-tracing-settings-DeveloperSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-tracing-settings-DeveloperSettings.java.patch index a32bb6868221..3be75f02e66a 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-tracing-settings-DeveloperSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-tracing-settings-DeveloperSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java -index e07a8f2febf6bf643d18ed0e4db5ef51eb307e56..ad81c00746c9ef16c7d2271e0fd905e9307ec4ab 100644 +index 1f9156c7fb11dc2d00ab73a1d1f6adeadf153bbf..2570765032177a756128d7e342e0450f1d37dd21 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tracing/settings/DeveloperSettings.java @@ -20,7 +20,7 @@ import org.chromium.components.version_info.VersionConstants; diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-ui-RootUiCoordinator.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-ui-RootUiCoordinator.java.patch index 2ff9eed2c2b5..17c8e9a3d528 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-ui-RootUiCoordinator.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-ui-RootUiCoordinator.java.patch @@ -1,13 +1,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java -index ff49f8f2fc9e3f0a0a91126048e0e0c5cd901ea3..c1560a4390df3d816d549cbe25c05cb81f80ea53 100644 +index c14b33ba342b6875d87c790e491939b3355919b4..9bf5df2aa6b318bcf1cf7e574bda781aaa269d74 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java -@@ -528,7 +528,7 @@ public class RootUiCoordinator - mActivityTabProvider, mShareDelegateSupplier, new ShareUtils(), - mActivity.getLifecycleDispatcher(), mActivity.getModalDialogManager()); +@@ -566,7 +566,7 @@ public class RootUiCoordinator + mActivity.getLifecycleDispatcher(), mActivity.getModalDialogManager(), + () -> mToolbarManager.setUrlBarFocus(false, OmniboxFocusReason.UNFOCUS)); mButtonDataProviders = Arrays.asList(mIdentityDiscController, shareButtonController); - mToolbarManager = new ToolbarManager(mActivity, mActivity.getBrowserControlsManager(), + mToolbarManager = new org.chromium.chrome.browser.toolbar.BraveToolbarManager(mActivity, mActivity.getBrowserControlsManager(), mActivity.getFullscreenManager(), toolbarContainer, - mActivity.getCompositorViewHolder().getInvalidator(), urlFocusChangedCallback, + mActivity.getCompositorViewHolder(), urlFocusChangedCallback, mTabThemeColorProvider, mTabObscuringHandler, mShareDelegateSupplier, diff --git a/patches/chrome-android-java_sources.gni.patch b/patches/chrome-android-java_sources.gni.patch index 64db0d569309..4b8c0d223546 100644 --- a/patches/chrome-android-java_sources.gni.patch +++ b/patches/chrome-android-java_sources.gni.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni -index 2dcef8bd76e082f8c011601e6017f38c3eddfeed..b7e31de137a56b379563c3874dc7b4c6b8dc2ae4 100644 +index 833d23595023dce83803b429367eaf65b3c16a64..d6ae470f4b8a577f5eb3aa6853eb5838cbbe76c5 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni @@ -20,6 +20,7 @@ import("//components/offline_pages/buildflags/features.gni") diff --git a/patches/chrome-browser-BUILD.gn.patch b/patches/chrome-browser-BUILD.gn.patch index 36b5169ecd13..160fbb7716ba 100644 --- a/patches/chrome-browser-BUILD.gn.patch +++ b/patches/chrome-browser-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 62ddc2d8548bcac4d55bbc7283426c426fecf254..c450d8e6e0a761a38d5d1c132885034559a1ed31 100644 +index 535d65e656797dcb397e944d7d1ca5102ad5f9c6..93723bb09b79a6b58f4675f9a760fa3c55973ee0 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -2360,6 +2360,7 @@ static_library("browser") { +@@ -2385,6 +2385,7 @@ static_library("browser") { "performance_monitor/metric_evaluator_helper_posix.h", ] } diff --git a/patches/chrome-browser-about_flags.cc.patch b/patches/chrome-browser-about_flags.cc.patch index 1adb62257c3d..f3a49f0893e8 100644 --- a/patches/chrome-browser-about_flags.cc.patch +++ b/patches/chrome-browser-about_flags.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index 592ae87905215388106c3d8aca1a55e07da43ba4..388411a8387196e8aa8808c31d93cbea9eaabb88 100644 +index 4747a7d3424672f8cc79debf00a5633ed8eba044..76cb61eaa3c4716eb2cdd2322ddd1ff371034384 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -294,14 +294,14 @@ const FeatureEntry::Choice kTouchTextSelectionStrategyChoices[] = { +@@ -297,14 +297,14 @@ const FeatureEntry::Choice kTouchTextSelectionStrategyChoices[] = { const FeatureEntry::Choice kTraceUploadURL[] = { {flags_ui::kGenericExperimentChoiceDisabled, "", ""}, {flag_descriptions::kTraceUploadUrlChoiceOther, switches::kTraceUploadURL, @@ -21,7 +21,7 @@ index 592ae87905215388106c3d8aca1a55e07da43ba4..388411a8387196e8aa8808c31d93cbea const FeatureEntry::Choice kPassiveListenersChoices[] = { {flags_ui::kGenericExperimentChoiceDefault, "", ""}, -@@ -6752,6 +6752,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -6682,6 +6682,7 @@ const FeatureEntry kFeatureEntries[] = { // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the // AboutFlagsHistogramTest unit test to verify this process). diff --git a/patches/chrome-browser-android-browsing_data-browsing_data_bridge.cc.patch b/patches/chrome-browser-android-browsing_data-browsing_data_bridge.cc.patch index aebfb97e727d..81d6d52059e8 100644 --- a/patches/chrome-browser-android-browsing_data-browsing_data_bridge.cc.patch +++ b/patches/chrome-browser-android-browsing_data-browsing_data_bridge.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/android/browsing_data/browsing_data_bridge.cc b/chrome/browser/android/browsing_data/browsing_data_bridge.cc -index 6446838d89a7f2d42ef4b611a3a6a068c8a0168b..f5e80d26a8b8f44ece961896be120af7235489f8 100644 +index 191b7d79c1aa091cdad6c87f9ea12d3937dd0567..cf76f9507874a2438d3c4debce9485f9c3c1f627 100644 --- a/chrome/browser/android/browsing_data/browsing_data_bridge.cc +++ b/chrome/browser/android/browsing_data/browsing_data_bridge.cc -@@ -126,6 +126,7 @@ static void JNI_BrowsingDataBridge_ClearBrowsingData( +@@ -125,6 +125,7 @@ static void JNI_BrowsingDataBridge_ClearBrowsingData( ChromeBrowsingDataRemoverDelegate::DATA_TYPE_CONTENT_SETTINGS; break; case browsing_data::BrowsingDataType::DOWNLOADS: diff --git a/patches/chrome-browser-browser_process_impl.h.patch b/patches/chrome-browser-browser_process_impl.h.patch index 202bb5e5d97e..e5aa5c11f295 100644 --- a/patches/chrome-browser-browser_process_impl.h.patch +++ b/patches/chrome-browser-browser_process_impl.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h -index 7cc470fe599d4c462cabad81fb205c63ee84ad77..ed7453e1519bbfe65fe6b5d3ffce1e60842743b3 100644 +index e63afefc769d6ea3657eafa3013bfa851393a239..01f8c54a4442fcb421646fc68f0e30de298026ba 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h -@@ -204,6 +204,7 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -203,6 +203,7 @@ class BrowserProcessImpl : public BrowserProcess, static void RegisterPrefs(PrefRegistrySimple* registry); private: diff --git a/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate_factory.cc.patch b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate_factory.cc.patch index 8ceca8d2baaa..e5bec587c387 100644 --- a/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate_factory.cc.patch +++ b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate_factory.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc -index eaf6e97877dfa1f8c0a2e477913b6efdee80cecd..5f224da9b0038a13d160c5e9da8b6e9ae3ea820e 100644 +index 821b1f25c7387d8fd7fabd030fd905e9af39f813..8bf5455090728fceeb29f3440708909e1c7fec3f 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc @@ -108,5 +108,5 @@ ChromeBrowsingDataRemoverDelegateFactory::GetBrowserContextToUse( diff --git a/patches/chrome-browser-chrome_content_browser_client.h.patch b/patches/chrome-browser-chrome_content_browser_client.h.patch index 9f23e5ce096f..3fcf45270bfd 100644 --- a/patches/chrome-browser-chrome_content_browser_client.h.patch +++ b/patches/chrome-browser-chrome_content_browser_client.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h -index 457d9eee22f05a9b5009edcfcfb9d1baed58c442..73ee495feb9277337098c9a1021301a573062ce7 100644 +index fb5ec1857ec97a887562420e284cb99e63e61e8f..97f39d0d4847a89df6af52226f430b62ec7cc203 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -722,6 +722,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { diff --git a/patches/chrome-browser-devtools-devtools_ui_bindings.h.patch b/patches/chrome-browser-devtools-devtools_ui_bindings.h.patch index 574c29cce5ff..dc5c028c052f 100644 --- a/patches/chrome-browser-devtools-devtools_ui_bindings.h.patch +++ b/patches/chrome-browser-devtools-devtools_ui_bindings.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/devtools/devtools_ui_bindings.h b/chrome/browser/devtools/devtools_ui_bindings.h -index c4318ae485f179eb00488c485775a34419ce7151..ba520dee1194afa0341fe2efd9d4010383045d85 100644 +index 4e88b807c34eae82b4b6f86c39ccd8a3a9863f2c..8f975f349b465c52a832ee42b8237bad923e9d4b 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.h +++ b/chrome/browser/devtools/devtools_ui_bindings.h @@ -93,6 +93,9 @@ class DevToolsUIBindings : public DevToolsEmbedderMessageDispatcher::Delegate, diff --git a/patches/chrome-browser-extensions-BUILD.gn.patch b/patches/chrome-browser-extensions-BUILD.gn.patch index 4e415c2bb776..36d78a51cf56 100644 --- a/patches/chrome-browser-extensions-BUILD.gn.patch +++ b/patches/chrome-browser-extensions-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn -index 18315b380b68b6e77717f3233daa4f40fdbf50f0..ccc716a1357a2f8dd499bb2fa4bfb4d07139d7f2 100644 +index 142b6699f13a779c783d93a25f1c5e3452183a83..a3f199a67c6e026865903f80a403b8394a68787f 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn -@@ -1257,6 +1257,7 @@ static_library("extensions") { +@@ -1266,6 +1266,7 @@ static_library("extensions") { } else { sources += [ "api/braille_display_private/braille_controller_stub.cc" ] } diff --git a/patches/chrome-browser-extensions-api-webrtc_logging_private-webrtc_logging_private_api.cc.patch b/patches/chrome-browser-extensions-api-webrtc_logging_private-webrtc_logging_private_api.cc.patch index b63131f775b2..89ff077c060d 100644 --- a/patches/chrome-browser-extensions-api-webrtc_logging_private-webrtc_logging_private_api.cc.patch +++ b/patches/chrome-browser-extensions-api-webrtc_logging_private-webrtc_logging_private_api.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc -index 3087660c85cedbc711317ac69df1ca1dd6ca96f4..31ea603cdfaea000736fa915f54bd7215690f0f8 100644 +index e0a0322126230516c61972184eb0d04923e0846c..fc9be21023aed80515d1734cff7f4c5133e354e4 100644 --- a/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc +++ b/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc @@ -89,6 +89,7 @@ content::RenderProcessHost* WebrtcLoggingPrivateFunction::RphFromRequest( diff --git a/patches/chrome-browser-extensions-extension_management.cc.patch b/patches/chrome-browser-extensions-extension_management.cc.patch index 0ce8ee394e9d..0c0cc3558664 100644 --- a/patches/chrome-browser-extensions-extension_management.cc.patch +++ b/patches/chrome-browser-extensions-extension_management.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc -index 518c3927ae085bac2a70dcc6635266fa6972f0d6..369f70aaa709efac43bcf6f800eda1f63c194848 100644 +index aecef847f26608a9a3f18a5479621a88c2c41465..545d662b5764fd0934f843add4a0a3d19f91f9ee 100644 --- a/chrome/browser/extensions/extension_management.cc +++ b/chrome/browser/extensions/extension_management.cc @@ -17,6 +17,7 @@ @@ -10,7 +10,7 @@ index 518c3927ae085bac2a70dcc6635266fa6972f0d6..369f70aaa709efac43bcf6f800eda1f6 #include "chrome/browser/extensions/extension_management_constants.h" #include "chrome/browser/extensions/extension_management_internal.h" #include "chrome/browser/extensions/external_policy_loader.h" -@@ -676,7 +677,7 @@ KeyedService* ExtensionManagementFactory::BuildServiceInstanceFor( +@@ -689,7 +690,7 @@ KeyedService* ExtensionManagementFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { TRACE_EVENT0("browser,startup", "ExtensionManagementFactory::BuildServiceInstanceFor"); diff --git a/patches/chrome-browser-extensions-extension_management.h.patch b/patches/chrome-browser-extensions-extension_management.h.patch index a8536c044aeb..4bfc3ff64660 100644 --- a/patches/chrome-browser-extensions-extension_management.h.patch +++ b/patches/chrome-browser-extensions-extension_management.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/extensions/extension_management.h b/chrome/browser/extensions/extension_management.h -index 53e7ae9056f2b6458836e274a74b5d7338900f0e..e07d64b193c222c51d4d77fe5207ee4dafe38a04 100644 +index 8bd180cf9672c1dbec4742cda1c697da063d94b4..906060cb5c4e59fbc88e99ee4efb2edcc9d597ec 100644 --- a/chrome/browser/extensions/extension_management.h +++ b/chrome/browser/extensions/extension_management.h -@@ -198,6 +198,7 @@ class ExtensionManagement : public KeyedService { +@@ -214,6 +214,7 @@ class ExtensionManagement : public KeyedService { bool is_child() const { return is_child_; } private: diff --git a/patches/chrome-browser-extensions-extension_tab_util.cc.patch b/patches/chrome-browser-extensions-extension_tab_util.cc.patch index 01b421b7c7fe..377039f737a3 100644 --- a/patches/chrome-browser-extensions-extension_tab_util.cc.patch +++ b/patches/chrome-browser-extensions-extension_tab_util.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc -index aaac6830f2da4b5b58dc5a2bf9ffada09647e44a..56dfe2a965da5f1096df22357121e685e066d2d1 100644 +index 4260e615cf9bc4bcc0fbabfc8a5fb5b236b8bd0f..99a3ebb76e9cdae8bde9b03d5dcb2aee19fb8b2f 100644 --- a/chrome/browser/extensions/extension_tab_util.cc +++ b/chrome/browser/extensions/extension_tab_util.cc -@@ -766,6 +766,7 @@ bool ExtensionTabUtil::IsKillURL(const GURL& url) { +@@ -779,6 +779,7 @@ bool ExtensionTabUtil::IsKillURL(const GURL& url) { GURL fixed_url = url_formatter::FixupURL(url.possibly_invalid_spec(), std::string()); if (!fixed_url.SchemeIs(content::kChromeUIScheme)) diff --git a/patches/chrome-browser-flags-android-chrome_feature_list.cc.patch b/patches/chrome-browser-flags-android-chrome_feature_list.cc.patch index 0ef9bf344745..a8f32578690e 100644 --- a/patches/chrome-browser-flags-android-chrome_feature_list.cc.patch +++ b/patches/chrome-browser-flags-android-chrome_feature_list.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc -index 159823b3dffc8f5f1d3aa8f97c4f73b7c43c7933..623c8e7a9d49833f0dc4c605741d76dabb95ed07 100644 +index e0482c79a4f176381376285e8b93c3c5abc65db3..e063a10394852b0c9cbb2acce0772ecf2b97b51e 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc -@@ -271,6 +271,7 @@ const base::Feature* kFeaturesExposedToJava[] = { +@@ -276,6 +276,7 @@ const base::Feature* kFeaturesExposedToJava[] = { }; const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) { diff --git a/patches/chrome-browser-importer-external_process_importer_client.h.patch b/patches/chrome-browser-importer-external_process_importer_client.h.patch index 6895d347e90f..b54b540894e5 100644 --- a/patches/chrome-browser-importer-external_process_importer_client.h.patch +++ b/patches/chrome-browser-importer-external_process_importer_client.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/importer/external_process_importer_client.h b/chrome/browser/importer/external_process_importer_client.h -index e5f3b315b6f810ad4b334debb01a4da86567dc21..5f0f8ca4cb51019577d8e67f872b5ba20b5bbf26 100644 +index 4fbe0f4f068b138cf6f57e61f524f906e10db001..15d0315a248354ccd3957f138c7d8aba8570dc1a 100644 --- a/chrome/browser/importer/external_process_importer_client.h +++ b/chrome/browser/importer/external_process_importer_client.h -@@ -85,6 +85,7 @@ class ExternalProcessImporterClient +@@ -83,6 +83,7 @@ class ExternalProcessImporterClient const std::vector& autofill_form_data_entry_group) override; diff --git a/patches/chrome-browser-importer-in_process_importer_bridge.cc.patch b/patches/chrome-browser-importer-in_process_importer_bridge.cc.patch index 9a262d00c8b4..e719a111627f 100644 --- a/patches/chrome-browser-importer-in_process_importer_bridge.cc.patch +++ b/patches/chrome-browser-importer-in_process_importer_bridge.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/importer/in_process_importer_bridge.cc b/chrome/browser/importer/in_process_importer_bridge.cc -index 7e0563333c36b7b6a575625255f6f548ac2cceaa..fe2c67994f5f9691b61d3048a7974c133019d1dc 100644 +index 3b58b4c049952911e9bf5ade185159c850726e00..89c1070a584b8ccd74f5c824c0a7cf909b520273 100644 --- a/chrome/browser/importer/in_process_importer_bridge.cc +++ b/chrome/browser/importer/in_process_importer_bridge.cc @@ -54,6 +54,8 @@ history::VisitSource ConvertImporterVisitSourceToHistoryVisitSource( diff --git a/patches/chrome-browser-importer-in_process_importer_bridge.h.patch b/patches/chrome-browser-importer-in_process_importer_bridge.h.patch index e9e96c9f5c14..13f8a3d3cd76 100644 --- a/patches/chrome-browser-importer-in_process_importer_bridge.h.patch +++ b/patches/chrome-browser-importer-in_process_importer_bridge.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/importer/in_process_importer_bridge.h b/chrome/browser/importer/in_process_importer_bridge.h -index d329ecc264edb68c3a479d621fd3d23733ee1038..cbd5b630f18986d4385b25ef23d1d0e83472c1ba 100644 +index 54dfb87d9f773fc50199f915e79667474f8633bb..ff57982e72acb80e93e65ef271413a5d64fd8a2d 100644 --- a/chrome/browser/importer/in_process_importer_bridge.h +++ b/chrome/browser/importer/in_process_importer_bridge.h @@ -56,6 +56,7 @@ class InProcessImporterBridge : public ImporterBridge { diff --git a/patches/chrome-browser-importer-profile_writer.h.patch b/patches/chrome-browser-importer-profile_writer.h.patch index 404a669856ed..cc4bc0b776ea 100644 --- a/patches/chrome-browser-importer-profile_writer.h.patch +++ b/patches/chrome-browser-importer-profile_writer.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/importer/profile_writer.h b/chrome/browser/importer/profile_writer.h -index f4d0fe0af3a81d9f73bc410b8db4914cfff0dbf9..f85b83e1ee77c8ac2f05fb3ded7e1f9473b442dd 100644 +index 0dc12ebe1827a712df1121dd8e5ba453f87c47fd..da7d5d9577e717c13e85af776a8d9d567de5c714 100644 --- a/chrome/browser/importer/profile_writer.h +++ b/chrome/browser/importer/profile_writer.h -@@ -84,6 +84,7 @@ class ProfileWriter : public base::RefCountedThreadSafe { +@@ -87,6 +87,7 @@ class ProfileWriter : public base::RefCountedThreadSafe { virtual void AddAutofillFormDataEntries( const std::vector& autofill_entries); diff --git a/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch b/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch index ffbc900bd786..2060da4b239b 100644 --- a/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch +++ b/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -index bd9dda865eaae624a665e2423013934ed4925771..e0cfa7dc44effca943d9d7530980be27d97e4471 100644 +index 88b66b45cee0a4a7184426cbacae8c83424e9856..96474bc77b5ed8a63143acdb39d966f47f126939 100644 --- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc +++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc @@ -441,6 +441,7 @@ std::string WebRtcLogUploader::CompressLog(WebRtcLogBuffer* buffer) { diff --git a/patches/chrome-browser-net-system_network_context_manager.cc.patch b/patches/chrome-browser-net-system_network_context_manager.cc.patch index 748b923b63a8..73ba681580b2 100644 --- a/patches/chrome-browser-net-system_network_context_manager.cc.patch +++ b/patches/chrome-browser-net-system_network_context_manager.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc -index c53056f7a4ba5a5df21a10facb53c8c81745d5bf..75078d8540264201c330a355927c352bbecef6d7 100644 +index 7f58187215cb94be47e38f6be9de32012332d9fd..72d0d7bd243e3fa373f00396d5af8843551aa5cc 100644 --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc @@ -218,7 +218,7 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem diff --git a/patches/chrome-browser-prefs-browser_prefs.cc.patch b/patches/chrome-browser-prefs-browser_prefs.cc.patch index 0c9bca9df100..088810972f8b 100644 --- a/patches/chrome-browser-prefs-browser_prefs.cc.patch +++ b/patches/chrome-browser-prefs-browser_prefs.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index 04e00fcda68dd94d210a6b92f8d8bdfa5245336d..f6b00ab8c8fc84c2e2ef28435e6afa9ec494ced8 100644 +index 9c81ffe93ae903e045c07b578c89083b6675a935..418ade6c5662779666b78290556d4d233ff87b22 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -731,6 +731,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -742,6 +742,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { #if defined(TOOLKIT_VIEWS) RegisterBrowserViewLocalPrefs(registry); #endif @@ -10,7 +10,7 @@ index 04e00fcda68dd94d210a6b92f8d8bdfa5245336d..f6b00ab8c8fc84c2e2ef28435e6afa9e // This is intentionally last. RegisterLocalStatePrefsForMigration(registry); -@@ -995,6 +996,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1008,6 +1009,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, #endif RegisterProfilePrefsForMigration(registry); diff --git a/patches/chrome-browser-profiles-profile.cc.patch b/patches/chrome-browser-profiles-profile.cc.patch index 9a703d9e0314..55aac863d087 100644 --- a/patches/chrome-browser-profiles-profile.cc.patch +++ b/patches/chrome-browser-profiles-profile.cc.patch @@ -1,16 +1,16 @@ diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc -index ca36c316828f3d5ab3fb511d73cb975a86286c5e..3e9139cf7b9986aeb9ff6089457784972c98330e 100644 +index 039035dce20878b29523ad7ebce2bf189eadfa0c..c08083fd5cef809ddff0e97f7c87df4c5a00b48d 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc -@@ -127,6 +127,7 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { - // Non-Primary OTR profiles are not supposed to create Browser windows. - // DevTools::BrowserContext is an exception to this ban. +@@ -131,6 +131,7 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { + // DevTools::BrowserContext and MediaRouter::Presentation are an + // exception to this ban. return *this == PrimaryID() || + BRAVE_ALLOWS_BROWSER_WINDOWS base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix, - base::CompareCase::SENSITIVE); - } -@@ -266,7 +267,7 @@ const char Profile::kProfileKey[] = "__PROFILE__"; + base::CompareCase::SENSITIVE) || + base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, +@@ -277,7 +278,7 @@ const char Profile::kProfileKey[] = "__PROFILE__"; void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterBooleanPref( prefs::kSearchSuggestEnabled, diff --git a/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch b/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch index 55094732ba08..33dbbd2e3744 100644 --- a/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch +++ b/patches/chrome-browser-profiles-profile_avatar_icon_util.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/profiles/profile_avatar_icon_util.cc b/chrome/browser/profiles/profile_avatar_icon_util.cc -index 27c667218f2545d0f84c65d02ace31f4e68a3d3b..2b812f8fcc52152f16b95349e14ff5ed69fb2eb1 100644 +index d2214a75fdf2045c471386ac1b43385100c671a9..174601e2a0346452cd983942f21680fcf3a4e71f 100644 --- a/chrome/browser/profiles/profile_avatar_icon_util.cc +++ b/chrome/browser/profiles/profile_avatar_icon_util.cc -@@ -333,7 +333,7 @@ constexpr size_t kDefaultAvatarIconsCount = 1; +@@ -335,7 +335,7 @@ constexpr size_t kDefaultAvatarIconsCount = 1; #elif defined(OS_CHROMEOS) constexpr size_t kDefaultAvatarIconsCount = 27; #else @@ -11,7 +11,7 @@ index 27c667218f2545d0f84c65d02ace31f4e68a3d3b..2b812f8fcc52152f16b95349e14ff5ed #endif #if !defined(OS_ANDROID) -@@ -463,6 +463,7 @@ size_t GetPlaceholderAvatarIndex() { +@@ -470,6 +470,7 @@ size_t GetPlaceholderAvatarIndex() { size_t GetModernAvatarIconStartIndex() { #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) @@ -19,7 +19,7 @@ index 27c667218f2545d0f84c65d02ace31f4e68a3d3b..2b812f8fcc52152f16b95349e14ff5ed return GetPlaceholderAvatarIndex() + 1; #else // Only use the placeholder avatar on ChromeOS and Android. -@@ -496,6 +497,7 @@ std::string GetPlaceholderAvatarIconUrl() { +@@ -503,6 +504,7 @@ std::string GetPlaceholderAvatarIconUrl() { const IconResourceInfo* GetDefaultAvatarIconResourceInfo(size_t index) { CHECK_LT(index, kDefaultAvatarIconsCount); diff --git a/patches/chrome-browser-profiles-profile_impl.cc.patch b/patches/chrome-browser-profiles-profile_impl.cc.patch index 4b3b55c51d63..7372e4e2bbec 100644 --- a/patches/chrome-browser-profiles-profile_impl.cc.patch +++ b/patches/chrome-browser-profiles-profile_impl.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc -index 55d2bd854a6f0441ccf1b5bdfd1ad0b16c667c83..573ac77f82e4037ae589b943e4403db22819708d 100644 +index 1c6cb0b66b46a958ad57f3f8c31ad225558d5c71..9ad82d26e2760cb0e06d95fedaed9c4f26986b49 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -356,7 +356,7 @@ std::unique_ptr Profile::CreateProfile(const base::FilePath& path, diff --git a/patches/chrome-browser-profiles-profile_io_data.cc.patch b/patches/chrome-browser-profiles-profile_io_data.cc.patch index 3e7450267662..4be5e1990aae 100644 --- a/patches/chrome-browser-profiles-profile_io_data.cc.patch +++ b/patches/chrome-browser-profiles-profile_io_data.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc -index de38b5ff34b49d6e988a203b3ef8457107048bae..b19031be77d08516784deb4f0fc056dbea1fdfa2 100644 +index 7c91474fa32ce1780b2a9ceb8924a848a01187e1..0ecefb79f1c19fea87457b30323aec6cd21d4d8d 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc -@@ -302,6 +302,9 @@ bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { +@@ -255,6 +255,9 @@ bool ProfileIOData::IsHandledProtocol(const std::string& scheme) { #endif content::kChromeUIScheme, content::kChromeUIUntrustedScheme, diff --git a/patches/chrome-browser-profiles-profile_manager.h.patch b/patches/chrome-browser-profiles-profile_manager.h.patch index 9dbea13c2596..eb04edaa373b 100644 --- a/patches/chrome-browser-profiles-profile_manager.h.patch +++ b/patches/chrome-browser-profiles-profile_manager.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/profiles/profile_manager.h b/chrome/browser/profiles/profile_manager.h -index 8d0793739a72cb0dcdb2f8a26b9ad4487e465e74..6ba3dd73fb870d68bb2907f7546c12c0f5db8c43 100644 +index ccbe94c5b66bad32d208889e14526a7e7d2e4a8d..468d51f36c9db8d9bed11aaeeccce30281573372 100644 --- a/chrome/browser/profiles/profile_manager.h +++ b/chrome/browser/profiles/profile_manager.h -@@ -268,6 +268,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -279,6 +279,7 @@ class ProfileManager : public content::NotificationObserver, void set_do_final_services_init(bool do_final_services_init) { do_final_services_init_ = do_final_services_init; } diff --git a/patches/chrome-browser-profiles-profile_shortcut_manager_win.cc.patch b/patches/chrome-browser-profiles-profile_shortcut_manager_win.cc.patch index d78e07ae7db8..a6ac8c4e572d 100644 --- a/patches/chrome-browser-profiles-profile_shortcut_manager_win.cc.patch +++ b/patches/chrome-browser-profiles-profile_shortcut_manager_win.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc -index 8aed937abc6ba6f95d6e0eeab7ea15554a92f329..2f0590cd09f66e2f7bf1b73ed8179aec1c448a7f 100644 +index 031d8e9071991ed99d2cd161a650705fd050003a..2483c2b4b4e932aca11bfbcec9228ed1e198f914 100644 --- a/chrome/browser/profiles/profile_shortcut_manager_win.cc +++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc @@ -744,7 +744,7 @@ bool ProfileShortcutManager::IsFeatureEnabled() { diff --git a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch index 0dadfe7b4c3f..ec9638933e3b 100644 --- a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch +++ b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc -index ae82444496c1049881503e498944c3db3ca61d69..57f9a54e2d2695a9ccbab47a436d0968920438fe 100644 +index 6043ab9230474f36fb901ddfeee456615ed30183..d6651c5f599d814ea9ee93df239c1e13f4a389b2 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -1629,6 +1629,7 @@ void RenderViewContextMenu::AppendSearchProvider() { +@@ -1631,6 +1631,7 @@ void RenderViewContextMenu::AppendSearchProvider() { selection_navigation_url_ = match.destination_url; if (!selection_navigation_url_.is_valid()) return; diff --git a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch index 52aead087e8c..273f423e7825 100644 --- a/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch +++ b/patches/chrome-browser-renderer_context_menu-render_view_context_menu.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.h b/chrome/browser/renderer_context_menu/render_view_context_menu.h -index cd477e3ba1b44eb27bf0b94b89d26915d9603386..1030c1de5cb6d89d33b831cc7426efabc92f3124 100644 +index ebe6e6b01df094f9c336b56b0fe64308635da9cd..3d76939b5e2b7f38405edecc0a154b4d26fb0771 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.h +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -120,6 +120,7 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { +@@ -116,6 +116,7 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { // Returns true if keyboard lock is active and requires the user to press and // hold escape to exit exclusive access mode. bool IsPressAndHoldEscRequiredToExitFullscreen() const; diff --git a/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch b/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch index 3e8b7863833b..bcb33e455645 100644 --- a/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch +++ b/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/bookmarks/bookmarks.html b/chrome/browser/resources/bookmarks/bookmarks.html -index 2b1fee2c9f2d054358ecb29ebb3eefb9f7142f21..cf27a210b16b54dd76292534b5910ebbf4d3176f 100644 +index fbaec388ddf82ae379e3abf66b5f4bb6069ead7b..5ff892de2f6074b1a24a099b5a3fecc186ca8593 100644 --- a/chrome/browser/resources/bookmarks/bookmarks.html +++ b/chrome/browser/resources/bookmarks/bookmarks.html -@@ -28,6 +28,7 @@ +@@ -29,6 +29,7 @@ height: var(--md-toolbar-height); } diff --git a/patches/chrome-browser-resources-bookmarks-command_manager.js.patch b/patches/chrome-browser-resources-bookmarks-command_manager.js.patch index b13428b3da17..59805922e31d 100644 --- a/patches/chrome-browser-resources-bookmarks-command_manager.js.patch +++ b/patches/chrome-browser-resources-bookmarks-command_manager.js.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/bookmarks/command_manager.js b/chrome/browser/resources/bookmarks/command_manager.js -index 380391c08d649e5c40c044fd98a54b8096ed49b0..91310adc0baf34e9d7cfd92f8db6232cc6ba1699 100644 +index de2338fb1e0dab8d18d2ceb8ab187c031bbacfa2..9bf23ac78836c58b56d56fa62ca40710bb9fb353 100644 --- a/chrome/browser/resources/bookmarks/command_manager.js +++ b/chrome/browser/resources/bookmarks/command_manager.js -@@ -442,7 +442,7 @@ export const CommandManager = Polymer({ +@@ -439,7 +439,7 @@ export const CommandManager = Polymer({ chrome.bookmarks.export(); break; case Command.HELP_CENTER: diff --git a/patches/chrome-browser-resources-downloads-downloads.html.patch b/patches/chrome-browser-resources-downloads-downloads.html.patch index 3fdd3a6f386d..06db2f6d5f55 100644 --- a/patches/chrome-browser-resources-downloads-downloads.html.patch +++ b/patches/chrome-browser-resources-downloads-downloads.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/downloads/downloads.html b/chrome/browser/resources/downloads/downloads.html -index 4e1efc9f67bba27e9be49e9125567f793124271b..51b9c1fc9e124196f1f8cc36f94757702487222d 100644 +index a5bb15763aa3820bd3b0a72ec8234c0ba6567b68..0d6b3a42780a9a8bd82d03c33fdab978d051af2c 100644 --- a/chrome/browser/resources/downloads/downloads.html +++ b/chrome/browser/resources/downloads/downloads.html -@@ -5,6 +5,7 @@ +@@ -6,6 +6,7 @@ $i18n{title} diff --git a/patches/chrome-browser-resources-downloads-toolbar.js.patch b/patches/chrome-browser-resources-downloads-toolbar.js.patch index e6578e13327e..91024a61229a 100644 --- a/patches/chrome-browser-resources-downloads-toolbar.js.patch +++ b/patches/chrome-browser-resources-downloads-toolbar.js.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/downloads/toolbar.js b/chrome/browser/resources/downloads/toolbar.js -index 2dfdab18bf6a489a195cadfaa18a6456cd44c4f1..b61d01de3d21ec63edc207d90b0963b1d1a6d693 100644 +index a14fbf89bfe7eb925e9a9febdd280454d573c90b..8caf240db979c09d30a36a71ab74d31e582b8b8c 100644 --- a/chrome/browser/resources/downloads/toolbar.js +++ b/chrome/browser/resources/downloads/toolbar.js @@ -4,7 +4,7 @@ diff --git a/patches/chrome-browser-resources-extensions-BUILD.gn.patch b/patches/chrome-browser-resources-extensions-BUILD.gn.patch index 9bd89f4165d6..025c6cfdb41b 100644 --- a/patches/chrome-browser-resources-extensions-BUILD.gn.patch +++ b/patches/chrome-browser-resources-extensions-BUILD.gn.patch @@ -1,12 +1,12 @@ diff --git a/chrome/browser/resources/extensions/BUILD.gn b/chrome/browser/resources/extensions/BUILD.gn -index c7563df6715f95d4fb4070e50adead73372a7005..a9a3cdd331b7fbd3cd3f4f23225978ee541844ff 100644 +index 41882a90448cee3778522c1c1abdd0d5ef675bca..fcfcacabd41712c874d08be461022f38b1e6ff5e 100644 --- a/chrome/browser/resources/extensions/BUILD.gn +++ b/chrome/browser/resources/extensions/BUILD.gn -@@ -21,6 +21,7 @@ if (optimize_webui) { - ":preprocess", - ":preprocess_generated", - "../../../../ui/webui/resources:preprocess", -+ "//brave/browser/resources/extensions:unpak", +@@ -57,6 +57,7 @@ generate_grd("build_grd") { + "$target_gen_dir/$preprocess_gen_manifest", ] - excludes = [ "chrome://resources/js/cr.m.js" ] } ++ deps += [ "//brave/browser/resources/extensions:resources" ] + } + + preprocess_grit("preprocess") { diff --git a/patches/chrome-browser-resources-extensions-extensions.html.patch b/patches/chrome-browser-resources-extensions-extensions.html.patch index 07155fe6a9e5..0b5afce2754c 100644 --- a/patches/chrome-browser-resources-extensions-extensions.html.patch +++ b/patches/chrome-browser-resources-extensions-extensions.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/extensions/extensions.html b/chrome/browser/resources/extensions/extensions.html -index c5980f41fd1bf20110b8c84b658485bc1f038282..341bb63303900d2d495876c4d4a62b2b1c56cef3 100644 +index 3aa5c713503cdab793fff44c2d9a924cda3c168a..1d4b693b323fd68233decb43a5d6be5e56267c99 100644 --- a/chrome/browser/resources/extensions/extensions.html +++ b/chrome/browser/resources/extensions/extensions.html -@@ -53,6 +53,7 @@ +@@ -54,6 +54,7 @@ width: 100%; } diff --git a/patches/chrome-browser-resources-history-history.html.patch b/patches/chrome-browser-resources-history-history.html.patch index 12d66f0a66ab..04c0a56b23c9 100644 --- a/patches/chrome-browser-resources-history-history.html.patch +++ b/patches/chrome-browser-resources-history-history.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/history/history.html b/chrome/browser/resources/history/history.html -index 7f78155dfe5944c2beeceff1acddb6780a32f74f..4522eaf101ebaa192abbde7710deb5c861e8c902 100644 +index f89232013d3efc189400143cbcc2cf7badbe4a66..70293038b432ab4579eed6a0daa28dde324afe14 100644 --- a/chrome/browser/resources/history/history.html +++ b/chrome/browser/resources/history/history.html -@@ -78,6 +78,7 @@ +@@ -79,6 +79,7 @@ justify-content: center; } diff --git a/patches/chrome-browser-resources-local_discovery-local_discovery.html.patch b/patches/chrome-browser-resources-local_discovery-local_discovery.html.patch index 8c42a1dc1eed..16c61429d34a 100644 --- a/patches/chrome-browser-resources-local_discovery-local_discovery.html.patch +++ b/patches/chrome-browser-resources-local_discovery-local_discovery.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/local_discovery/local_discovery.html b/chrome/browser/resources/local_discovery/local_discovery.html -index 9dc7d52545093a8a24d70393f9780f9591e4b834..72e97c6bbcd6870ddf6580d72c08b85321c4d297 100644 +index 54cdbff5e16b78d5ea9c7c75e82da869d3aae166..630f3bb90f0759d7fa909aef266cc74fcc6082e2 100644 --- a/chrome/browser/resources/local_discovery/local_discovery.html +++ b/chrome/browser/resources/local_discovery/local_discovery.html -@@ -29,6 +29,7 @@ +@@ -30,6 +30,7 @@ $i18nRaw{registerPrinterInformationMessage} @@ -10,7 +10,7 @@ index 9dc7d52545093a8a24d70393f9780f9591e4b834..72e97c6bbcd6870ddf6580d72c08b853

@@ -18,7 +18,7 @@ index 9dc7d52545093a8a24d70393f9780f9591e4b834..72e97c6bbcd6870ddf6580d72c08b853
-@@ -84,6 +86,7 @@ +@@ -85,6 +87,7 @@

$i18n{availableDevicesTitle}

@@ -26,7 +26,7 @@ index 9dc7d52545093a8a24d70393f9780f9591e4b834..72e97c6bbcd6870ddf6580d72c08b853 @@ -41,7 +41,7 @@ index 9dc7d52545093a8a24d70393f9780f9591e4b834..72e97c6bbcd6870ddf6580d72c08b853

$i18n{titleConnector}

-@@ -110,12 +115,14 @@ +@@ -111,12 +116,14 @@
@@ -56,7 +56,7 @@ index 9dc7d52545093a8a24d70393f9780f9591e4b834..72e97c6bbcd6870ddf6580d72c08b853 diff --git a/patches/chrome-browser-resources-optimize_webui.gni.patch b/patches/chrome-browser-resources-optimize_webui.gni.patch index 23d65a618419..30ddc078d71a 100644 --- a/patches/chrome-browser-resources-optimize_webui.gni.patch +++ b/patches/chrome-browser-resources-optimize_webui.gni.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/optimize_webui.gni b/chrome/browser/resources/optimize_webui.gni -index dad606df8225e38ee74f2db4bc40197f0b5948d9..25fa7208aa175b6d3dbc86ce75b6d6ac8f27be7b 100644 +index f4c1ca5ad559e285b1bfff925c4098b27c0d5888..9fc33e3b38f78cf500a293837e303b0db78890a8 100644 --- a/chrome/browser/resources/optimize_webui.gni +++ b/chrome/browser/resources/optimize_webui.gni -@@ -45,6 +45,7 @@ template("optimize_webui") { +@@ -44,6 +44,7 @@ template("optimize_webui") { } deps = invoker.deps diff --git a/patches/chrome-browser-resources-optimize_webui.py.patch b/patches/chrome-browser-resources-optimize_webui.py.patch index 88c69a2c348c..cb5a45f29369 100644 --- a/patches/chrome-browser-resources-optimize_webui.py.patch +++ b/patches/chrome-browser-resources-optimize_webui.py.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/optimize_webui.py b/chrome/browser/resources/optimize_webui.py -index 00da924718386c32fc6c989f1fcfa5de5954472f..6612a4952d3ff6ba8df735a15fe730921a01998d 100755 +index d7bade19933acfbcd31bbce4231d9e20743f4c91..180e7f20ae355f6e152e697361a95d90cc98cb9c 100755 --- a/chrome/browser/resources/optimize_webui.py +++ b/chrome/browser/resources/optimize_webui.py @@ -56,8 +56,12 @@ _POLYMER_PATH = os.path.join( diff --git a/patches/chrome-browser-resources-settings-BUILD.gn.patch b/patches/chrome-browser-resources-settings-BUILD.gn.patch index 9ccbe7a7b64c..9cfd0da583a2 100644 --- a/patches/chrome-browser-resources-settings-BUILD.gn.patch +++ b/patches/chrome-browser-resources-settings-BUILD.gn.patch @@ -1,12 +1,12 @@ diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resources/settings/BUILD.gn -index 77e8782ec6f0d388cb77fb23dd8451170da5f65d..f8e56af49f9e47b41a88d84bf2145711ed409a40 100644 +index 3a364142fc0b49a183a2fd046956b530aa900569..d2a2db08cb93baac1b87b1627960f8a75a27edff 100644 --- a/chrome/browser/resources/settings/BUILD.gn +++ b/chrome/browser/resources/settings/BUILD.gn -@@ -32,6 +32,7 @@ if (optimize_webui) { - ":preprocess", - ":preprocess_generated", - "../../../../ui/webui/resources:preprocess", -+ "//brave/browser/resources/settings:unpak", +@@ -85,6 +85,7 @@ generate_grd("build_grd") { + "$target_gen_dir/$preprocess_gen_manifest", ] - excludes = [ - "chrome://resources/js/cr.m.js", + } ++ deps += [ "//brave/browser/resources/settings:resources" ] + } + + preprocess_grit("preprocess") { diff --git a/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch b/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch index bba570c5aa54..462f1e99017a 100644 --- a/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch +++ b/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/people_page/sync_controls.js b/chrome/browser/resources/settings/people_page/sync_controls.js -index 8a60f0d3bceea5c142797a1db16bbdb75f26a175..12c8a63724d5e7f3490dede654fc2611bfa86889 100644 +index 663f8cda6cdcddd7b87e15f713ad3352f52d9629..3a0546e50532fda99bd248c3fc3873eeee8f3b94 100644 --- a/chrome/browser/resources/settings/people_page/sync_controls.js +++ b/chrome/browser/resources/settings/people_page/sync_controls.js -@@ -88,7 +88,7 @@ Polymer({ +@@ -89,7 +89,7 @@ Polymer({ 'sync-prefs-changed', this.handleSyncPrefsChanged_.bind(this)); const router = settings.Router.getInstance(); @@ -11,7 +11,7 @@ index 8a60f0d3bceea5c142797a1db16bbdb75f26a175..12c8a63724d5e7f3490dede654fc2611 this.browserProxy_.didNavigateToSyncPage(); } }, -@@ -215,6 +215,7 @@ Polymer({ +@@ -216,6 +216,7 @@ Polymer({ * @private */ syncControlsHidden_() { diff --git a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.html.patch b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.html.patch index f0ad29ad2ee2..fc5a5a1edb9b 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.html.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.html.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.html b/chrome/browser/resources/settings/privacy_page/personalization_options.html -index 2b94f37bda8703e6876b770b9d75dafbc0b27954..b0e72bac8a55cf1d3b1c98bdb31b5d1d16df9453 100644 +index 350712a350e79ec135fbcdfbbe57b4de233e07ef..8a0d6176386a61ca5bce8be86042098392b387fa 100644 --- a/chrome/browser/resources/settings/privacy_page/personalization_options.html +++ b/chrome/browser/resources/settings/privacy_page/personalization_options.html @@ -16,6 +16,7 @@ diff --git a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch index 005def39304e..8740593df4e6 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.js b/chrome/browser/resources/settings/privacy_page/personalization_options.js -index e8f221291df750046915055b427b68dc72b468e6..1d695673499ad788ddbbaf359646329761175d7f 100644 +index 2b737b6877a0bc78869b073e00db772c64de3445..114f4b8a5f62f4f41eae39489adfbf1e81e4a49d 100644 --- a/chrome/browser/resources/settings/privacy_page/personalization_options.js +++ b/chrome/browser/resources/settings/privacy_page/personalization_options.js @@ -34,7 +34,7 @@ Polymer({ @@ -11,7 +11,7 @@ index e8f221291df750046915055b427b68dc72b468e6..1d695673499ad788ddbbaf3596463297 // TODO(dbeam): make a virtual.* pref namespace and set/get this normally // (but handled differently in C++). /** @private {chrome.settingsPrivate.PrefObject} */ -@@ -80,7 +80,7 @@ Polymer({ +@@ -77,7 +77,7 @@ Polymer({ ready() { this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance(); @@ -20,7 +20,7 @@ index e8f221291df750046915055b427b68dc72b468e6..1d695673499ad788ddbbaf3596463297 const setMetricsReportingPref = this.setMetricsReportingPref_.bind(this); this.addWebUIListener('metrics-reporting-change', setMetricsReportingPref); this.browserProxy_.getMetricsReporting().then(setMetricsReportingPref); -@@ -111,7 +111,7 @@ Polymer({ +@@ -108,7 +108,7 @@ Polymer({ return /** @type {?CrToggleElement} */ (this.$$('#driveSuggestControl')); }, @@ -29,7 +29,7 @@ index e8f221291df750046915055b427b68dc72b468e6..1d695673499ad788ddbbaf3596463297 /** @private */ onMetricsReportingChange_() { const enabled = this.$.metricsReportingControl.checked; -@@ -161,6 +161,7 @@ Polymer({ +@@ -158,6 +158,7 @@ Polymer({ }, //
@@ -37,7 +37,7 @@ index e8f221291df750046915055b427b68dc72b468e6..1d695673499ad788ddbbaf3596463297 /** * @return {boolean} * @private -@@ -209,6 +210,7 @@ Polymer({ +@@ -206,6 +207,7 @@ Polymer({ } this.showSignoutDialog_ = false; }, diff --git a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch index c38e70450d5c..f0f529328977 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html -index 58c5fe913a850a6ea11bb72056814350f78fe17e..34d86995e5439f4ef817c2d6f8b97b2c1e5cd6cb 100644 +index 3fec124468af55207ba36d15dd81c6ff81179c65..cc807af537103feb502a9864e56c8dce22ae0247 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html -@@ -11,6 +11,7 @@ +@@ -29,6 +29,7 @@
@@ -10,40 +10,42 @@ index 58c5fe913a850a6ea11bb72056814350f78fe17e..34d86995e5439f4ef817c2d6f8b97b2c +@@ -144,6 +145,7 @@ + + + - +@@ -706,6 +711,19 @@ + + + + -