@@ -1844,6 +1864,9 @@
Sites listed below follow a custom setting instead of the default
+
+ Sites listed below follow a custom setting
+
Sites usually show ads so they can provide content or services for free. But, some sites are known to show intrusive or misleading ads.
@@ -2186,11 +2209,23 @@
Not allowed to send pop-ups or use redirects
+
+ Protected content
+
+
+ protected content
+
+
+ Protected content IDs
+
+
+ Allow sites to play protected content (recommended)
+
- When a site plays content protected by copyright, it might ask to recognize your device
+ To play content protected by copyright, sites may need to use a content protection service
- Sites can ask to play protected content
+ Sites can play protected content
Don't allow sites to play protected content
@@ -2198,12 +2233,29 @@
Media with a copyright might not play
-
- Allowed to play protected content
-
-
- Not allowed to play protected content
-
+
+
+ Sites may also need to recognize your device using an identifier
+
+
+ Allow identifiers for protected content (computer restart may be required)
+
+
+ Sites can use identifiers to play protected content
+
+
+ Don't allow sites to use identifiers to play protected content
+
+
+ Media quality may be reduced
+
+
+ Allowed to use identifiers to play protected content
+
+
+ Not allowed to use identifiers to play protected content
+
+
Sites can handle special tasks when you click on certain types of links, like creating a new message in your email client or adding new events to your online calendar
@@ -2394,10 +2446,10 @@
cookies and site data
- Handlers
+ Protocol handlers
- handlers
+ protocol handlers
Location
@@ -2483,18 +2535,6 @@
pop-ups and redirects
-
- Protected content
-
-
- protected content
-
-
- Protected content identifiers
-
-
- Allow sites to play protected content (recommended)
-
Virtual reality
@@ -2510,14 +2550,6 @@
Do not allow sites to use your virtual reality devices and data
-
-
- Some content services use unique identifiers for the purposes of authorizing access to protected content
-
-
- Allow identifiers for protected content (computer restart may be required)
-
-
Recent activity
@@ -3106,7 +3138,7 @@
-
+
Name
@@ -3197,10 +3229,7 @@
Sign in
- Because this account is managed by $1example.com, your bookmarks, history, passwords, and other settings will be cleared from this device. However, your data will remain stored in your Brave sync chain and can be managed on <a href="$2" target="_blank" rel="noopener noreferrer"><a href="$2" target="_blank">Brave Dashboard</a></a>.
-
-
- Edit profile
+ Because this account is managed by $1example.com, your bookmarks, history, passwords, and other settings will be cleared from this device. However, your data will remain stored in your Brave sync chain and can be managed on <a href="$2" target="_blank"><a href="$2" target="_blank">Brave Dashboard</a></a>.
Turn off sync and personalization?
@@ -3216,7 +3245,7 @@
-
+
Name
@@ -3240,7 +3269,7 @@
- Changes to your bookmarks, history, passwords, and other settings will no longer be synced to your Brave sync chain. However, your existing data will remain stored in your Brave sync chain and can be managed on <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">Brave Dashboard</a></a>.
+ Changes to your bookmarks, history, passwords, and other settings will no longer be synced to your Brave sync chain. However, your existing data will remain stored in your Brave sync chain and can be managed on <a href="$1" target="_blank"><a href="$1" target="_blank">Brave Dashboard</a></a>.
This will sign you out of your Brave sync chains. Your bookmarks, history, passwords, and more will no longer be synced.
@@ -3267,22 +3296,22 @@
Manage synced data on Brave Dashboard
- Encrypt synced data with your own <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">sync passphrase</a></a>. This doesn't include payment methods and addresses from Brave Pay.
+ Encrypt synced data with your own <a href="$1" target="_blank"><a href="$1" target="_blank">sync passphrase</a></a>. This doesn't include payment methods and addresses from Brave Pay.
- Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Brave. If you forget your passphrase or want to change this setting, you'll need to <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a>.
+ Only someone with your passphrase can read your encrypted data. The passphrase is not sent to or stored by Brave. If you forget your passphrase or want to change this setting, you'll need to <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a>.
- To change this setting, <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase
+ To change this setting, <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase
- To turn this on, <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase
+ To turn this on, <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a> to remove your sync passphrase
- If you forgot your passphrase or want to change this setting, <a href="$1" target="_blank" rel="noopener noreferrer"><a href="$1" target="_blank">reset sync</a></a>.
+ If you forgot your passphrase or want to change this setting, <a href="$1" target="_blank"><a href="$1" target="_blank">reset sync</a></a>.
- Control how your browsing history is used to personalize Search, ads, and more
+ Control how your browsing history is used to personalize Search and more
@@ -3528,7 +3557,7 @@
other {To ensure that you can keep browsing the web, ask your administrator to remove these applications.}}
- <a target="_blank" rel="noopener noreferrer" href="$1">Learn how to update applications</a>
+ <a target="_blank" href="$1">Learn how to update applications</a>
{NUM_APLLICATIONS, plural,
@@ -3721,7 +3750,7 @@
Enter a name for this fingerprint
-
+
Name
diff --git a/app/settings_strings_override.grdp b/app/settings_strings_override.grdp
index 67f0101d7e60..3d798692e042 100644
--- a/app/settings_strings_override.grdp
+++ b/app/settings_strings_override.grdp
@@ -68,14 +68,14 @@
+
+
Block third-party cookies in Private
While in Private, sites can't use your cookies to see your browsing activity across different sites, for example, to personalize ads. Features on some sites may break.
-
-
Third-party cookies are blocked in Private mode
@@ -88,9 +88,6 @@
-
- Edit profile
-
diff --git a/app/theme/brave/android/res_brave_base/values/channel_constants.xml b/app/theme/brave/android/res_brave_base/values/channel_constants.xml
index 4cf1649e1b58..4759d6a86c02 100644
--- a/app/theme/brave/android/res_brave_base/values/channel_constants.xml
+++ b/app/theme/brave/android/res_brave_base/values/channel_constants.xml
@@ -8,4 +8,5 @@
Brave
Brave bookmarks
Brave search
+ Brave quick action search
diff --git a/app/theme/brave/android/res_brave_beta_base/values/channel_constants.xml b/app/theme/brave/android/res_brave_beta_base/values/channel_constants.xml
index 2a149b5bc655..08ee9332ba16 100644
--- a/app/theme/brave/android/res_brave_beta_base/values/channel_constants.xml
+++ b/app/theme/brave/android/res_brave_beta_base/values/channel_constants.xml
@@ -10,4 +10,5 @@
Brave - Beta
Brave bookmarks
Brave search
+ Brave quick action search
diff --git a/app/theme/brave/android/res_brave_default_base/values/channel_constants.xml b/app/theme/brave/android/res_brave_default_base/values/channel_constants.xml
index bf3e867eaa07..6c19ba4a5398 100644
--- a/app/theme/brave/android/res_brave_default_base/values/channel_constants.xml
+++ b/app/theme/brave/android/res_brave_default_base/values/channel_constants.xml
@@ -8,4 +8,5 @@
Brave - Debug
Brave bookmarks
Brave search
+ Brave quick action search
diff --git a/app/theme/brave/android/res_brave_dev_base/values/channel_constants.xml b/app/theme/brave/android/res_brave_dev_base/values/channel_constants.xml
index 0be6d8638ab8..9ae924fefd1b 100644
--- a/app/theme/brave/android/res_brave_dev_base/values/channel_constants.xml
+++ b/app/theme/brave/android/res_brave_dev_base/values/channel_constants.xml
@@ -10,4 +10,5 @@
Brave - Dev
Brave bookmarks
Brave search
+ Brave quick action search
diff --git a/app/theme/brave/android/res_brave_nightly_base/values/channel_constants.xml b/app/theme/brave/android/res_brave_nightly_base/values/channel_constants.xml
index d1f7f510f8de..bcd336dcd3dd 100644
--- a/app/theme/brave/android/res_brave_nightly_base/values/channel_constants.xml
+++ b/app/theme/brave/android/res_brave_nightly_base/values/channel_constants.xml
@@ -10,4 +10,5 @@
Brave - Nightly
Brave bookmarks
Brave search
+ Brave quick action search
diff --git a/app/theme/brave/android/values/channel_constants.xml b/app/theme/brave/android/values/channel_constants.xml
index bf3e867eaa07..6c19ba4a5398 100644
--- a/app/theme/brave/android/values/channel_constants.xml
+++ b/app/theme/brave/android/values/channel_constants.xml
@@ -8,4 +8,5 @@
Brave - Debug
Brave bookmarks
Brave search
+ Brave quick action search
diff --git a/app/url_handler_intent_picker_strings.grdp b/app/url_handler_intent_picker_strings.grdp
new file mode 100644
index 000000000000..b2232835281c
--- /dev/null
+++ b/app/url_handler_intent_picker_strings.grdp
@@ -0,0 +1,23 @@
+
+
+
+
+
+ Which application do you want to use?
+
+
+ Remember my choice
+
+
+ Open
+
+
+ Cancel
+
+
+ $1Demo App ($2Work)
+
+
+ Publisher: $1example.com
+
+
diff --git a/app/whats_new_strings.grdp b/app/whats_new_strings.grdp
new file mode 100644
index 000000000000..fb37bffbd17b
--- /dev/null
+++ b/app/whats_new_strings.grdp
@@ -0,0 +1,10 @@
+
+
+
+
+ This page can't be reached
+
+
+ Reload the page or try again later
+
+
diff --git a/browser/android/BUILD.gn b/browser/android/BUILD.gn
index c8c774e4ba84..68f5a2741a1e 100644
--- a/browser/android/BUILD.gn
+++ b/browser/android/BUILD.gn
@@ -47,7 +47,7 @@ source_set("android_browser_process") {
"//brave/components/brave_sync",
"//brave/components/brave_sync:crypto",
"//brave/components/brave_sync:prefs",
- "//brave/components/brave_sync:profile_sync_service_helper",
+ "//brave/components/brave_sync:sync_service_impl_helper",
"//components/sync",
"//components/sync_device_info",
"//components/unified_consent",
diff --git a/browser/android/brave_sync_worker.cc b/browser/android/brave_sync_worker.cc
index d40b62fe4123..4b60a204fde2 100644
--- a/browser/android/brave_sync_worker.cc
+++ b/browser/android/brave_sync_worker.cc
@@ -17,13 +17,13 @@
#include "brave/build/android/jni_headers/BraveSyncWorker_jni.h"
#include "brave/components/brave_sync/brave_sync_prefs.h"
#include "brave/components/brave_sync/crypto/crypto.h"
-#include "brave/components/brave_sync/profile_sync_service_helper.h"
-#include "brave/components/sync/driver/brave_sync_profile_sync_service.h"
+#include "brave/components/brave_sync/sync_service_impl_helper.h"
+#include "brave/components/sync/driver/brave_sync_service_impl.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/device_info_sync_service_factory.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/sync_service_factory.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h"
@@ -33,7 +33,7 @@
#include "third_party/leveldatabase/src/include/leveldb/db.h"
-// TODO(alexeybarabash): consider use of java ProfileSyncService methods:
+// TODO(alexeybarabash): consider use of java SyncServiceImpl methods:
// addSyncStateChangedListener
// removeSyncStateChangedListener
// requestStart
@@ -116,10 +116,10 @@ void BraveSyncWorker::SaveCodeWords(
passphrase_ = str_passphrase;
}
-syncer::BraveProfileSyncService* BraveSyncWorker::GetSyncService() const {
- return ProfileSyncServiceFactory::IsSyncAllowed(profile_)
- ? static_cast(
- ProfileSyncServiceFactory::GetForProfile(profile_))
+syncer::BraveSyncServiceImpl* BraveSyncWorker::GetSyncService() const {
+ return SyncServiceFactory::IsSyncAllowed(profile_)
+ ? static_cast(
+ SyncServiceFactory::GetForProfile(profile_))
: nullptr;
}
@@ -127,8 +127,7 @@ syncer::BraveProfileSyncService* BraveSyncWorker::GetSyncService() const {
// bring the logic of enabling / disabling sync from deskop to Android
void BraveSyncWorker::RequestSync(JNIEnv* env) {
- syncer::SyncService* service =
- ProfileSyncServiceFactory::GetForProfile(profile_);
+ syncer::SyncService* service = SyncServiceFactory::GetForProfile(profile_);
if (service && !sync_service_observer_.IsObservingSource(service)) {
sync_service_observer_.AddObservation(service);
diff --git a/browser/android/brave_sync_worker.h b/browser/android/brave_sync_worker.h
index 730989566711..a0eb00fe30ac 100644
--- a/browser/android/brave_sync_worker.h
+++ b/browser/android/brave_sync_worker.h
@@ -17,7 +17,7 @@
class Profile;
namespace syncer {
-class BraveProfileSyncService;
+class BraveSyncServiceImpl;
} // namespace syncer
namespace chrome {
@@ -53,7 +53,7 @@ class BraveSyncWorker : public syncer::SyncServiceObserver {
bool sync_v2_migration_notice_dismissed);
private:
- syncer::BraveProfileSyncService* GetSyncService() const;
+ syncer::BraveSyncServiceImpl* GetSyncService() const;
void MarkFirstSetupComplete();
// syncer::SyncServiceObserver implementation.
diff --git a/browser/brave_browser_main_parts.cc b/browser/brave_browser_main_parts.cc
index 3e602b5b6d92..489ed2470337 100644
--- a/browser/brave_browser_main_parts.cc
+++ b/browser/brave_browser_main_parts.cc
@@ -49,7 +49,7 @@
#if BUILDFLAG(ENABLE_BRAVE_SYNC) && !defined(OS_ANDROID)
#include "brave/browser/infobars/sync_v2_migrate_infobar_delegate.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/sync_service_factory.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h"
#endif
@@ -116,10 +116,9 @@ void BraveBrowserMainParts::PostBrowserStart() {
BraveConfirmP3AInfoBarDelegate::Create(
infobar_manager, g_browser_process->local_state());
#if BUILDFLAG(ENABLE_BRAVE_SYNC)
- auto* sync_service =
- ProfileSyncServiceFactory::IsSyncAllowed(profile())
- ? ProfileSyncServiceFactory::GetForProfile(profile())
- : nullptr;
+ auto* sync_service = SyncServiceFactory::IsSyncAllowed(profile())
+ ? SyncServiceFactory::GetForProfile(profile())
+ : nullptr;
const bool is_v2_user =
sync_service &&
sync_service->GetUserSettings()->IsFirstSetupComplete();
diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc
index 4bea76fed8f1..cc8905817bf7 100644
--- a/browser/brave_content_browser_client.cc
+++ b/browser/brave_content_browser_client.cc
@@ -73,11 +73,13 @@
#include "content/public/common/content_switches.h"
#include "extensions/buildflags/buildflags.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
+#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/cookies/site_for_cookies.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
#include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom.h"
+#include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/l10n/l10n_util.h"
using blink::web_pref::WebPreferences;
@@ -138,6 +140,10 @@ using extensions::ChromeContentBrowserClientExtensionsPart;
#include "brave/browser/ftx/ftx_protocol_handler.h"
#endif
+#if BUILDFLAG(ENABLE_WIDEVINE)
+#include "brave/browser/brave_drm_tab_helper.h"
+#endif
+
#if BUILDFLAG(BRAVE_WALLET_ENABLED)
#include "brave/browser/brave_wallet/brave_wallet_context_utils.h"
#include "brave/browser/brave_wallet/rpc_controller_factory.h"
@@ -304,6 +310,36 @@ void BraveContentBrowserClient::RenderProcessWillLaunch(
ChromeContentBrowserClient::RenderProcessWillLaunch(host);
}
+bool BraveContentBrowserClient::BindAssociatedReceiverFromFrame(
+ content::RenderFrameHost* render_frame_host,
+ const std::string& interface_name,
+ mojo::ScopedInterfaceEndpointHandle* handle) {
+ if (ChromeContentBrowserClient::BindAssociatedReceiverFromFrame(
+ render_frame_host, interface_name, handle)) {
+ return true;
+ }
+
+#if BUILDFLAG(ENABLE_WIDEVINE)
+ if (interface_name == brave_drm::mojom::BraveDRM::Name_) {
+ BraveDrmTabHelper::BindBraveDRM(
+ mojo::PendingAssociatedReceiver(
+ std::move(*handle)),
+ render_frame_host);
+ return true;
+ }
+#endif // BUILDFLAG(ENABLE_WIDEVINE)
+
+ if (interface_name == brave_shields::mojom::BraveShieldsHost::Name_) {
+ brave_shields::BraveShieldsWebContentsObserver::BindBraveShieldsHost(
+ mojo::PendingAssociatedReceiver(
+ std::move(*handle)),
+ render_frame_host);
+ return true;
+ }
+
+ return false;
+}
+
content::ContentBrowserClient::AllowWebBluetoothResult
BraveContentBrowserClient::AllowWebBluetooth(
content::BrowserContext* browser_context,
@@ -350,7 +386,7 @@ void BraveContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
bool BraveContentBrowserClient::HandleExternalProtocol(
const GURL& url,
- content::WebContents::OnceGetter web_contents_getter,
+ content::WebContents::Getter web_contents_getter,
int child_id,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
@@ -361,49 +397,46 @@ bool BraveContentBrowserClient::HandleExternalProtocol(
mojo::PendingRemote* out_factory) {
#if BUILDFLAG(ENABLE_BRAVE_WEBTORRENT)
if (webtorrent::IsMagnetProtocol(url)) {
- webtorrent::HandleMagnetProtocol(url, std::move(web_contents_getter),
- page_transition, has_user_gesture,
- initiating_origin);
+ webtorrent::HandleMagnetProtocol(url, web_contents_getter, page_transition,
+ has_user_gesture, initiating_origin);
return true;
}
#endif
if (brave_rewards::IsRewardsProtocol(url)) {
- brave_rewards::HandleRewardsProtocol(url, std::move(web_contents_getter),
+ brave_rewards::HandleRewardsProtocol(url, web_contents_getter,
page_transition, has_user_gesture);
return true;
}
#if BUILDFLAG(BINANCE_ENABLED)
if (binance::IsBinanceProtocol(url)) {
- binance::HandleBinanceProtocol(url, std::move(web_contents_getter),
- page_transition, has_user_gesture,
- initiating_origin);
+ binance::HandleBinanceProtocol(url, web_contents_getter, page_transition,
+ has_user_gesture, initiating_origin);
return true;
}
#endif
#if BUILDFLAG(GEMINI_ENABLED)
if (gemini::IsGeminiProtocol(url)) {
- gemini::HandleGeminiProtocol(url, std::move(web_contents_getter),
- page_transition, has_user_gesture,
- initiating_origin);
+ gemini::HandleGeminiProtocol(url, web_contents_getter, page_transition,
+ has_user_gesture, initiating_origin);
return true;
}
#endif
#if BUILDFLAG(ENABLE_FTX)
if (ftx::IsFTXProtocol(url)) {
- ftx::HandleFTXProtocol(url, std::move(web_contents_getter), page_transition,
+ ftx::HandleFTXProtocol(url, web_contents_getter, page_transition,
has_user_gesture, initiating_origin);
return true;
}
#endif
return ChromeContentBrowserClient::HandleExternalProtocol(
- url, std::move(web_contents_getter), child_id, frame_tree_node_id,
- navigation_data, is_main_frame, page_transition, has_user_gesture,
- initiating_origin, out_factory);
+ url, web_contents_getter, child_id, frame_tree_node_id, navigation_data,
+ is_main_frame, page_transition, has_user_gesture, initiating_origin,
+ out_factory);
}
void BraveContentBrowserClient::AppendExtraCommandLineSwitches(
@@ -416,7 +449,15 @@ void BraveContentBrowserClient::AppendExtraCommandLineSwitches(
if (process_type == switches::kRendererProcess) {
uint64_t session_token =
12345; // the kinda thing an idiot would have on his luggage
- if (!command_line->HasSwitch(switches::kTestType)) {
+
+ // Command line parameters from the browser process are propagated to the
+ // renderers *after* ContentBrowserClient::AppendExtraCommandLineSwitches()
+ // is called from RenderProcessHostImpl::AppendRendererCommandLine(). This
+ // means we have to inspect the main browser process' parameters for the
+ // |switches::kTestType| as it will be too soon to find it on command_line.
+ const base::CommandLine& browser_command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (!browser_command_line.HasSwitch(switches::kTestType)) {
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(child_process_id);
Profile* profile =
diff --git a/browser/brave_content_browser_client.h b/browser/brave_content_browser_client.h
index 66272575ebe0..69ca7930867a 100644
--- a/browser/brave_content_browser_client.h
+++ b/browser/brave_content_browser_client.h
@@ -42,10 +42,14 @@ class BraveContentBrowserClient : public ChromeContentBrowserClient {
const content::MainFunctionParams& parameters) override;
void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
+ bool BindAssociatedReceiverFromFrame(
+ content::RenderFrameHost* render_frame_host,
+ const std::string& interface_name,
+ mojo::ScopedInterfaceEndpointHandle* handle) override;
bool HandleExternalProtocol(
const GURL& url,
- content::WebContents::OnceGetter web_contents_getter,
+ content::WebContents::Getter web_contents_getter,
int child_id,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
diff --git a/browser/brave_drm_tab_helper.cc b/browser/brave_drm_tab_helper.cc
index 086f62900b79..96d9ce3dde94 100644
--- a/browser/brave_drm_tab_helper.cc
+++ b/browser/brave_drm_tab_helper.cc
@@ -6,6 +6,7 @@
#include "brave/browser/brave_drm_tab_helper.h"
#include
+#include
#include
#include "brave/browser/widevine/widevine_utils.h"
@@ -49,7 +50,7 @@ const char BraveDrmTabHelper::kWidevineComponentId[] =
"oimompecagnajdejgnnjijobebaeigek";
BraveDrmTabHelper::BraveDrmTabHelper(content::WebContents* contents)
- : WebContentsObserver(contents), receivers_(contents, this) {
+ : WebContentsObserver(contents), brave_drm_receivers_(contents, this) {
auto* updater = g_browser_process->component_updater();
// We don't need to observe if widevine is already registered.
if (!IsAlreadyRegistered(updater))
@@ -58,6 +59,20 @@ BraveDrmTabHelper::BraveDrmTabHelper(content::WebContents* contents)
BraveDrmTabHelper::~BraveDrmTabHelper() {}
+// static
+void BraveDrmTabHelper::BindBraveDRM(
+ mojo::PendingAssociatedReceiver receiver,
+ content::RenderFrameHost* rfh) {
+ auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
+ if (!web_contents)
+ return;
+
+ auto* tab_helper = BraveDrmTabHelper::FromWebContents(web_contents);
+ if (!tab_helper)
+ return;
+ tab_helper->brave_drm_receivers_.Bind(rfh, std::move(receiver));
+}
+
bool BraveDrmTabHelper::ShouldShowWidevineOptIn() const {
// If the user already opted in, don't offer it.
PrefService* prefs =
diff --git a/browser/brave_drm_tab_helper.h b/browser/brave_drm_tab_helper.h
index 220761a39324..d64778380b12 100644
--- a/browser/brave_drm_tab_helper.h
+++ b/browser/brave_drm_tab_helper.h
@@ -11,8 +11,8 @@
#include "base/scoped_observation.h"
#include "brave/components/brave_drm/brave_drm.mojom.h"
#include "components/component_updater/component_updater_service.h"
+#include "content/public/browser/render_frame_host_receiver_set.h"
#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_contents_receiver_set.h"
#include "content/public/browser/web_contents_user_data.h"
// Reacts to DRM content detected on the renderer side.
@@ -29,6 +29,10 @@ class BraveDrmTabHelper final
explicit BraveDrmTabHelper(content::WebContents* contents);
~BraveDrmTabHelper() override;
+ static void BindBraveDRM(
+ mojo::PendingAssociatedReceiver receiver,
+ content::RenderFrameHost* rfh);
+
bool ShouldShowWidevineOptIn() const;
// content::WebContentsObserver
@@ -44,7 +48,8 @@ class BraveDrmTabHelper final
WEB_CONTENTS_USER_DATA_KEY_DECL();
private:
- content::WebContentsFrameReceiverSet receivers_;
+ content::RenderFrameHostReceiverSet
+ brave_drm_receivers_;
// Permission request is done only once during the navigation. If user
// chooses dismiss/deny, additional request is added again only when new
diff --git a/browser/brave_prefs_browsertest.cc b/browser/brave_prefs_browsertest.cc
index a577ba5529cc..c0ef84fb6bf0 100644
--- a/browser/brave_prefs_browsertest.cc
+++ b/browser/brave_prefs_browsertest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/new_tab_page/ntp_pref_names.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "components/embedder_support/pref_names.h"
@@ -145,7 +146,7 @@ IN_PROC_BROWSER_TEST_F(BraveProfilePrefsBrowserTest,
prefs::kCloudPrintSubmitEnabled));
#if !defined(OS_ANDROID)
EXPECT_TRUE(chrome_test_utils::GetProfile(this)->GetPrefs()->GetBoolean(
- prefs::kNtpUseMostVisitedTiles));
+ ntp_prefs::kNtpUseMostVisitedTiles));
#endif
EXPECT_TRUE(chrome_test_utils::GetProfile(this)->GetPrefs()->GetBoolean(
prefs::kHideWebStoreIcon));
diff --git a/browser/brave_profile_prefs.cc b/browser/brave_profile_prefs.cc
index 450710c0709e..3a6a56f84d0c 100644
--- a/browser/brave_profile_prefs.cc
+++ b/browser/brave_profile_prefs.cc
@@ -38,6 +38,7 @@
#include "brave/components/tor/buildflags/buildflags.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/prefs/session_startup_pref.h"
+#include "chrome/browser/ui/webui/new_tab_page/ntp_pref_names.h"
#include "chrome/common/pref_names.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "components/content_settings/core/common/pref_names.h"
@@ -232,19 +233,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
// Hangouts
registry->RegisterBooleanPref(kHangoutsEnabled, true);
- // Media Router
- registry->SetDefaultPrefValue(prefs::kEnableMediaRouter, base::Value(false));
-
- // 1. We do not want to enable the MediaRouter pref directly, so
- // using a proxy pref to handle Media Router setting
- // 2. On upgrade users might have enabled Media Router and the pref should
- // be set correctly, so we use feature switch to set the initial value
-#if BUILDFLAG(ENABLE_EXTENSIONS)
- registry->RegisterBooleanPref(
- kBraveEnabledMediaRouter,
- FeatureSwitch::load_media_router_component_extension()->IsEnabled());
-#endif
-
// Restore last profile on restart
registry->SetDefaultPrefValue(
prefs::kRestoreOnStartup,
@@ -400,7 +388,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
#if !defined(OS_ANDROID)
// Turn on most visited mode on NTP by default.
// We can turn customization mode on when we have add-shortcut feature.
- registry->SetDefaultPrefValue(prefs::kNtpUseMostVisitedTiles,
+ registry->SetDefaultPrefValue(ntp_prefs::kNtpUseMostVisitedTiles,
base::Value(true));
RegisterDefaultBraveBrowserPromptPrefs(registry);
#endif
diff --git a/browser/brave_resources_util_unittest.cc b/browser/brave_resources_util_unittest.cc
index 6eec7a149d92..85fae80da2e1 100644
--- a/browser/brave_resources_util_unittest.cc
+++ b/browser/brave_resources_util_unittest.cc
@@ -5,8 +5,8 @@
#include
+#include "base/cxx17_backports.h"
#include "base/macros.h"
-#include "base/stl_util.h"
#include "brave/grit/brave_theme_resources.h"
#include "build/build_config.h"
#include "chrome/browser/resources_util.h"
diff --git a/browser/brave_shields/brave_shields_web_contents_observer.cc b/browser/brave_shields/brave_shields_web_contents_observer.cc
index 8a167a1b1483..07daa78ff3cf 100644
--- a/browser/brave_shields/brave_shields_web_contents_observer.cc
+++ b/browser/brave_shields/brave_shields_web_contents_observer.cc
@@ -48,8 +48,12 @@ using extensions::EventRouter;
using content::RenderFrameHost;
using content::WebContents;
+namespace brave_shields {
+
namespace {
+BraveShieldsWebContentsObserver* g_receiver_impl_for_testing = nullptr;
+
// Content Settings are only sent to the main frame currently. Chrome may fix
// this at some point, but for now we do this as a work-around. You can verify
// if this is fixed by running the following test: npm run test --
@@ -78,16 +82,13 @@ void UpdateContentSettingsToRendererFrames(content::WebContents* web_contents) {
} // namespace
-namespace brave_shields {
-
BraveShieldsWebContentsObserver::~BraveShieldsWebContentsObserver() {
brave_shields_remotes_.clear();
}
BraveShieldsWebContentsObserver::BraveShieldsWebContentsObserver(
WebContents* web_contents)
- : WebContentsObserver(web_contents),
- brave_shields_receivers_(web_contents, this) {}
+ : WebContentsObserver(web_contents), receivers_(web_contents, this) {}
void BraveShieldsWebContentsObserver::RenderFrameCreated(RenderFrameHost* rfh) {
if (rfh && allowed_script_origins_.size()) {
@@ -126,6 +127,27 @@ void BraveShieldsWebContentsObserver::AddBlockedSubresource(
blocked_url_paths_.insert(subresource);
}
+// static
+void BraveShieldsWebContentsObserver::BindBraveShieldsHost(
+ mojo::PendingAssociatedReceiver
+ receiver,
+ content::RenderFrameHost* rfh) {
+ if (g_receiver_impl_for_testing) {
+ g_receiver_impl_for_testing->BindReceiver(std::move(receiver), rfh);
+ return;
+ }
+
+ auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
+ if (!web_contents)
+ return;
+
+ auto* shields_host =
+ BraveShieldsWebContentsObserver::FromWebContents(web_contents);
+ if (!shields_host)
+ return;
+ shields_host->BindReceiver(std::move(receiver), rfh);
+}
+
// static
void BraveShieldsWebContentsObserver::DispatchBlockedEvent(
const GURL& request_url,
@@ -196,8 +218,8 @@ void BraveShieldsWebContentsObserver::DispatchBlockedEventForWebContents(
void BraveShieldsWebContentsObserver::OnJavaScriptBlocked(
const std::u16string& details) {
- WebContents* web_contents = WebContents::FromRenderFrameHost(
- brave_shields_receivers_.GetCurrentTargetFrame());
+ WebContents* web_contents =
+ WebContents::FromRenderFrameHost(receivers_.GetCurrentTargetFrame());
if (!web_contents)
return;
@@ -246,6 +268,19 @@ void BraveShieldsWebContentsObserver::AllowScriptsOnce(
allowed_script_origins_ = std::move(origins);
}
+// static
+void BraveShieldsWebContentsObserver::SetReceiverImplForTesting(
+ BraveShieldsWebContentsObserver* impl) {
+ g_receiver_impl_for_testing = impl;
+}
+
+void BraveShieldsWebContentsObserver::BindReceiver(
+ mojo::PendingAssociatedReceiver
+ receiver,
+ content::RenderFrameHost* rfh) {
+ receivers_.Bind(rfh, std::move(receiver));
+}
+
mojo::AssociatedRemote&
BraveShieldsWebContentsObserver::GetBraveShieldsRemote(
content::RenderFrameHost* rfh) {
diff --git a/browser/brave_shields/brave_shields_web_contents_observer.h b/browser/brave_shields/brave_shields_web_contents_observer.h
index d52f74320360..249c82e9dabb 100644
--- a/browser/brave_shields/brave_shields_web_contents_observer.h
+++ b/browser/brave_shields/brave_shields_web_contents_observer.h
@@ -15,8 +15,8 @@
#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "brave/components/brave_shields/common/brave_shields.mojom.h"
+#include "content/public/browser/render_frame_host_receiver_set.h"
#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_contents_receiver_set.h"
#include "content/public/browser/web_contents_user_data.h"
namespace content {
@@ -35,6 +35,11 @@ class BraveShieldsWebContentsObserver
explicit BraveShieldsWebContentsObserver(content::WebContents*);
~BraveShieldsWebContentsObserver() override;
+ static void BindBraveShieldsHost(
+ mojo::PendingAssociatedReceiver
+ receiver,
+ content::RenderFrameHost* rfh);
+
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
static void DispatchBlockedEventForWebContents(
const std::string& block_type,
@@ -63,11 +68,23 @@ class BraveShieldsWebContentsObserver
private:
friend class content::WebContentsUserData;
+ friend class BraveShieldsWebContentsObserverBrowserTest;
using BraveShieldsRemotesMap = base::flat_map<
content::RenderFrameHost*,
mojo::AssociatedRemote>;
+ // Allows indicating a implementor of brave_shields::mojom::BraveShieldsHost
+ // other than this own class, for testing purposes only.
+ static void SetReceiverImplForTesting(BraveShieldsWebContentsObserver* impl);
+
+ // Only used from the BindBraveShieldsHost() static method, useful to bind the
+ // mojo receiver of brave_shields::mojom::BraveShieldsHost to a different
+ // implementor when needed, for testing purposes.
+ void BindReceiver(mojo::PendingAssociatedReceiver<
+ brave_shields::mojom::BraveShieldsHost> receiver,
+ content::RenderFrameHost* rfh);
+
// Return an already bound remote for the brave_shields::mojom::BraveShields
// mojo interface. It is an error to call this method with an invalid |rfh|.
mojo::AssociatedRemote&
@@ -78,8 +95,8 @@ class BraveShieldsWebContentsObserver
// continually tries to load the same blocked URLs.
std::set blocked_url_paths_;
- content::WebContentsFrameReceiverSet
- brave_shields_receivers_;
+ content::RenderFrameHostReceiverSet
+ receivers_;
// Map of remote endpoints for the brave_shields::mojom::BraveShields mojo
// interface, to prevent binding a new remote each time it's used.
diff --git a/browser/brave_shields/brave_shields_web_contents_observer_browsertest.cc b/browser/brave_shields/brave_shields_web_contents_observer_browsertest.cc
index 63d929a149e3..973614ac6f1b 100644
--- a/browser/brave_shields/brave_shields_web_contents_observer_browsertest.cc
+++ b/browser/brave_shields/brave_shields_web_contents_observer_browsertest.cc
@@ -66,14 +66,20 @@ class BraveShieldsWebContentsObserverBrowserTest : public InProcessBrowserTest {
HostContentSettingsMapFactory::GetForProfile(browser()->profile());
// We can't simply create a new BraveShieldsWebContentsObserver for the same
- // WebContents, as that class will instatiate a WebContentsFrameReceiverSet
- // and we can't have two at the same time for the same mojo interface. Thus,
- // we need to remove the one created along with the initialization of the
- // browser process before creating the one we need for testing.
- content::RemoveWebContentsReceiverSet(
- GetWebContents(), brave_shields::mojom::BraveShieldsHost::Name_);
+ // WebContents, as that class will instatiate a RenderFrameHostReceiverSet
+ // and we won't be able to intercept the mojo messages received for the
+ // brave_shields::mojom::BraveShieldsHost interface for testing purposes.
+ // Instead we call SetReceiverImplForTesting() to make sure that the mojo
+ // receiver will be bound to our TestBraveShieldsWebContentsObserver class,
+ // allowing us to intercept any message we are interested in.
brave_shields_web_contents_observer_ =
new TestBraveShieldsWebContentsObserver(GetWebContents());
+ BraveShieldsWebContentsObserver::SetReceiverImplForTesting(
+ brave_shields_web_contents_observer_);
+ }
+
+ void TearDownOnMainThread() override {
+ BraveShieldsWebContentsObserver::SetReceiverImplForTesting(nullptr);
}
content::WebContents* GetWebContents() {
diff --git a/browser/brave_stats/brave_stats_updater_params.cc b/browser/brave_stats/brave_stats_updater_params.cc
index eadfd78a92bb..7c88e7d1be35 100644
--- a/browser/brave_stats/brave_stats_updater_params.cc
+++ b/browser/brave_stats/brave_stats_updater_params.cc
@@ -8,6 +8,7 @@
#include "brave/browser/brave_stats/brave_stats_updater_params.h"
#include "brave/components/brave_referrals/buildflags/buildflags.h"
+#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "base/threading/thread_restrictions.h"
diff --git a/browser/brave_wallet/brave_wallet_provider_delegate_impl.cc b/browser/brave_wallet/brave_wallet_provider_delegate_impl.cc
index fd22ec75f892..b18b64860f41 100644
--- a/browser/brave_wallet/brave_wallet_provider_delegate_impl.cc
+++ b/browser/brave_wallet/brave_wallet_provider_delegate_impl.cc
@@ -44,7 +44,7 @@ BraveWalletProviderDelegateImpl::BraveWalletProviderDelegateImpl(
content::WebContents* web_contents,
content::RenderFrameHost* const render_frame_host)
: web_contents_(web_contents),
- routing_id_(render_frame_host->GetGlobalFrameRoutingId()),
+ host_id_(render_frame_host->GetGlobalId()),
weak_ptr_factory_(this) {}
BraveWalletProviderDelegateImpl::~BraveWalletProviderDelegateImpl() = default;
@@ -79,7 +79,7 @@ void BraveWalletProviderDelegateImpl::RequestEthereumPermissions(
base::BindOnce(&OnRequestEthereumPermissions,
keyring_info->accounts, std::move(callback)));
},
- content::RenderFrameHost::FromID(routing_id_), std::move(callback)));
+ content::RenderFrameHost::FromID(host_id_), std::move(callback)));
}
} // namespace brave_wallet
diff --git a/browser/brave_wallet/brave_wallet_provider_delegate_impl.h b/browser/brave_wallet/brave_wallet_provider_delegate_impl.h
index 75d7a0c31dc9..db0786ccf065 100644
--- a/browser/brave_wallet/brave_wallet_provider_delegate_impl.h
+++ b/browser/brave_wallet/brave_wallet_provider_delegate_impl.h
@@ -39,7 +39,7 @@ class BraveWalletProviderDelegateImpl : public BraveWalletProviderDelegate {
mojo::Remote keyring_controller_;
content::WebContents* web_contents_;
- const content::GlobalFrameRoutingId routing_id_;
+ const content::GlobalRenderFrameHostId host_id_;
base::WeakPtrFactory weak_ptr_factory_;
};
diff --git a/browser/download/brave_download_item_model_unittest.cc b/browser/download/brave_download_item_model_unittest.cc
index c7932e1c370f..d7f1f9505162 100644
--- a/browser/download/brave_download_item_model_unittest.cc
+++ b/browser/download/brave_download_item_model_unittest.cc
@@ -10,10 +10,10 @@
#include
+#include "base/cxx17_backports.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
diff --git a/browser/extensions/api/settings_private/brave_prefs_util.cc b/browser/extensions/api/settings_private/brave_prefs_util.cc
index c17d616815ba..564fd25fa419 100644
--- a/browser/extensions/api/settings_private/brave_prefs_util.cc
+++ b/browser/extensions/api/settings_private/brave_prefs_util.cc
@@ -230,9 +230,6 @@ const PrefsUtil::TypedPrefMap& BravePrefsUtil::GetAllowlistedKeys() {
(*s_brave_allowlist)[kIpfsStorageMax] =
settings_api::PrefType::PREF_TYPE_NUMBER;
#endif
- // Media Router Pref
- (*s_brave_allowlist)[kBraveEnabledMediaRouter] =
- settings_api::PrefType::PREF_TYPE_BOOLEAN;
#if !BUILDFLAG(USE_GCM_FROM_PLATFORM)
// Push Messaging Pref
diff --git a/browser/extensions/ethereum_remote_client_unittest.cc b/browser/extensions/ethereum_remote_client_unittest.cc
index e7adbc4a3c08..c7a2294b93a5 100644
--- a/browser/extensions/ethereum_remote_client_unittest.cc
+++ b/browser/extensions/ethereum_remote_client_unittest.cc
@@ -5,6 +5,8 @@
#include "brave/browser/ethereum_remote_client/ethereum_remote_client_service.h"
+#include
+
#include "brave/browser/ethereum_remote_client/pref_names.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/test/base/testing_browser_process.h"
@@ -46,77 +48,83 @@ TEST_F(BraveWalletUnitTest, TestGetRandomSeed) {
}
TEST_F(BraveWalletUnitTest, TestGetEthereumRemoteClientSeedFromRootSeed) {
- const char seed[32] = {48, 196, 56, 174, 243, 75, 120, 235, 37, 174, 254,
- 97, 37, 205, 101, 93, 181, 23, 190, 82, 53, 180,
- 51, 198, 232, 187, 188, 220, 160, 187, 212, 28};
- const char expected_derived_seed[32] = {
+ constexpr std::array seed = {
+ 48, 196, 56, 174, 243, 75, 120, 235, 37, 174, 254,
+ 97, 37, 205, 101, 93, 181, 23, 190, 82, 53, 180,
+ 51, 198, 232, 187, 188, 220, 160, 187, 212, 28};
+ constexpr std::array expected_derived_seed = {
142, 147, 10, 180, 36, 89, 142, 110, 52, 85, 216,
222, 83, 56, 38, 206, 104, 133, 77, 246, 219, 90,
105, 35, 52, 76, 223, 24, 183, 138, 244, 72};
std::string derived =
EthereumRemoteClientService::GetEthereumRemoteClientSeedFromRootSeed(
- std::string(seed, base::size(seed)));
- ASSERT_EQ(derived, std::string(expected_derived_seed,
- base::size(expected_derived_seed)));
+ std::string(seed.begin(), seed.end()));
+ ASSERT_EQ(derived, std::string(expected_derived_seed.begin(),
+ expected_derived_seed.end()));
}
TEST_F(BraveWalletUnitTest, TestBitGoSeedFromRootSeed) {
- const char seed[32] = {48, 196, 56, 174, 243, 75, 120, 235, 37, 174, 254,
- 97, 37, 205, 101, 93, 181, 23, 190, 82, 53, 180,
- 51, 198, 232, 187, 188, 220, 160, 187, 212, 28};
- const char expected_derived_seed[32] = {
+ constexpr std::array seed = {
+ 48, 196, 56, 174, 243, 75, 120, 235, 37, 174, 254,
+ 97, 37, 205, 101, 93, 181, 23, 190, 82, 53, 180,
+ 51, 198, 232, 187, 188, 220, 160, 187, 212, 28};
+ constexpr std::array expected_derived_seed = {
101, 6, 89, 61, 129, 81, 104, 13, 48, 59, 117,
46, 73, 177, 168, 248, 91, 84, 145, 54, 61, 157,
27, 254, 45, 203, 71, 123, 188, 29, 224, 203};
std::string derived = EthereumRemoteClientService::GetBitGoSeedFromRootSeed(
- std::string(seed, base::size(seed)));
- ASSERT_EQ(derived, std::string(expected_derived_seed,
- base::size(expected_derived_seed)));
+ std::string(seed.begin(), seed.end()));
+ ASSERT_EQ(derived, std::string(expected_derived_seed.begin(),
+ expected_derived_seed.end()));
}
TEST_F(BraveWalletUnitTest, TestSealSeed) {
- const char seed[32] = {48, 196, 56, 174, 243, 75, 120, 235, 37, 174, 254,
- 97, 37, 205, 101, 93, 181, 23, 190, 82, 53, 180,
- 51, 198, 232, 187, 188, 220, 160, 187, 212, 28};
- const char key[32] = {196, 34, 104, 152, 91, 63, 78, 171, 234, 163, 25,
- 221, 80, 73, 158, 89, 52, 53, 227, 231, 152, 214,
- 61, 210, 33, 54, 68, 171, 140, 239, 3, 158};
- const char nonce[12] = {200, 153, 224, 40, 58, 249,
- 156, 33, 152, 207, 177, 12};
- const char expected_cipher_seed[48] = {
+ constexpr std::array seed = {
+ 48, 196, 56, 174, 243, 75, 120, 235, 37, 174, 254,
+ 97, 37, 205, 101, 93, 181, 23, 190, 82, 53, 180,
+ 51, 198, 232, 187, 188, 220, 160, 187, 212, 28};
+ constexpr std::array key = {
+ 196, 34, 104, 152, 91, 63, 78, 171, 234, 163, 25,
+ 221, 80, 73, 158, 89, 52, 53, 227, 231, 152, 214,
+ 61, 210, 33, 54, 68, 171, 140, 239, 3, 158};
+ constexpr std::array nonce = {200, 153, 224, 40, 58, 249,
+ 156, 33, 152, 207, 177, 12};
+ constexpr std::array expected_cipher_seed = {
33, 11, 185, 125, 67, 27, 92, 110, 132, 238, 255, 8,
79, 7, 8, 40, 189, 211, 35, 122, 236, 183, 66, 212,
213, 68, 187, 103, 16, 138, 166, 0, 6, 128, 179, 64,
55, 160, 219, 8, 222, 231, 48, 93, 132, 131, 178, 177};
std::string cipher_seed;
ASSERT_TRUE(EthereumRemoteClientService::SealSeed(
- std::string(seed, base::size(seed)), std::string(key, base::size(key)),
- std::string(nonce, base::size(nonce)), &cipher_seed));
- ASSERT_EQ(cipher_seed, std::string(expected_cipher_seed,
- base::size(expected_cipher_seed)));
+ std::string(seed.begin(), seed.end()),
+ std::string(key.begin(), key.end()),
+ std::string(nonce.begin(), nonce.end()), &cipher_seed));
+ ASSERT_EQ(cipher_seed, std::string(expected_cipher_seed.begin(),
+ expected_cipher_seed.end()));
}
TEST_F(BraveWalletUnitTest, TestOpenSeed) {
- const char cipher_seed[48] = {
+ constexpr std::array cipher_seed = {
33, 11, 185, 125, 67, 27, 92, 110, 132, 238, 255, 8,
79, 7, 8, 40, 189, 211, 35, 122, 236, 183, 66, 212,
213, 68, 187, 103, 16, 138, 166, 0, 6, 128, 179, 64,
55, 160, 219, 8, 222, 231, 48, 93, 132, 131, 178, 177};
- const char key[32] = {196, 34, 104, 152, 91, 63, 78, 171, 234, 163, 25,
- 221, 80, 73, 158, 89, 52, 53, 227, 231, 152, 214,
- 61, 210, 33, 54, 68, 171, 140, 239, 3, 158};
- const char nonce[12] = {200, 153, 224, 40, 58, 249,
- 156, 33, 152, 207, 177, 12};
- const char expected_seed[32] = {48, 196, 56, 174, 243, 75, 120, 235,
- 37, 174, 254, 97, 37, 205, 101, 93,
- 181, 23, 190, 82, 53, 180, 51, 198,
- 232, 187, 188, 220, 160, 187, 212, 28};
+ constexpr std::array key = {
+ 196, 34, 104, 152, 91, 63, 78, 171, 234, 163, 25,
+ 221, 80, 73, 158, 89, 52, 53, 227, 231, 152, 214,
+ 61, 210, 33, 54, 68, 171, 140, 239, 3, 158};
+ constexpr std::array nonce = {200, 153, 224, 40, 58, 249,
+ 156, 33, 152, 207, 177, 12};
+ constexpr std::array expected_seed = {
+ 48, 196, 56, 174, 243, 75, 120, 235, 37, 174, 254,
+ 97, 37, 205, 101, 93, 181, 23, 190, 82, 53, 180,
+ 51, 198, 232, 187, 188, 220, 160, 187, 212, 28};
std::string seed;
ASSERT_TRUE(EthereumRemoteClientService::OpenSeed(
- std::string(cipher_seed, base::size(cipher_seed)),
- std::string(key, base::size(key)), std::string(nonce, base::size(nonce)),
- &seed));
- ASSERT_EQ(seed, std::string(expected_seed, 32));
+ std::string(cipher_seed.begin(), cipher_seed.end()),
+ std::string(key.begin(), key.end()),
+ std::string(nonce.begin(), nonce.end()), &seed));
+ ASSERT_EQ(seed, std::string(expected_seed.begin(), expected_seed.end()));
}
TEST_F(BraveWalletUnitTest, TestLoadFromPrefs) {
@@ -131,30 +139,31 @@ TEST_F(BraveWalletUnitTest, TestLoadFromPrefs) {
ProfileManager::GetActiveUserProfile()->GetPrefs(), &cipher_seed,
&nonce));
- const char expected_nonce[12] = {200, 153, 224, 40, 58, 249,
- 156, 33, 152, 207, 177, 12};
- const char expected_cipher_seed[48] = {
+ constexpr std::array expected_nonce = {
+ 200, 153, 224, 40, 58, 249, 156, 33, 152, 207, 177, 12};
+ constexpr std::array expected_cipher_seed = {
33, 11, 185, 125, 67, 27, 92, 110, 132, 238, 255, 8,
79, 7, 8, 40, 189, 211, 35, 122, 236, 183, 66, 212,
213, 68, 187, 103, 16, 138, 166, 0, 6, 128, 179, 64,
55, 160, 219, 8, 222, 231, 48, 93, 132, 131, 178, 177};
- ASSERT_EQ(nonce, std::string(expected_nonce, base::size(expected_nonce)));
- ASSERT_EQ(std::string(expected_cipher_seed, base::size(expected_cipher_seed)),
- cipher_seed);
+ ASSERT_EQ(nonce, std::string(expected_nonce.begin(), expected_nonce.end()));
+ ASSERT_EQ(
+ std::string(expected_cipher_seed.begin(), expected_cipher_seed.end()),
+ cipher_seed);
}
TEST_F(BraveWalletUnitTest, TestSaveToPrefs) {
- const char nonce[12] = {200, 153, 224, 40, 58, 249,
- 156, 33, 152, 207, 177, 12};
- const char cipher_seed[48] = {
+ constexpr std::array nonce = {200, 153, 224, 40, 58, 249,
+ 156, 33, 152, 207, 177, 12};
+ constexpr std::array cipher_seed = {
33, 11, 185, 125, 67, 27, 92, 110, 132, 238, 255, 8,
79, 7, 8, 40, 189, 211, 35, 122, 236, 183, 66, 212,
213, 68, 187, 103, 16, 138, 166, 0, 6, 128, 179, 64,
55, 160, 219, 8, 222, 231, 48, 93, 132, 131, 178, 177};
EthereumRemoteClientService::SaveToPrefs(
ProfileManager::GetActiveUserProfile()->GetPrefs(),
- std::string(cipher_seed, base::size(cipher_seed)),
- std::string(nonce, base::size(nonce)));
+ std::string(cipher_seed.begin(), cipher_seed.end()),
+ std::string(nonce.begin(), nonce.end()));
ASSERT_EQ(GetPrefs()->GetString(kERCAES256GCMSivNonce), "yJngKDr5nCGYz7EM");
ASSERT_EQ(GetPrefs()->GetString(kERCEncryptedSeed),
diff --git a/browser/net/brave_proxying_url_loader_factory.cc b/browser/net/brave_proxying_url_loader_factory.cc
index 784bd0dfa4c6..34813f9bd7d1 100644
--- a/browser/net/brave_proxying_url_loader_factory.cc
+++ b/browser/net/brave_proxying_url_loader_factory.cc
@@ -30,6 +30,7 @@
#include "net/url_request/url_request.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/parsed_headers.h"
+#include "services/network/public/mojom/early_hints.mojom.h"
#include "url/origin.h"
namespace {
@@ -577,15 +578,14 @@ void BraveProxyingURLLoaderFactory::InProgressRequest::
override_headers_ = nullptr;
redirect_url_ = GURL();
- net::CompletionRepeatingCallback copyable_callback =
- base::AdaptCallbackForRepeating(std::move(continuation));
+ auto split_once_callback = base::SplitOnceCallback(std::move(continuation));
if (request_.url.SchemeIsHTTPOrHTTPS()) {
ctx_ = brave::BraveRequestInfo::MakeCTX(request_, render_process_id_,
frame_tree_node_id_, request_id_,
browser_context_, ctx_);
int result = factory_->request_handler_->OnHeadersReceived(
- ctx_, copyable_callback, current_response_->headers.get(),
- &override_headers_, &redirect_url_);
+ ctx_, std::move(split_once_callback.first),
+ current_response_->headers.get(), &override_headers_, &redirect_url_);
if (result == net::ERR_BLOCKED_BY_CLIENT) {
OnRequestError(network::URLLoaderCompletionStatus(result));
@@ -605,7 +605,7 @@ void BraveProxyingURLLoaderFactory::InProgressRequest::
DCHECK_EQ(net::OK, result);
}
- copyable_callback.Run(net::OK);
+ std::move(split_once_callback.second).Run(net::OK);
}
void BraveProxyingURLLoaderFactory::InProgressRequest::OnRequestError(
diff --git a/browser/net/brave_proxying_url_loader_factory.h b/browser/net/brave_proxying_url_loader_factory.h
index 989eeafb7064..cdf96d2b7d3b 100644
--- a/browser/net/brave_proxying_url_loader_factory.h
+++ b/browser/net/brave_proxying_url_loader_factory.h
@@ -28,9 +28,11 @@
#include "net/base/completion_once_callback.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
+#include "services/network/public/mojom/early_hints.mojom-forward.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
+#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
diff --git a/browser/net/brave_request_handler.cc b/browser/net/brave_request_handler.cc
index 10f55299e03a..7f76aeaa90eb 100644
--- a/browser/net/brave_request_handler.cc
+++ b/browser/net/brave_request_handler.cc
@@ -8,6 +8,7 @@
#include
#include
+#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/task/post_task.h"
#include "brave/browser/net/brave_ad_block_csp_network_delegate_helper.h"
diff --git a/browser/net/brave_site_hacks_network_delegate_helper_browsertest.cc b/browser/net/brave_site_hacks_network_delegate_helper_browsertest.cc
index 21ead2938ab4..f5776371ea70 100644
--- a/browser/net/brave_site_hacks_network_delegate_helper_browsertest.cc
+++ b/browser/net/brave_site_hacks_network_delegate_helper_browsertest.cc
@@ -4,6 +4,7 @@
* You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "base/base64url.h"
+#include "base/cxx17_backports.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "brave/common/brave_paths.h"
diff --git a/browser/net/brave_system_request_handler_browsertest.cc b/browser/net/brave_system_request_handler_browsertest.cc
index 831d8cabbb75..b2c52d41ed47 100644
--- a/browser/net/brave_system_request_handler_browsertest.cc
+++ b/browser/net/brave_system_request_handler_browsertest.cc
@@ -16,6 +16,7 @@
#include "net/test/embedded_test_server/http_request.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_ANDROID)
diff --git a/browser/net/url_context.cc b/browser/net/url_context.cc
index 91bdfae3ea3d..cca405441685 100644
--- a/browser/net/url_context.cc
+++ b/browser/net/url_context.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/isolation_info.h"
+#include "services/network/public/cpp/resource_request.h"
#if BUILDFLAG(IPFS_ENABLED)
#include "brave/components/ipfs/ipfs_constants.h"
diff --git a/browser/profiles/brave_profile_impl.cc b/browser/profiles/brave_profile_impl.cc
index 4bbfc374df32..4ddf04c5a95d 100644
--- a/browser/profiles/brave_profile_impl.cc
+++ b/browser/profiles/brave_profile_impl.cc
@@ -54,5 +54,6 @@ void BraveProfileImpl::OnProfileWillBeDestroyed(Profile* profile) {
// this only happens when a profile is deleted because the profile manager
// ensures that session profiles are destroyed before their parents
// passing false for `success` removes the profile from the info cache
- g_browser_process->profile_manager()->OnProfileCreated(this, false, false);
+ g_browser_process->profile_manager()->OnProfileCreationFinished(
+ this, Profile::CREATE_MODE_ASYNCHRONOUS, false, false);
}
diff --git a/browser/profiles/brave_profile_manager.cc b/browser/profiles/brave_profile_manager.cc
index 6bfb3a813c74..e158973c65eb 100644
--- a/browser/profiles/brave_profile_manager.cc
+++ b/browser/profiles/brave_profile_manager.cc
@@ -72,7 +72,8 @@ BraveProfileManager::~BraveProfileManager() {
for (Profile* profile : profiles) {
if (brave::IsSessionProfile(profile)) {
// passing false for `success` removes the profile from the info cache
- OnProfileCreated(profile, false, false);
+ OnProfileCreationFinished(profile, Profile::CREATE_MODE_ASYNCHRONOUS,
+ false, false);
}
}
RemoveObserver(this);
diff --git a/browser/renderer_context_menu/brave_spelling_options_submenu_observer_browsertest.cc b/browser/renderer_context_menu/brave_spelling_options_submenu_observer_browsertest.cc
index 9bbfed88271e..bbd1fc97834f 100644
--- a/browser/renderer_context_menu/brave_spelling_options_submenu_observer_browsertest.cc
+++ b/browser/renderer_context_menu/brave_spelling_options_submenu_observer_browsertest.cc
@@ -70,8 +70,10 @@ class BraveSpellingOptionsSubMenuObserverTest : public InProcessBrowserTest {
enable_spellcheck);
menu()->GetPrefs()->SetString(language::prefs::kAcceptLanguages,
accept_languages);
- base::ListValue dictionaries_value;
- dictionaries_value.AppendStrings(dictionaries);
+ base::Value dictionaries_value(base::Value::Type::LIST);
+ for (auto dictionary : dictionaries) {
+ dictionaries_value.Append(dictionary);
+ }
menu()->GetPrefs()->Set(spellcheck::prefs::kSpellCheckDictionaries,
dictionaries_value);
observer()->InitMenu(content::ContextMenuParams());
diff --git a/browser/resources/extensions/BUILD.gn b/browser/resources/extensions/BUILD.gn
index 710dafcd3d76..493c6c7fe27f 100644
--- a/browser/resources/extensions/BUILD.gn
+++ b/browser/resources/extensions/BUILD.gn
@@ -5,7 +5,13 @@ import("//tools/grit/preprocess_if_expr.gni")
import("//tools/polymer/polymer.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
-preprocess_folder = "preprocessed"
+# Due to the JavaScript -> TypeScript migration happening upstream, we can no
+# longer use 'preprocessed' as the dirname below since generated files will be
+# now placed under gen/chrome/browser/resources/extensions/tsc instead. Thus,
+# let's adjust the preprocessed directory to match that expectation while our
+# Brave-specific JavaScript files are not migrated to TypeScript.
+# See https://github.com/brave/brave-browser/issues/16553
+preprocess_folder = "tsc"
preprocess_manifest = "brave_preprocessed_manifest.json"
preprocess_gen_manifest = "brave_preprocessed_gen_manifest.json"
diff --git a/browser/resources/settings/BUILD.gn b/browser/resources/settings/BUILD.gn
index 75fcaa084099..485a4fa283e3 100644
--- a/browser/resources/settings/BUILD.gn
+++ b/browser/resources/settings/BUILD.gn
@@ -93,6 +93,7 @@ preprocess_if_expr("preprocess") {
"brave_overrides/appearance_page.js",
"brave_overrides/basic_page.js",
"brave_overrides/clear_browsing_data_dialog.js",
+ "brave_overrides/config.js",
"brave_overrides/cookies_page.js",
"brave_overrides/default_browser_page.js",
"brave_overrides/icons.js",
@@ -114,6 +115,7 @@ preprocess_if_expr("preprocess") {
"brave_overrides/site_settings_page.js",
"brave_overrides/sync_account_control.js",
"brave_overrides/sync_controls.js",
+ "brave_routes.js",
"brave_sync_page/brave_sync_browser_proxy.js",
]
}
diff --git a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.js b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.js
index 59ee9b4a6791..478182c5da1a 100644
--- a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.js
+++ b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.js
@@ -115,5 +115,5 @@ const BraveClearBrowsingDataOnExitBehaviorImpl = {
// Extend I18nBehavior so that we can use i18n.
export const BraveClearBrowsingDataOnExitBehavior = [
- I18nBehavior, BraveClearBrowsingDataOnExitBehaviorImpl
+ BraveClearBrowsingDataOnExitBehaviorImpl
]
diff --git a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html
index e1fdc5ce80b1..a656adf80bbf 100644
--- a/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html
+++ b/browser/resources/settings/brave_default_extensions_page/brave_default_extensions_page.html
@@ -102,13 +102,6 @@
menu-options="[[ensResolveMethod_]]">
-
-
+ `${attribute}="${childAttributes[attribute]}"`)
+ .join(' ')
+ // This needs to be inside a template so that our components do not get created immediately.
+ // Otherwise the polymer bindings won't be setup correctly at first.
+ return html`
+
+ <${childName}
+ ${childAttributesString}
+ >
+ ${childName}>
+
+ `
}
RegisterStyleOverride(
@@ -63,56 +64,6 @@ RegisterStyleOverride(
RegisterPolymerTemplateModifications({
'settings-basic-page': (templateContent) => {
- // Routes
- const r = Router.getInstance().routes_
- if (!r.BASIC) {
- console.error('[Brave Settings Overrides] Routes: could not find BASIC page')
- }
- if (pageVisibility.getStarted) {
- r.GET_STARTED = r.BASIC.createSection('/getStarted', 'getStarted')
- // bring back people's /manageProfile (now in getStarted)
- r.MANAGE_PROFILE = r.GET_STARTED.createChild('/manageProfile');
- }
- r.SHIELDS = r.BASIC.createSection('/shields', 'shields')
- r.SOCIAL_BLOCKING = r.BASIC.createSection('/socialBlocking', 'socialBlocking')
- r.EXTENSIONS = r.BASIC.createSection('/extensions', 'extensions')
- if (pageVisibility.braveSync) {
- r.BRAVE_SYNC = r.BASIC.createSection('/braveSync', 'braveSync')
- r.BRAVE_SYNC_SETUP = r.BRAVE_SYNC.createChild('/braveSync/setup');
- }
- if (pageVisibility.braveIPFS) {
- r.BRAVE_IPFS = r.BASIC.createSection('/ipfs', 'ipfs')
- r.BRAVE_IPFS_KEYS = r.BRAVE_IPFS.createChild('/ipfs/keys');
- r.BRAVE_IPFS_PEERS = r.BRAVE_IPFS.createChild('/ipfs/peers');
- }
- if (pageVisibility.braveWallet) {
- r.BRAVE_WALLET = r.BASIC.createSection('/wallet', 'wallet')
- }
-
- r.BRAVE_HELP_TIPS = r.BASIC.createSection('/braveHelpTips', 'braveHelpTips')
- r.BRAVE_NEW_TAB = r.BASIC.createSection('/newTab', 'newTab')
- if (r.SITE_SETTINGS) {
- r.SITE_SETTINGS_AUTOPLAY = r.SITE_SETTINGS.createChild('autoplay')
- const isNativeBraveWalletFeatureEnabled = loadTimeData.getBoolean('isNativeBraveWalletFeatureEnabled')
- if (isNativeBraveWalletFeatureEnabled) {
- r.SITE_SETTINGS_ETHEREUM = r.SITE_SETTINGS.createChild('ethereum')
- }
- } else if (!isGuest) {
- console.error('[Brave Settings Overrides] Routes: could not find SITE_SETTINGS page')
- }
- // Autofill route is moved to advanced,
- // otherwise its sections won't show up when opened.
- if (r.AUTOFILL && r.ADVANCED) {
- r.AUTOFILL.parent = r.ADVANCED
- } else if (!isGuest) {
- console.error('[Brave Settings Overrides] Could not move autofill route to advanced route', r)
- }
- // Safety check route is moved to advanced.
- if (r.SAFETY_CHECK && r.ADVANCED) {
- r.SAFETY_CHECK.parent = r.ADVANCED
- } else if (!isGuest) {
- console.error('[Brave Settings Overrides] Could not move safety check route to advanced route', r)
- }
// Add 'Getting Started' section
// Entire content is wrapped in another conditional template
const actualTemplate = templateContent.querySelector('template')
diff --git a/browser/resources/settings/brave_overrides/config.js b/browser/resources/settings/brave_overrides/config.js
new file mode 100644
index 000000000000..1ab8dfb078f0
--- /dev/null
+++ b/browser/resources/settings/brave_overrides/config.js
@@ -0,0 +1,17 @@
+// Copyright (c) 2021 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/.
+
+import {RegisterPolymerComponentToIgnore} from 'chrome://brave-resources/polymer_overriding.js'
+
+// Replacing chromium polymer components with subclasses of them is a
+// 2-step process:
+// 1. Make sure we ignore the chromium components when they are defined
+// 2. Override the chromium components with a subclass and define the
+// components with their original chromium name.
+// (This is because the chomium components define themselves via customElements.define
+// in their module, so we want to register to ignore the component before the module
+// is imported).
+
+RegisterPolymerComponentToIgnore('settings-site-settings-page')
diff --git a/browser/resources/settings/brave_overrides/import_data_dialog.js b/browser/resources/settings/brave_overrides/import_data_dialog.js
index 11c238c3c710..5860ccec3b62 100644
--- a/browser/resources/settings/brave_overrides/import_data_dialog.js
+++ b/browser/resources/settings/brave_overrides/import_data_dialog.js
@@ -3,47 +3,23 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
-import {RegisterPolymerTemplateModifications, RegisterPolymerComponentBehaviors} from 'chrome://brave-resources/polymer_overriding.js'
+import {html, RegisterPolymerTemplateModifications, RegisterPolymerComponentBehaviors} from 'chrome://brave-resources/polymer_overriding.js'
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'
RegisterPolymerTemplateModifications({
'settings-import-data-dialog': (templateContent) => {
let checkBoxesParent = templateContent.querySelector('#browserSelect').parentElement;
- ['extensions', 'payments'].forEach((item) => {
- const checkbox = document.createElement('settings-checkbox')
- checkbox.setAttribute('hidden', `[[!selected_.${item}]]`)
- checkbox.setAttribute('pref', `{{prefs.import_dialog_${item}}}`)
- checkbox.setAttribute('label',
- I18nBehavior.i18n(`import${item[0].toUpperCase()}${item.slice(1)}`))
- checkbox.setAttribute('no-set-pref', '')
- checkBoxesParent.appendChild(checkbox)
- })
+ checkBoxesParent.appendChild(html`
+
+
+
+
+ `)
}
})
-
-RegisterPolymerComponentBehaviors({
- 'settings-import-data-dialog': [{
- registered: function () {
- const oldPrefsChanged = this.prefsChanged_
- if (!oldPrefsChanged) {
- console.error('[Brave Settings Overrides] cannot find prefsChanged_ on ImportDataDialog')
- return
- }
- this.prefsChanged_ = function () {
- if (typeof this.noImportDataTypeSelected_ !== 'boolean') {
- console.error('[Brave Settings Overrides] cannot find noImportDataTypeSelected_ on ImportDataDialog')
- return
- }
- oldPrefsChanged.apply(this)
- if (this.selected_ == undefined || this.prefs == undefined) {
- return;
- }
- this.noImportDataTypeSelected_ = this.noImportDataTypeSelected_ &&
- !(this.getPref('import_dialog_extensions').value &&
- this.selected_.extensions) &&
- !(this.getPref('import_dialog_payments').value &&
- this.selected_.payments)
- }
- }
- }]
-})
diff --git a/browser/resources/settings/brave_overrides/index.js b/browser/resources/settings/brave_overrides/index.js
index a64bf7beb6f1..6504f175f416 100644
--- a/browser/resources/settings/brave_overrides/index.js
+++ b/browser/resources/settings/brave_overrides/index.js
@@ -9,7 +9,8 @@
// where it is not consistant due to "network" responses) and
// optimized (rollup controls the order in which modules are executed).
-import { ContentSettingsTypes } from '../site_settings/constants'
+import './config.js'
+import { ContentSettingsTypes } from '../site_settings/constants.js'
ContentSettingsTypes.ETHEREUM = 'ethereum'
import './about_page.js'
import './appearance_page.js'
diff --git a/browser/resources/settings/brave_overrides/site_settings_page.js b/browser/resources/settings/brave_overrides/site_settings_page.js
index c6f9cd5e01c3..f5be8ed30d21 100644
--- a/browser/resources/settings/brave_overrides/site_settings_page.js
+++ b/browser/resources/settings/brave_overrides/site_settings_page.js
@@ -3,9 +3,11 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
-import {RegisterPolymerComponentBehaviors} from 'chrome://brave-resources/polymer_overriding.js'
+import {define, RegisterPolymerComponentReplacement} from 'chrome://brave-resources/polymer_overriding.js'
import {ContentSettingsTypes} from '../site_settings/constants.js'
+import {SettingsSiteSettingsPageElement} from '../site_settings_page/site_settings_page.js'
import {routes} from '../route.js'
+import './config.js'
const PERMISSIONS_BASIC_REMOVE_IDS = [
ContentSettingsTypes.BACKGROUND_SYNC,
@@ -14,15 +16,17 @@ const CONTENT_ADVANCED_REMOVE_IDS = [
ContentSettingsTypes.ADS,
]
-RegisterPolymerComponentBehaviors({
- 'settings-site-settings-page': [{
- registered: function() {
- if (!this.properties || !this.properties.lists_ || !this.properties.lists_.value) {
+RegisterPolymerComponentReplacement(
+ 'settings-site-settings-page',
+ class BraveComponent extends SettingsSiteSettingsPageElement {
+ static get properties() {
+ const properties = SettingsSiteSettingsPageElement.properties
+ if (!properties || !properties.lists_ || !properties.lists_.value) {
console.error('[Brave Settings Overrides] Could not find polymer lists_ property')
return
}
- const oldListsGetter = this.properties.lists_.value
- this.properties.lists_.value = function () {
+ const oldListsGetter = properties.lists_.value
+ properties.lists_.value = function () {
const lists_ = oldListsGetter()
if (!lists_) {
console.error('[Brave Settings Overrides] did not get lists_ data')
@@ -72,6 +76,7 @@ RegisterPolymerComponentBehaviors({
}
return lists_
}
+ return properties
}
- }]
-})
+ }
+)
diff --git a/browser/resources/settings/brave_routes.js b/browser/resources/settings/brave_routes.js
new file mode 100644
index 000000000000..30616d29990e
--- /dev/null
+++ b/browser/resources/settings/brave_routes.js
@@ -0,0 +1,62 @@
+// Copyright (c) 2021 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/.
+
+import {pageVisibility} from './brave_overrides/page_visibility.js'
+
+export default function addBraveRoutes(r) {
+ if (!r.BASIC) {
+ console.error('[Brave Settings Overrides] Routes: could not find BASIC page')
+ }
+ if (r.SITE_SETTINGS_ADS) {
+ delete r.SITE_SETTINGS_ADS
+ } else {
+ console.error('[Brave Settings Overrides] could not find expected route site_settings_ads')
+ }
+ if (pageVisibility.getStarted) {
+ r.GET_STARTED = r.BASIC.createSection('/getStarted', 'getStarted')
+ // bring back people's /manageProfile (now in getStarted)
+ r.MANAGE_PROFILE = r.GET_STARTED.createChild('/manageProfile');
+ }
+ r.SHIELDS = r.BASIC.createSection('/shields', 'shields')
+ r.SOCIAL_BLOCKING = r.BASIC.createSection('/socialBlocking', 'socialBlocking')
+ r.EXTENSIONS = r.BASIC.createSection('/extensions', 'extensions')
+ if (pageVisibility.braveSync) {
+ r.BRAVE_SYNC = r.BASIC.createSection('/braveSync', 'braveSync')
+ r.BRAVE_SYNC_SETUP = r.BRAVE_SYNC.createChild('/braveSync/setup');
+ }
+ if (pageVisibility.braveIPFS) {
+ r.BRAVE_IPFS = r.BASIC.createSection('/ipfs', 'ipfs')
+ r.BRAVE_IPFS_KEYS = r.BRAVE_IPFS.createChild('/ipfs/keys');
+ r.BRAVE_IPFS_PEERS = r.BRAVE_IPFS.createChild('/ipfs/peers');
+ }
+ if (pageVisibility.braveWallet) {
+ r.BRAVE_WALLET = r.BASIC.createSection('/wallet', 'wallet')
+ }
+
+ r.BRAVE_HELP_TIPS = r.BASIC.createSection('/braveHelpTips', 'braveHelpTips')
+ r.BRAVE_NEW_TAB = r.BASIC.createSection('/newTab', 'newTab')
+ if (r.SITE_SETTINGS) {
+ r.SITE_SETTINGS_AUTOPLAY = r.SITE_SETTINGS.createChild('autoplay')
+ const isNativeBraveWalletFeatureEnabled = loadTimeData.getBoolean('isNativeBraveWalletFeatureEnabled')
+ if (isNativeBraveWalletFeatureEnabled) {
+ r.SITE_SETTINGS_ETHEREUM = r.SITE_SETTINGS.createChild('ethereum')
+ }
+ } else if (!isGuest) {
+ console.error('[Brave Settings Overrides] Routes: could not find SITE_SETTINGS page')
+ }
+ // Autofill route is moved to advanced,
+ // otherwise its sections won't show up when opened.
+ if (r.AUTOFILL && r.ADVANCED) {
+ r.AUTOFILL.parent = r.ADVANCED
+ } else if (!isGuest) {
+ console.error('[Brave Settings Overrides] Could not move autofill route to advanced route', r)
+ }
+ // Safety check route is moved to advanced.
+ if (r.SAFETY_CHECK && r.ADVANCED) {
+ r.SAFETY_CHECK.parent = r.ADVANCED
+ } else if (!isGuest) {
+ console.error('[Brave Settings Overrides] Could not move safety check route to advanced route', r)
+ }
+}
\ No newline at end of file
diff --git a/browser/search/BUILD.gn b/browser/search/BUILD.gn
index 8789a2f42fe3..533ae575d132 100644
--- a/browser/search/BUILD.gn
+++ b/browser/search/BUILD.gn
@@ -17,6 +17,7 @@ source_set("search") {
"//brave/common:pref_names",
"//brave/components/crypto_dot_com/browser/buildflags",
"//brave/components/crypto_dot_com/common",
+ "//chrome/browser/ui",
"//chrome/common",
"//components/pref_registry",
"//components/prefs",
diff --git a/browser/search/ntp_utils.cc b/browser/search/ntp_utils.cc
index ba50fefc567e..b132a4618433 100644
--- a/browser/search/ntp_utils.cc
+++ b/browser/search/ntp_utils.cc
@@ -9,7 +9,7 @@
#include "brave/browser/profiles/profile_util.h"
#include "brave/common/pref_names.h"
#include "brave/components/crypto_dot_com/browser/buildflags/buildflags.h"
-#include "chrome/common/pref_names.h"
+#include "chrome/browser/ui/webui/new_tab_page/ntp_pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
@@ -46,8 +46,8 @@ void MigrateNewTabPagePrefs(Profile* profile) {
const PrefService::Preference* top_sites_pref =
prefs->FindPreference(kNewTabPageShowTopSites);
if (top_sites_pref->HasUserSetting()) {
- prefs->SetBoolean(prefs::kNtpShortcutsVisible,
- prefs->GetBoolean(kNewTabPageShowTopSites));
+ prefs->SetBoolean(ntp_prefs::kNtpShortcutsVisible,
+ prefs->GetBoolean(kNewTabPageShowTopSites));
}
// The toggle to turn off all widgets used to simply turn off
diff --git a/browser/sync/BUILD.gn b/browser/sync/BUILD.gn
index f11813fb7547..a73560eb6104 100644
--- a/browser/sync/BUILD.gn
+++ b/browser/sync/BUILD.gn
@@ -2,8 +2,8 @@ source_set("sync") {
check_includes = false
sources = [
- "brave_profile_sync_service_delegate.cc",
- "brave_profile_sync_service_delegate.h",
+ "brave_sync_service_impl_delegate.cc",
+ "brave_sync_service_impl_delegate.h",
]
deps = [
diff --git a/browser/sync/brave_sync_devices_android.cc b/browser/sync/brave_sync_devices_android.cc
index d7a3da5f22f1..c67f3b644870 100644
--- a/browser/sync/brave_sync_devices_android.cc
+++ b/browser/sync/brave_sync_devices_android.cc
@@ -13,13 +13,13 @@
#include "base/json/json_writer.h"
#include "brave/build/android/jni_headers/BraveSyncDevices_jni.h"
-#include "brave/components/brave_sync/profile_sync_service_helper.h"
-#include "brave/components/sync/driver/brave_sync_profile_sync_service.h"
+#include "brave/components/brave_sync/sync_service_impl_helper.h"
+#include "brave/components/sync/driver/brave_sync_service_impl.h"
#include "brave/components/sync_device_info/brave_device_info.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sync/device_info_sync_service_factory.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/sync_service_factory.h"
#include "components/sync_device_info/device_info_sync_service.h"
#include "components/sync_device_info/device_info_tracker.h"
@@ -102,11 +102,10 @@ BraveSyncDevicesAndroid::GetSyncDeviceListJson(JNIEnv* env) {
}
// TODO(AlexeyBarabash): duplicate with BraveSyncWorker?
-syncer::BraveProfileSyncService* BraveSyncDevicesAndroid::GetSyncService()
- const {
- return ProfileSyncServiceFactory::IsSyncAllowed(profile_)
- ? static_cast(
- ProfileSyncServiceFactory::GetForProfile(profile_))
+syncer::BraveSyncServiceImpl* BraveSyncDevicesAndroid::GetSyncService() const {
+ return SyncServiceFactory::IsSyncAllowed(profile_)
+ ? static_cast(
+ SyncServiceFactory::GetForProfile(profile_))
: nullptr;
}
diff --git a/browser/sync/brave_sync_devices_android.h b/browser/sync/brave_sync_devices_android.h
index b8a71499e43e..e0edde5a0a33 100644
--- a/browser/sync/brave_sync_devices_android.h
+++ b/browser/sync/brave_sync_devices_android.h
@@ -11,11 +11,12 @@
#include "base/android/jni_weak_ref.h"
#include "base/scoped_observation.h"
#include "base/values.h"
-#include "chrome/browser/sync/profile_sync_service_android.h"
#include "components/sync_device_info/device_info_tracker.h"
+class Profile;
+
namespace syncer {
-class BraveProfileSyncService;
+class BraveSyncServiceImpl;
}
namespace chrome {
@@ -40,7 +41,7 @@ class BraveSyncDevicesAndroid : public syncer::DeviceInfoTracker::Observer {
base::Value GetSyncDeviceList();
- syncer::BraveProfileSyncService* GetSyncService() const;
+ syncer::BraveSyncServiceImpl* GetSyncService() const;
base::ScopedObservation
diff --git a/browser/sync/brave_profile_sync_service_delegate.cc b/browser/sync/brave_sync_service_impl_delegate.cc
similarity index 71%
rename from browser/sync/brave_profile_sync_service_delegate.cc
rename to browser/sync/brave_sync_service_impl_delegate.cc
index 78f985040ff5..c5d3b9d70c83 100644
--- a/browser/sync/brave_profile_sync_service_delegate.cc
+++ b/browser/sync/brave_sync_service_impl_delegate.cc
@@ -3,20 +3,20 @@
* 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/sync/brave_profile_sync_service_delegate.h"
+#include "brave/browser/sync/brave_sync_service_impl_delegate.h"
#include
#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "brave/components/sync/driver/brave_sync_profile_sync_service.h"
+#include "brave/components/sync/driver/brave_sync_service_impl.h"
#include "components/sync_device_info/device_info_sync_service.h"
#include "components/sync_device_info/device_info_tracker.h"
#include "components/sync_device_info/local_device_info_provider.h"
namespace syncer {
-BraveProfileSyncServiceDelegate::BraveProfileSyncServiceDelegate(
+BraveSyncServiceImplDelegate::BraveSyncServiceImplDelegate(
DeviceInfoSyncService* device_info_sync_service)
: device_info_sync_service_(device_info_sync_service),
weak_ptr_factory_(this) {
@@ -31,10 +31,10 @@ BraveProfileSyncServiceDelegate::BraveProfileSyncServiceDelegate(
device_info_observer_.Observe(device_info_tracker_);
}
-BraveProfileSyncServiceDelegate::~BraveProfileSyncServiceDelegate() {}
+BraveSyncServiceImplDelegate::~BraveSyncServiceImplDelegate() {}
-void BraveProfileSyncServiceDelegate::OnDeviceInfoChange() {
- DCHECK(profile_sync_service_);
+void BraveSyncServiceImplDelegate::OnDeviceInfoChange() {
+ DCHECK(sync_service_impl_);
const syncer::DeviceInfo* local_device_info =
local_device_info_provider_->GetLocalDeviceInfo();
@@ -55,21 +55,20 @@ void BraveProfileSyncServiceDelegate::OnDeviceInfoChange() {
// remove device execution path, so posting task
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
- base::BindOnce(
- &BraveProfileSyncServiceDelegate::OnSelfDeviceInfoDeleted,
- weak_ptr_factory_.GetWeakPtr()));
+ base::BindOnce(&BraveSyncServiceImplDelegate::OnSelfDeviceInfoDeleted,
+ weak_ptr_factory_.GetWeakPtr()));
}
}
-void BraveProfileSyncServiceDelegate::OnSelfDeviceInfoDeleted() {
- profile_sync_service_->OnSelfDeviceInfoDeleted(base::DoNothing::Once());
+void BraveSyncServiceImplDelegate::OnSelfDeviceInfoDeleted() {
+ sync_service_impl_->OnSelfDeviceInfoDeleted(base::DoNothing::Once());
}
-void BraveProfileSyncServiceDelegate::SuspendDeviceObserverForOwnReset() {
+void BraveSyncServiceImplDelegate::SuspendDeviceObserverForOwnReset() {
device_info_observer_.Reset();
}
-void BraveProfileSyncServiceDelegate::ResumeDeviceObserver() {
+void BraveSyncServiceImplDelegate::ResumeDeviceObserver() {
if (!device_info_observer_.IsObserving()) {
device_info_observer_.Observe(device_info_tracker_);
}
diff --git a/browser/sync/brave_profile_sync_service_delegate.h b/browser/sync/brave_sync_service_impl_delegate.h
similarity index 60%
rename from browser/sync/brave_profile_sync_service_delegate.h
rename to browser/sync/brave_sync_service_impl_delegate.h
index 4a4b2e2cee26..06bd9438d8be 100644
--- a/browser/sync/brave_profile_sync_service_delegate.h
+++ b/browser/sync/brave_sync_service_impl_delegate.h
@@ -3,14 +3,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef BRAVE_BROWSER_SYNC_BRAVE_PROFILE_SYNC_SERVICE_DELEGATE_H_
-#define BRAVE_BROWSER_SYNC_BRAVE_PROFILE_SYNC_SERVICE_DELEGATE_H_
+#ifndef BRAVE_BROWSER_SYNC_BRAVE_SYNC_SERVICE_IMPL_DELEGATE_H_
+#define BRAVE_BROWSER_SYNC_BRAVE_SYNC_SERVICE_IMPL_DELEGATE_H_
-#include "brave/components/sync/driver/profile_sync_service_delegate.h"
+#include "brave/components/sync/driver/sync_service_impl_delegate.h"
#include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h"
-#include "components/sync/driver/profile_sync_service.h"
#include "components/sync_device_info/device_info_tracker.h"
class Profile;
@@ -21,15 +20,15 @@ class DeviceInfoSyncService;
class DeviceInfoTracker;
class LocalDeviceInfoProvider;
-// Helper class to prevent pass of profile pointer into BraveProfileSyncService
+// Helper class to prevent pass of profile pointer into BraveSyncServiceImpl
// and to keep DeviceInfoSyncService
-class BraveProfileSyncServiceDelegate
- : public ProfileSyncServiceDelegate,
+class BraveSyncServiceImplDelegate
+ : public SyncServiceImplDelegate,
public syncer::DeviceInfoTracker::Observer {
public:
- explicit BraveProfileSyncServiceDelegate(
+ explicit BraveSyncServiceImplDelegate(
DeviceInfoSyncService* device_info_sync_service);
- ~BraveProfileSyncServiceDelegate() override;
+ ~BraveSyncServiceImplDelegate() override;
void SuspendDeviceObserverForOwnReset() override;
void ResumeDeviceObserver() override;
@@ -48,14 +47,13 @@ class BraveProfileSyncServiceDelegate
DeviceInfoSyncService* device_info_sync_service_;
- base::WeakPtrFactory weak_ptr_factory_;
+ base::WeakPtrFactory weak_ptr_factory_;
- BraveProfileSyncServiceDelegate(const BraveProfileSyncServiceDelegate&) =
+ BraveSyncServiceImplDelegate(const BraveSyncServiceImplDelegate&) = delete;
+ BraveSyncServiceImplDelegate& operator=(const BraveSyncServiceImplDelegate&) =
delete;
- BraveProfileSyncServiceDelegate& operator=(
- const BraveProfileSyncServiceDelegate&) = delete;
};
} // namespace syncer
-#endif // BRAVE_BROWSER_SYNC_BRAVE_PROFILE_SYNC_SERVICE_DELEGATE_H_
+#endif // BRAVE_BROWSER_SYNC_BRAVE_SYNC_SERVICE_IMPL_DELEGATE_H_
diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn
index 5d082b04b8c8..ddaeb067e7ec 100644
--- a/browser/ui/BUILD.gn
+++ b/browser/ui/BUILD.gn
@@ -106,8 +106,8 @@ source_set("ui") {
"webui/new_tab_page/brave_new_tab_ui.h",
"webui/new_tab_page/brave_new_tab_ui_utils.cc",
"webui/new_tab_page/brave_new_tab_ui_utils.h",
- "webui/new_tab_page/instant_service_message_handler.cc",
- "webui/new_tab_page/instant_service_message_handler.h",
+ "webui/new_tab_page/top_sites_message_handler.cc",
+ "webui/new_tab_page/top_sites_message_handler.h",
"webui/settings/brave_appearance_handler.cc",
"webui/settings/brave_appearance_handler.h",
"webui/settings/brave_import_data_handler.h",
@@ -381,7 +381,7 @@ source_set("ui") {
"//brave/components/brave_new_tab_ui:generated_resources",
"//brave/components/brave_perf_predictor/browser:buildflags",
"//brave/components/brave_sync",
- "//brave/components/brave_sync:profile_sync_service_helper",
+ "//brave/components/brave_sync:sync_service_impl_helper",
"//brave/components/brave_welcome_ui:generated_resources",
"//brave/components/version_info",
"//chrome/app:chromium_strings",
diff --git a/browser/ui/android/strings/android_chrome_strings.grd b/browser/ui/android/strings/android_chrome_strings.grd
index 282724705df7..283abbc0d8c7 100644
--- a/browser/ui/android/strings/android_chrome_strings.grd
+++ b/browser/ui/android/strings/android_chrome_strings.grd
@@ -250,6 +250,12 @@ CHAR_LIMIT guidelines:
Announcements
+
+ Web apps
+
+
+ Web apps (quiet)
+
Permission requests
@@ -265,21 +271,12 @@ CHAR_LIMIT guidelines:
-
- Account
-
You and Brave
Sign in to Brave
-
- Sync and Brave services
-
-
- You are currently customizing your Sync and Brave service settings. To finish turning on sync, tap the Confirm button near the bottom of the screen. Navigate up
-
You are currently customizing your Sync settings. To finish turning on sync, tap the Confirm button near the bottom of the screen. Navigate up
@@ -289,9 +286,6 @@ CHAR_LIMIT guidelines:
Sync and personalize across devices
-
- Sync is on
-
Disabled by the administrator of this device
@@ -299,9 +293,6 @@ CHAR_LIMIT guidelines:
Brave activity controls
- Control how your browsing history is used to personalize Search, ads, and more
-
-
Control how your browsing history is used to personalize Search and more
@@ -317,15 +308,6 @@ CHAR_LIMIT guidelines:
Sync
-
- Sync your Brave data
-
-
- Manage sync
-
-
- Other Brave services
-
Brave services
@@ -460,7 +442,7 @@ CHAR_LIMIT guidelines:
Country/Region
-
+
Title
@@ -541,6 +523,14 @@ CHAR_LIMIT guidelines:
Keep your passwords safe from data breaches and other security issues
+
+
+ Trusted vault
+
+
+
+ Opt in to trusted vault
+
Never saved
@@ -868,7 +858,7 @@ Privacy Sandbox trials are still in active development and are available in sele
Choose another provider
- See this provider's <a target="_blank" rel="noopener noreferrer" href="$1https://google.com/">privacy policy</a>
+ See this provider's <a target="_blank" href="$1https://google.com/">privacy policy</a>
This setting is disabled on managed browsers
@@ -916,7 +906,7 @@ Your Brave account may have other forms of browsing history like searches and ac
Signs you out of most sites. You won't be signed out of your Brave sync chain.
- Clears history and autocompletions in the address bar.
+ Clears history, including in the search box.
Clears history from all synced devices.
@@ -928,10 +918,16 @@ Your Brave account may have other forms of browsing history like searches and ac
Clears history from all synced devices. Your Brave sync chain may have other forms of browsing history at <link>myactivity.google.com</link>.
- To clear <link1>search</link1> or other forms of history, visit <link2>My Brave Activity</link2>
+ <link1>Search history</link1> and <link2>other forms of activity</link2> may be saved in your Brave sync chain when you’re signed in. You can delete them anytime.
+
+
+ <link1>Other forms of activity</link1> may be saved in your Brave sync chain when you’re signed in. You can delete them anytime.
- Your search engine is %1$sBing. If applicable, see their instructions to delete your search history.
+ Your search engine is %1$sBing. See their instructions for deleting your search history, if applicable.
+
+
+ See your search engine’s instructions for deleting your search history, if applicable
Saved passwords
@@ -963,9 +959,6 @@ Your Brave account may have other forms of browsing history like searches and ac
Last 4 weeks
-
- Older than 30 days
-
All time
@@ -1255,12 +1248,6 @@ Your Brave account may have other forms of browsing history like searches and ac
Your keyboard won’t change
-
- No thanks
-
-
- Change language
-
Loading %1$sHindi
@@ -1611,15 +1598,15 @@ Your Brave account may have other forms of browsing history like searches and ac
Android system sync disabled
-
- Sync is off
+
+ On
+
+
+ Off
No data selected to sync
-
- Initial sync setup was not finished. Sync is off.
-
Tap to set up sync
@@ -1825,62 +1812,6 @@ To change this setting, <resetlink>reset sync
-
-
- %1$shttps://www.google.com wants to pair
-
- <link>Get help</link> while scanning for devices…
-
-
- Pair
-
-
- <link1>Get help</link1> or <link2>re-scan</link2>
-
-
- No compatible devices found
-
-
- <link>Turn on Bluetooth</link> to allow pairing
-
-
- Brave is unable to turn on Bluetooth adapter
-
-
- <link>Get help</link>
-
-
- Brave needs location access to scan for devices. <permission_link>Update permissions</permission_link>
-
-
- Brave needs location access to scan for devices. Location access is <services_link>turned off for this device</services_link>.
-
-
- Brave needs location access to scan for devices. <permission_link>Update permissions</permission_link>. Location access is also <services_link>turned off for this device</services_link>.
-
-
- <link>Get help</link>
-
-
- Brave needs permission to scan for nearby devices. <permission_link>Update permissions</permission_link>.
-
-
- Connected Device
-
-
- {N_BARS, plural,
- =1 {Signal Strength Level: # bar}
- other {Signal Strength Level: # bars}}
-
-
-
-
- %1$swww.google.com wants to scan for nearby Bluetooth devices. The following devices have been found:
-
-
- Unknown or unsupported device (%1$sA1:B2:C3:D4:E5:F6)
-
-
Sync isn't working
@@ -1891,12 +1822,21 @@ To change this setting, <resetlink>reset sync
Initial sync setup not finished
+
+ Sync needs to verify it's you
+
Open Android settings and re-enable Android system sync to start Brave sync
Sign in again to start sync
+
+ Make sure you can always access your sync data
+
+
+ Make sure you can always access your saved passwords
+
To start sync, verify it's you
@@ -1909,9 +1849,6 @@ To change this setting, <resetlink>reset sync
Choose what to sync below
-
- To start sync, turn on "Sync your Brave data".
-
Try signing in again
@@ -2212,15 +2149,9 @@ To change this setting, <resetlink>reset sync
Translate image with Brave Lens <new>New</new>
-
- Shop similar products <new>New</new>
-
Shop image with Brave Lens <new>New</new>
-
- Search similar products <new>New</new>
-
Search %1$sBrave for this image
@@ -2308,6 +2239,9 @@ To change this setting, <resetlink>reset sync
Install this app
+
+ The site’s connection is secure unless Brave tells you otherwise.
+
To get here quicker, add this page to your Home screen
@@ -2668,9 +2602,6 @@ To change this setting, <resetlink>reset sync
- Brave may use your history to personalize Search, ads, and other Brave services
-
-
Brave may use your history to personalize Search and other Brave services
@@ -2847,6 +2778,9 @@ To change this setting, <resetlink>reset sync
Following
+
+ You'll find sites you follow here
+
Updates Unavailable
@@ -2886,6 +2820,14 @@ To change this setting, <resetlink>reset sync
Check back later for new stories
Can't refresh Discover
Check back later for new stories
+ You'll find stories here
+ To follow a site, go to the site, open the Brave menu, and tap Follow.
+
+ For new stories, pull down to refresh
+
+
+ To refresh the feed content, pull down the page
+
@@ -3021,9 +2963,21 @@ To change this setting, <resetlink>reset sync
Quickly search with your voice. To edit this shortcut, touch and hold.
+
+ Quickly open a new tab. To edit this shortcut, go to Settings.
+
+
+ Quickly share this page. To edit this shortcut, go to Settings.
+
+
+ Quickly search with your voice. To edit this shortcut, go to Settings.
+
Edit shortcut
+
+ Edit toolbar shortcut
+
@@ -3101,6 +3055,12 @@ To change this setting, <resetlink>reset sync
Following
+
+ Follow this site here
+
+
+ Adds the current web site to the list of web sites that you are following.
+
Request desktop site
@@ -3237,7 +3197,7 @@ To change this setting, <resetlink>reset sync
Edit folder
-
+
Name
@@ -3375,6 +3335,12 @@ To change this setting, <resetlink>reset sync
Show simplified view
+
+ View simplified page?
+
+
+ View
+
Bookmarks and web history
@@ -3572,6 +3538,9 @@ To change this setting, <resetlink>reset sync
Remove suggestion from history?
+
+ Remove suggestion from clipboard?
+
Frequently visited
@@ -3792,11 +3761,6 @@ To change this setting, <resetlink>reset sync
-
-
- %1$sitem_name (%2$sitem id)
-
-
Running in Brave
@@ -3807,12 +3771,6 @@ To change this setting, <resetlink>reset sync
Got it
-
- Web apps
-
-
- Web apps (quiet)
-
%1$sYouTube also has data in Brave
@@ -4059,6 +4017,17 @@ To change this setting, <resetlink>reset sync
+
+
+ Search or type URL
+
+
+ Start Dino Game
+
+
+ Quick Action Search Widget Icon
+
+
Remove and recreate this shortcut
@@ -4101,6 +4070,18 @@ To change this setting, <resetlink>reset sync
Active today
+
+ device
+
+
+ phone
+
+
+ computer
+
+
+ Page sent. To see it, open Brave on your %1$sphone
+
@@ -4202,11 +4183,18 @@ To change this setting, <resetlink>reset sync
-
- Tap to verify your phone number on desktop
+
+ Submit %1$s123 on %2$sZoe's Macbook?
+
+
+ Let %1$sexample.com verify it's you
-
- %1$s123 is your code for %2$sexample.com
+
+ Let %1$spayment.com verify it's you for %2$sshopping.com
+
+
+
+ Submit %1$s123 to %2$sexample.com?
@@ -4386,12 +4374,20 @@ To change this setting, <resetlink>reset sync
+
+ Turning on Bluetooth…
+
+
+
+ Bluetooth will turn back off when you're done
+
+
QR Code
-
+
Share
@@ -4399,20 +4395,20 @@ To change this setting, <resetlink>reset sync
-
- To share with profiles nearby, let them scan this QR code
+
+ To share with profiles nearby, let them scan this QR Code
-
+
Download
-
- Can't create QR code. URL is more than %1$d300 characters.
+
+ Can't create QR Code. URL is more than %1$d300 characters.
- Can't create QR code
+ Can't create QR Code
@@ -4448,6 +4444,14 @@ To change this setting, <resetlink>reset sync
+
+ Move Up
+
+
+
+ Move Down
+
+
Can\u2019t go higher. Try starting from further up the page.
@@ -4468,10 +4472,9 @@ To change this setting, <resetlink>reset sync
-
- Stylize highlight
+
+ Create card
-
Copied
@@ -4484,24 +4487,24 @@ To change this setting, <resetlink>reset sync
-
- Position QR/barcode in this frame.
+
+ Position QR Code/barcode in this frame.
-
- To scan a QR code, let Brave use your camera
+
+ To scan a QR Code, let Brave use your camera
-
- To scan a QR code, change your settings so that Brave can use your camera
+
+ To scan a QR Code, change your settings so that Brave can use your camera
-
+
Continue
- To scan a QR code, use a device with a camera.
+ To scan a QR Code, use a device with a camera.
@@ -4516,11 +4519,11 @@ To change this setting, <resetlink>reset sync
-
+
Open Settings
-
+
This QR Code is not a URL: %1$sQR Code Text
@@ -4583,6 +4586,11 @@ To change this setting, <resetlink>reset sync
+
+
+ Surveys
+
+
Paint Preview captured successfully.
@@ -4721,6 +4729,55 @@ To change this setting, <resetlink>reset sync
Results from\n%1$s
+
+ Search results from Brave.
+
+
+
+
+ Create a %1$sairbnb.com account
+
+
+ Create a %1$sairbnb.com account…
+
+
+ Continue as %1$sAlbus (or Albus Dumbledore)
+
+
+ List of accounts to be selected.
+
+
+ List of accounts to be selected opened at half height.
+
+
+ List of accounts to be selected opened at full height.
+
+
+ List of accounts to be selected is closed.
+
+
+
+
+ Stylized highlight %1$s2020-09-16
+
+
+ chrome_stylized_highlight_
+
+
+ %1$sClassic template selected
+
+
+ Select a template for your highlight
+
+
+ Highlight was shortened
+
+
+ “
+
+
+ ”
+
diff --git a/browser/ui/android/strings/android_chrome_strings_override.grd b/browser/ui/android/strings/android_chrome_strings_override.grd
index cd2ecd3b45ba..e883a7b2f174 100644
--- a/browser/ui/android/strings/android_chrome_strings_override.grd
+++ b/browser/ui/android/strings/android_chrome_strings_override.grd
@@ -195,8 +195,8 @@ CHAR_LIMIT guidelines:
-
- To share with profiles nearby, let them scan this QR code
+
+ To share with profiles nearby, let them scan this QR Code
diff --git a/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java b/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java
new file mode 100644
index 000000000000..9aada170522a
--- /dev/null
+++ b/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayout.java
@@ -0,0 +1,28 @@
+/* Copyright (c) 2021 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.top;
+
+import android.animation.Animator;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+
+import java.util.List;
+
+public interface BraveToolbarLayout {
+ public void onClickImpl(View v);
+
+ public boolean onLongClickImpl(View v);
+
+ public void updateModernLocationBarColorImpl(int color);
+
+ public int getBoundsAfterAccountingForRightButtonsImpl(ViewGroup toolbarButtonsContainer);
+
+ public void populateUrlAnimatorSetImpl(boolean showExpandedState,
+ int urlFocusToolbarButtonsDuration, int urlClearFocusTabStackDelayMs,
+ List animators);
+}
diff --git a/browser/ui/bookmark/BUILD.gn b/browser/ui/bookmark/BUILD.gn
index cdd32bbe15a7..9f850adb068b 100644
--- a/browser/ui/bookmark/BUILD.gn
+++ b/browser/ui/bookmark/BUILD.gn
@@ -1,13 +1,13 @@
source_set("bookmark") {
- # Remove when https://github.com/brave/brave-browser/issues/10654 is resolved
+ # Remove when https://github.com/brave/brave-browser/issues/10654 is resolved.
check_includes = false
sources = [
- "brave_bookmark_tab_helper.cc",
- "brave_bookmark_tab_helper.h",
"bookmark_prefs_service.cc",
"bookmark_prefs_service.h",
"bookmark_prefs_service_factory.cc",
"bookmark_prefs_service_factory.h",
+ "brave_bookmark_tab_helper.cc",
+ "brave_bookmark_tab_helper.h",
]
deps = [
@@ -16,8 +16,8 @@ source_set("bookmark") {
"//components/bookmarks/common",
"//components/keyed_service/content",
"//components/keyed_service/core",
- "//components/prefs",
"//components/pref_registry",
+ "//components/prefs",
"//content/public/browser",
]
}
diff --git a/browser/ui/brave_ads/padded_image_button.cc b/browser/ui/brave_ads/padded_image_button.cc
index 24043993295f..752edae6c9ad 100644
--- a/browser/ui/brave_ads/padded_image_button.cc
+++ b/browser/ui/brave_ads/padded_image_button.cc
@@ -36,7 +36,8 @@ const float kVisibleOpacity = 0.12f;
PaddedImageButton::PaddedImageButton(PressedCallback callback)
: views::ImageButton(callback) {
- views::InkDrop::UseInkDropForSquareRipple(ink_drop(),
+ auto* ink_drop = views::InkDrop::Get(this);
+ views::InkDrop::UseInkDropForSquareRipple(ink_drop,
/*highlight_on_hover=*/false,
/*highlight_on_focus=*/false);
@@ -46,8 +47,8 @@ PaddedImageButton::PaddedImageButton(PressedCallback callback)
SetAnimateOnStateChange(false);
- ink_drop()->SetMode(views::InkDropHost::InkDropMode::ON);
- ink_drop()->SetVisibleOpacity(kVisibleOpacity);
+ ink_drop->SetMode(views::InkDropHost::InkDropMode::ON);
+ ink_drop->SetVisibleOpacity(kVisibleOpacity);
SetHasInkDropActionOnClick(true);
}
@@ -69,7 +70,7 @@ void PaddedImageButton::OnThemeChanged() {
const SkColor background_color = GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_WindowBackground);
- ink_drop()->SetBaseColor(
+ views::InkDrop::Get(this)->SetBaseColor(
color_utils::GetColorWithMaxContrast(background_color));
}
diff --git a/browser/ui/omnibox/brave_omnibox_client_impl.cc b/browser/ui/omnibox/brave_omnibox_client_impl.cc
index 293089086d0b..b52372badebb 100644
--- a/browser/ui/omnibox/brave_omnibox_client_impl.cc
+++ b/browser/ui/omnibox/brave_omnibox_client_impl.cc
@@ -7,8 +7,8 @@
#include
+#include "base/cxx17_backports.h"
#include "base/metrics/histogram_macros.h"
-#include "base/stl_util.h"
#include "base/values.h"
#include "brave/browser/autocomplete/brave_autocomplete_scheme_classifier.h"
#include "brave/common/pref_names.h"
diff --git a/browser/ui/sidebar/BUILD.gn b/browser/ui/sidebar/BUILD.gn
index a1a89f09c4ed..1ebb54ea883c 100644
--- a/browser/ui/sidebar/BUILD.gn
+++ b/browser/ui/sidebar/BUILD.gn
@@ -39,9 +39,9 @@ source_set("sidebar") {
# see check_includes comment above
deps += [
"//chrome/browser/cart:mojo_bindings",
+ "//chrome/browser/new_tab_page/modules/drive:mojo_bindings",
+ "//chrome/browser/new_tab_page/modules/task_module:mojo_bindings",
"//chrome/browser/promo_browser_command:mojo_bindings",
- "//chrome/browser/search/drive:mojo_bindings",
- "//chrome/browser/search/task_module:mojo_bindings",
"//chrome/browser/ui/webui/new_tab_page:mojo_bindings",
"//chrome/browser/ui/webui/realbox:mojo_bindings",
]
diff --git a/browser/ui/tabs/brave_tab_strip_model.cc b/browser/ui/tabs/brave_tab_strip_model.cc
index cfa050b895c1..33944bf4d5f0 100644
--- a/browser/ui/tabs/brave_tab_strip_model.cc
+++ b/browser/ui/tabs/brave_tab_strip_model.cc
@@ -22,7 +22,7 @@ BraveTabStripModel::BraveTabStripModel(TabStripModelDelegate* delegate,
: TabStripModel(delegate, profile) {}
BraveTabStripModel::~BraveTabStripModel() {}
-void BraveTabStripModel::SelectRelativeTab(bool forward,
+void BraveTabStripModel::SelectRelativeTab(TabRelativeDirection direction,
UserGestureDetails detail) {
if (contents_data_.empty())
return;
@@ -30,13 +30,14 @@ void BraveTabStripModel::SelectRelativeTab(bool forward,
bool is_mru_enabled = profile()->GetPrefs()->GetBoolean(kMRUCyclingEnabled);
if (is_mru_enabled) {
- SelectMRUTab(forward, detail);
+ SelectMRUTab(direction, detail);
} else {
- TabStripModel::SelectRelativeTab(forward, detail);
+ TabStripModel::SelectRelativeTab(direction, detail);
}
}
-void BraveTabStripModel::SelectMRUTab(bool forward, UserGestureDetails detail) {
+void BraveTabStripModel::SelectMRUTab(TabRelativeDirection direction,
+ UserGestureDetails detail) {
if (mru_cycle_list_.empty()) {
// Start cycling
@@ -59,13 +60,11 @@ void BraveTabStripModel::SelectMRUTab(bool forward, UserGestureDetails detail) {
static_cast(browser->window())->StartTabCycling();
}
- if (forward) {
- std::rotate(mru_cycle_list_.begin(),
- mru_cycle_list_.begin() + 1,
+ if (direction == TabRelativeDirection::kNext) {
+ std::rotate(mru_cycle_list_.begin(), mru_cycle_list_.begin() + 1,
mru_cycle_list_.end());
} else {
- std::rotate(mru_cycle_list_.rbegin(),
- mru_cycle_list_.rbegin() + 1,
+ std::rotate(mru_cycle_list_.rbegin(), mru_cycle_list_.rbegin() + 1,
mru_cycle_list_.rend());
}
diff --git a/browser/ui/tabs/brave_tab_strip_model.h b/browser/ui/tabs/brave_tab_strip_model.h
index d3ffb0b46ada..8fd1318a8dfb 100644
--- a/browser/ui/tabs/brave_tab_strip_model.h
+++ b/browser/ui/tabs/brave_tab_strip_model.h
@@ -20,11 +20,12 @@ class BraveTabStripModel : public TabStripModel {
BraveTabStripModel(const BraveTabStripModel&) = delete;
BraveTabStripModel operator=(const BraveTabStripModel&) = delete;
- void SelectRelativeTab(bool forward, UserGestureDetails detail) override;
+ void SelectRelativeTab(TabRelativeDirection direction,
+ UserGestureDetails detail) override;
// Set the next tab when doing a MRU cycling with Ctrl-tab
void SelectMRUTab(
- bool forward,
+ TabRelativeDirection direction,
UserGestureDetails detail = UserGestureDetails(GestureType::kOther));
// Stop MRU cycling, called when releasing the Ctrl key
diff --git a/browser/ui/views/brave_actions/brave_rewards_action_stub_view.cc b/browser/ui/views/brave_actions/brave_rewards_action_stub_view.cc
index d49cdfec8b7d..67d3d585eb7d 100644
--- a/browser/ui/views/brave_actions/brave_rewards_action_stub_view.cc
+++ b/browser/ui/views/brave_actions/brave_rewards_action_stub_view.cc
@@ -62,14 +62,15 @@ BraveRewardsActionStubView::BraveRewardsActionStubView(
std::u16string()),
profile_(profile),
delegate_(delegate) {
- ink_drop()->SetMode(views::InkDropHost::InkDropMode::ON);
- ink_drop()->SetBaseColorCallback(base::BindRepeating(
+ auto* ink_drop = views::InkDrop::Get(this);
+ ink_drop->SetMode(views::InkDropHost::InkDropMode::ON);
+ ink_drop->SetBaseColorCallback(base::BindRepeating(
[](views::View* host) { return GetToolbarInkDropBaseColor(host); },
this));
SetHasInkDropActionOnClick(true);
SetHorizontalAlignment(gfx::ALIGN_CENTER);
- ink_drop()->SetVisibleOpacity(kToolbarInkDropVisibleOpacity);
+ ink_drop->SetVisibleOpacity(kToolbarInkDropVisibleOpacity);
// Create badge-and-image source like an extension icon would
auto preferred_size = GetPreferredSize();
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
diff --git a/browser/ui/views/brave_default_browser_dialog_view.cc b/browser/ui/views/brave_default_browser_dialog_view.cc
index 1bd3340242b9..5548b37e0979 100644
--- a/browser/ui/views/brave_default_browser_dialog_view.cc
+++ b/browser/ui/views/brave_default_browser_dialog_view.cc
@@ -146,7 +146,7 @@ bool BraveDefaultBrowserDialogView::ShouldShowCloseButton() const {
return false;
}
-void BraveDefaultBrowserDialogView::OnDialogInitialized() {
+void BraveDefaultBrowserDialogView::OnWidgetInitialized() {
SetButtonRowInsets(gfx::Insets(0, kPadding, kPadding, kPadding));
}
diff --git a/browser/ui/views/brave_default_browser_dialog_view.h b/browser/ui/views/brave_default_browser_dialog_view.h
index 3216f9bf2954..951fdeb826fb 100644
--- a/browser/ui/views/brave_default_browser_dialog_view.h
+++ b/browser/ui/views/brave_default_browser_dialog_view.h
@@ -29,7 +29,7 @@ class BraveDefaultBrowserDialogView : public views::DialogDelegateView {
bool ShouldShowCloseButton() const override;
std::unique_ptr CreateNonClientFrameView(
views::Widget* widget) override;
- void OnDialogInitialized() override;
+ void OnWidgetInitialized() override;
private:
void OnCancelButtonClicked();
diff --git a/browser/ui/views/crash_report_permission_ask_dialog_view.cc b/browser/ui/views/crash_report_permission_ask_dialog_view.cc
index 22c925a637b2..2efbe298a25b 100644
--- a/browser/ui/views/crash_report_permission_ask_dialog_view.cc
+++ b/browser/ui/views/crash_report_permission_ask_dialog_view.cc
@@ -244,7 +244,7 @@ bool CrashReportPermissionAskDialogView::ShouldShowWindowTitle() const {
return false;
}
-void CrashReportPermissionAskDialogView::OnDialogInitialized() {
+void CrashReportPermissionAskDialogView::OnWidgetInitialized() {
SetButtonRowInsets(gfx::Insets(0, 0, 18, 24));
}
diff --git a/browser/ui/views/crash_report_permission_ask_dialog_view.h b/browser/ui/views/crash_report_permission_ask_dialog_view.h
index 03ea080ecbd8..e397a34a64b5 100644
--- a/browser/ui/views/crash_report_permission_ask_dialog_view.h
+++ b/browser/ui/views/crash_report_permission_ask_dialog_view.h
@@ -31,7 +31,7 @@ class CrashReportPermissionAskDialogView : public views::DialogDelegateView {
ui::ModalType GetModalType() const override;
bool ShouldShowCloseButton() const override;
bool ShouldShowWindowTitle() const override;
- void OnDialogInitialized() override;
+ void OnWidgetInitialized() override;
void OnAcceptButtonClicked();
void OnWindowClosing();
diff --git a/browser/ui/views/frame/brave_opaque_browser_frame_view.cc b/browser/ui/views/frame/brave_opaque_browser_frame_view.cc
index 3c29a3e91a69..c9205bb73d49 100644
--- a/browser/ui/views/frame/brave_opaque_browser_frame_view.cc
+++ b/browser/ui/views/frame/brave_opaque_browser_frame_view.cc
@@ -31,8 +31,8 @@ void BraveOpaqueBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
gfx::ScopedCanvas scoped_canvas(canvas);
gfx::Rect bounds_to_frame_graphic(bounds());
if (!IsFrameCondensed()) {
- bounds_to_frame_graphic.Inset(layout()->FrameBorderThickness(false),
- layout()->FrameTopThickness(false));
+ bounds_to_frame_graphic.Inset(layout()->FrameBorderInsets(false).top(),
+ layout()->FrameEdgeInsets(false).top());
canvas->ClipRect(bounds_to_frame_graphic);
}
frame_graphic_->Paint(canvas, bounds_to_frame_graphic);
diff --git a/browser/ui/views/location_bar/brave_location_bar_view.cc b/browser/ui/views/location_bar/brave_location_bar_view.cc
index 0702f99c12ec..55d7ca8c8d4d 100644
--- a/browser/ui/views/location_bar/brave_location_bar_view.cc
+++ b/browser/ui/views/location_bar/brave_location_bar_view.cc
@@ -79,12 +79,13 @@ void BraveLocationBarView::Init() {
// base method calls Update and Layout
LocationBarView::Init();
// Change focus ring highlight path
- if (focus_ring_) {
- focus_ring_->SetPathGenerator(
+ views::FocusRing* focus_ring = views::FocusRing::Get(this);
+ if (focus_ring) {
+ focus_ring->SetPathGenerator(
std::make_unique<
BraveLocationBarViewFocusRingHighlightPathGenerator>());
if (const auto color = GetFocusRingColor(profile()))
- focus_ring_->SetColor(color.value());
+ focus_ring->SetColor(color.value());
}
#if BUILDFLAG(ENABLE_TOR)
onion_location_view_ = new OnionLocationView(browser_->profile());
diff --git a/browser/ui/views/location_bar/ipfs_location_view.cc b/browser/ui/views/location_bar/ipfs_location_view.cc
index 2e3350fadfb2..0dc055c1b128 100644
--- a/browser/ui/views/location_bar/ipfs_location_view.cc
+++ b/browser/ui/views/location_bar/ipfs_location_view.cc
@@ -78,11 +78,12 @@ class IPFSLocationButtonView : public views::LabelButton {
SetEnabledTextColors(kTextColor);
SetHorizontalAlignment(gfx::ALIGN_RIGHT);
SetImageLabelSpacing(6);
- ink_drop()->SetMode(views::InkDropHost::InkDropMode::ON);
+ auto* ink_drop = views::InkDrop::Get(this);
+ ink_drop->SetMode(views::InkDropHost::InkDropMode::ON);
SetBorder(views::CreateEmptyBorder(
GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING)));
SetHasInkDropActionOnClick(true);
- ink_drop()->SetVisibleOpacity(kToolbarInkDropVisibleOpacity);
+ ink_drop->SetVisibleOpacity(kToolbarInkDropVisibleOpacity);
UpdateBorder();
// Ensure focus ring follows border
views::HighlightPathGenerator::Install(
diff --git a/browser/ui/views/location_bar/onion_location_view.cc b/browser/ui/views/location_bar/onion_location_view.cc
index 2a10372f81bb..795cdf6d2fa4 100644
--- a/browser/ui/views/location_bar/onion_location_view.cc
+++ b/browser/ui/views/location_bar/onion_location_view.cc
@@ -94,11 +94,13 @@ class OnionLocationButtonView : public views::LabelButton {
SetEnabledTextColors(kTextColor);
SetHorizontalAlignment(gfx::ALIGN_RIGHT);
SetImageLabelSpacing(6);
- ink_drop()->SetMode(views::InkDropHost::InkDropMode::ON);
+
+ auto* ink_drop = views::InkDrop::Get(this);
+ ink_drop->SetMode(views::InkDropHost::InkDropMode::ON);
SetBorder(views::CreateEmptyBorder(
GetLayoutInsets(LOCATION_BAR_ICON_INTERIOR_PADDING)));
SetHasInkDropActionOnClick(true);
- ink_drop()->SetVisibleOpacity(kToolbarInkDropVisibleOpacity);
+ ink_drop->SetVisibleOpacity(kToolbarInkDropVisibleOpacity);
UpdateBorder();
// Ensure focus ring follows border
views::HighlightPathGenerator::Install(
diff --git a/browser/ui/views/profiles/brave_incognito_menu_view.cc b/browser/ui/views/profiles/brave_incognito_menu_view.cc
index 5330e1501109..099c0cad6eca 100644
--- a/browser/ui/views/profiles/brave_incognito_menu_view.cc
+++ b/browser/ui/views/profiles/brave_incognito_menu_view.cc
@@ -75,7 +75,7 @@ void BraveIncognitoMenuView::BuildMenu() {
GetProfileMenuCloseButtonTextId(browser()->profile())),
base::BindRepeating(&BraveIncognitoMenuView::OnExitButtonClicked,
base::Unretained(this)),
- kCloseAllIcon);
+ vector_icons::kCloseIcon);
}
void BraveIncognitoMenuView::AddTorButton() {
diff --git a/browser/ui/views/profiles/brave_profile_menu_view.cc b/browser/ui/views/profiles/brave_profile_menu_view.cc
index acfab5072dd6..08f36f453b78 100644
--- a/browser/ui/views/profiles/brave_profile_menu_view.cc
+++ b/browser/ui/views/profiles/brave_profile_menu_view.cc
@@ -23,12 +23,6 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/image_model.h"
-namespace {
-bool IsGuest(Profile* profile) {
- return profile->IsGuestSession() || profile->IsEphemeralGuestProfile();
-}
-} // namespace
-
void BraveProfileMenuView::BuildIdentity() {
ProfileMenuView::BuildIdentity();
Profile* profile = browser()->profile();
@@ -59,12 +53,11 @@ void BraveProfileMenuView::BuildFeatureButtons() {
if (!profile->IsOffTheRecord() && profile->HasPrimaryOTRProfile())
window_count += chrome::GetBrowserCount(
profile->GetPrimaryOTRProfile(/*create_if_needed=*/true));
- if (base::FeatureList::IsEnabled(features::kNewProfilePicker) &&
- IsGuest(profile)) {
+ if (profile->IsGuestSession()) {
AddFeatureButton(
l10n_util::GetPluralStringFUTF16(IDS_GUEST_PROFILE_MENU_CLOSE_BUTTON,
window_count),
- base::BindRepeating(&BraveProfileMenuView::OnExitProfileButtonClicked,
+ base::BindRepeating(&ProfileMenuView::OnExitProfileButtonClicked,
base::Unretained(this)),
vector_icons::kCloseIcon);
} else {
@@ -72,7 +65,7 @@ void BraveProfileMenuView::BuildFeatureButtons() {
AddFeatureButton(
l10n_util::GetPluralStringFUTF16(IDS_PROFILES_CLOSE_X_WINDOWS_BUTTON,
window_count),
- base::BindRepeating(&BraveProfileMenuView::OnExitProfileButtonClicked,
+ base::BindRepeating(&ProfileMenuView::OnExitProfileButtonClicked,
base::Unretained(this)),
vector_icons::kCloseIcon);
}
diff --git a/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc b/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc
index 2882ebd2a375..042e04c9d05f 100644
--- a/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc
+++ b/browser/ui/views/sidebar/sidebar_add_item_bubble_delegate_view.cc
@@ -23,6 +23,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
+#include "ui/gfx/canvas.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/label.h"
diff --git a/browser/ui/views/sidebar/sidebar_button_view.cc b/browser/ui/views/sidebar/sidebar_button_view.cc
index 5db28445e769..b81bd96d04ce 100644
--- a/browser/ui/views/sidebar/sidebar_button_view.cc
+++ b/browser/ui/views/sidebar/sidebar_button_view.cc
@@ -12,7 +12,7 @@ SidebarButtonView::SidebarButtonView(Delegate* delegate) : delegate_(delegate) {
SetImageHorizontalAlignment(views::ImageButton::ALIGN_CENTER);
SetImageVerticalAlignment(views::ImageButton::ALIGN_MIDDLE);
DCHECK(GetInstallFocusRingOnFocus());
- focus_ring()->SetColor(gfx::kBraveBlurple300);
+ views::FocusRing::Get(this)->SetColor(gfx::kBraveBlurple300);
}
SidebarButtonView::~SidebarButtonView() = default;
diff --git a/browser/ui/views/sidebar/sidebar_item_drag_context.cc b/browser/ui/views/sidebar/sidebar_item_drag_context.cc
index 58e5441aa7fd..4ad82525031b 100644
--- a/browser/ui/views/sidebar/sidebar_item_drag_context.cc
+++ b/browser/ui/views/sidebar/sidebar_item_drag_context.cc
@@ -38,6 +38,6 @@ bool SidebarItemDragContext::CanStartDrag(const gfx::Point press_pt,
constexpr int kMinimumDragDistance = 10;
int x_offset = abs(p.x() - press_pt.x());
int y_offset = abs(p.y() - press_pt.y());
- return sqrt(pow(float{x_offset}, 2) + pow(float{y_offset}, 2)) >
- kMinimumDragDistance;
+ return sqrt(pow(static_cast(x_offset), 2) +
+ pow(static_cast(y_offset), 2)) > kMinimumDragDistance;
}
diff --git a/browser/ui/views/sidebar/sidebar_items_contents_view.cc b/browser/ui/views/sidebar/sidebar_items_contents_view.cc
index 5073b630bab8..1c1dc1f7c1eb 100644
--- a/browser/ui/views/sidebar/sidebar_items_contents_view.cc
+++ b/browser/ui/views/sidebar/sidebar_items_contents_view.cc
@@ -31,6 +31,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
#include "ui/compositor/compositor.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/background.h"
@@ -79,8 +80,9 @@ gfx::Size SidebarItemsContentsView::CalculatePreferredSize() const {
if (children().empty())
return {0, 0};
const gfx::Size child_size = children()[0]->GetPreferredSize();
- return {child_size.width() + GetInsets().width(),
- children().size() * child_size.height() + GetInsets().height()};
+ return gfx::Size(
+ child_size.width() + GetInsets().width(),
+ children().size() * child_size.height() + GetInsets().height());
}
void SidebarItemsContentsView::OnThemeChanged() {
diff --git a/browser/ui/views/sidebar/sidebar_items_scroll_view.cc b/browser/ui/views/sidebar/sidebar_items_scroll_view.cc
index f1bf1bdf8361..32a3645b47dd 100644
--- a/browser/ui/views/sidebar/sidebar_items_scroll_view.cc
+++ b/browser/ui/views/sidebar/sidebar_items_scroll_view.cc
@@ -41,7 +41,7 @@ class SidebarItemsArrowView : public views::ImageButton {
SetImageHorizontalAlignment(views::ImageButton::ALIGN_CENTER);
SetImageVerticalAlignment(views::ImageButton::ALIGN_MIDDLE);
DCHECK(GetInstallFocusRingOnFocus());
- focus_ring()->SetColor(gfx::kBraveBlurple300);
+ views::FocusRing::Get(this)->SetColor(gfx::kBraveBlurple300);
}
~SidebarItemsArrowView() override = default;
diff --git a/browser/ui/views/sidebar/sidebar_show_options_event_detect_widget.cc b/browser/ui/views/sidebar/sidebar_show_options_event_detect_widget.cc
index 56020f55205c..728e4b144d34 100644
--- a/browser/ui/views/sidebar/sidebar_show_options_event_detect_widget.cc
+++ b/browser/ui/views/sidebar/sidebar_show_options_event_detect_widget.cc
@@ -11,6 +11,7 @@
#include "brave/browser/ui/views/frame/brave_browser_view.h"
#include "brave/grit/brave_generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/background.h"
diff --git a/browser/ui/views/speedreader/speedreader_icon_view.cc b/browser/ui/views/speedreader/speedreader_icon_view.cc
index fa48e11089d5..15b9cf843a53 100644
--- a/browser/ui/views/speedreader/speedreader_icon_view.cc
+++ b/browser/ui/views/speedreader/speedreader_icon_view.cc
@@ -24,6 +24,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/theme_provider.h"
+#include "ui/views/animation/ink_drop.h"
#include "ui/views/animation/ink_drop_host_view.h"
#include "ui/views/animation/ink_drop_state.h"
@@ -55,8 +56,10 @@ void SpeedreaderIconView::UpdateImpl() {
return;
}
- if (ink_drop()->GetHighlighted() && !IsBubbleShowing())
- ink_drop()->AnimateToState(views::InkDropState::HIDDEN, nullptr);
+ if (views::InkDrop::Get(this)->GetHighlighted() && !IsBubbleShowing()) {
+ views::InkDrop::Get(this)->AnimateToState(views::InkDropState::HIDDEN,
+ nullptr);
+ }
const ui::ThemeProvider* theme_provider = GetThemeProvider();
const DistillState state = GetDistillState();
diff --git a/browser/ui/views/tabs/brave_alert_indicator.cc b/browser/ui/views/tabs/brave_alert_indicator.cc
index 96c5e904c1c0..001aca4c9a56 100644
--- a/browser/ui/views/tabs/brave_alert_indicator.cc
+++ b/browser/ui/views/tabs/brave_alert_indicator.cc
@@ -18,6 +18,7 @@
#include "content/public/browser/web_contents.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/skia/include/core/SkPathTypes.h"
+#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/views/background.h"
diff --git a/browser/ui/webui/brave_welcome_ui.cc b/browser/ui/webui/brave_welcome_ui.cc
index 458894d63075..10b82af1041a 100644
--- a/browser/ui/webui/brave_welcome_ui.cc
+++ b/browser/ui/webui/brave_welcome_ui.cc
@@ -121,7 +121,8 @@ std::string CountryIDToCountryString(int country_id) {
if (country_id == country_codes::kCountryIDUnknown)
return std::string();
- char chars[3] = {(country_id >> 8) & 0xFF, country_id & 0xFF, 0};
+ char chars[3] = {static_cast(country_id >> 8),
+ static_cast(country_id), 0};
std::string country_string(chars);
DCHECK_EQ(country_string.size(), 2U);
return country_string;
diff --git a/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_page.html b/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_page.html
index ec212517abfa..e8b232d1a078 100644
--- a/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_page.html
+++ b/browser/ui/webui/ethereum_remote_client/ethereum_remote_client_page.html
@@ -9,7 +9,7 @@
-
+
-
-
-
-
\ No newline at end of file
+
+
diff --git a/ui/webui/resources/br_elements/br_toolbar/br_toolbar.js b/ui/webui/resources/br_elements/br_toolbar/br_toolbar.js
index 8da4d19e1b3b..cd7c583c69e4 100644
--- a/ui/webui/resources/br_elements/br_toolbar/br_toolbar.js
+++ b/ui/webui/resources/br_elements/br_toolbar/br_toolbar.js
@@ -2,6 +2,11 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
+import {Polymer, html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
+import 'chrome://resources/polymer/v3_0/iron-media-query/iron-media-query.js';
+import 'chrome://brave-resources/br_elements/shared_vars_css.m.js';
+import './br_toolbar_search_field.js';
+
const customCurrentWebUINameMap = {
extensions: 'settings',
sync: 'settings',
@@ -10,6 +15,8 @@ const customCurrentWebUINameMap = {
Polymer({
is: 'cr-toolbar',
+ _template: html`{__html_template__}`,
+
properties: {
// Name to display in the toolbar, in titlecase.
pageName: String,
diff --git a/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.html b/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.html
index 701e180f4885..06531b5ff51f 100644
--- a/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.html
+++ b/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.html
@@ -1,163 +1,154 @@
+
- .page-search_text:focus, .page-search_text:active {
- outline: none;
- border: none;
- }
-
- .page-search_close-button {
- margin: var(--search-padding);
- cursor: pointer;
- display: flex;
- align-items: center;
- }
- .page-search_close-button svg {
- height: var(--search-icon-size);
- width: var(--search-icon-size);
- padding: var(--search-icon-padding);
- }
-
-
-
+
diff --git a/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.js b/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.js
index 5c6af950d3ff..8695099e504b 100644
--- a/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.js
+++ b/ui/webui/resources/br_elements/br_toolbar/br_toolbar_search_field.js
@@ -3,11 +3,14 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
+import {Polymer, html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
import {CrSearchFieldBehavior} from 'chrome://resources/cr_elements/cr_search_field/cr_search_field_behavior.js';
Polymer({
is: 'br-toolbar-search-field',
+ _template: html`{__html_template__}`,
+
behaviors: [CrSearchFieldBehavior],
properties: {
@@ -166,4 +169,4 @@ Polymer({
this.setValue('')
this.getSearchInput().blur()
},
-})
+});
diff --git a/ui/webui/resources/br_elements_resources.grdp b/ui/webui/resources/br_elements_resources.grdp
index 9a215780e498..8282a0647e89 100644
--- a/ui/webui/resources/br_elements_resources.grdp
+++ b/ui/webui/resources/br_elements_resources.grdp
@@ -8,23 +8,6 @@
file="br_elements/shared_vars_css.html"
type="chrome_html"
compress="gzip" />
-
-
-
-
-
-
diff --git a/ui/webui/resources/css/text_defaults_md.css b/ui/webui/resources/css/text_defaults_md.css
index cd495831dcf1..82a76f8576cc 100644
--- a/ui/webui/resources/css/text_defaults_md.css
+++ b/ui/webui/resources/css/text_defaults_md.css
@@ -16,7 +16,7 @@
html {
/* TODO(dbeam): remove this soon. Prefer dir= in HTML. */
- direction: $i18n{textDirection};
+ direction: $i18n{textdirection};
}
body {
diff --git a/ui/webui/resources/polymer_overriding.js b/ui/webui/resources/polymer_overriding.js
index 0b598aea1d32..452772a3b9b0 100644
--- a/ui/webui/resources/polymer_overriding.js
+++ b/ui/webui/resources/polymer_overriding.js
@@ -3,9 +3,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
-import {Polymer, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
+import {html as polymerHtml, mixinBehaviors, Polymer, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// Global overrides
+import 'chrome://brave-resources/br_elements/br_toolbar/br_toolbar.js';
import CrButtonStyleTemplate from './overrides/cr_button.js'
import CrToggleStyleTemplate from './overrides/cr_toggle.js'
@@ -20,8 +21,11 @@ if (debug) {
const allBehaviorsMap = {}
const allPropertiesMap = {}
const componentPropertyModifications = {}
+const ignoredComponents = [
+ 'cr-toolbar'
+]
-function addBraveBehaviors(moduleName, component) {
+function addBraveBehaviorsLegacy(moduleName, component) {
if (allBehaviorsMap[moduleName]) {
component.behaviors = component.behaviors || []
component.behaviors.push(...allBehaviorsMap[moduleName])
@@ -45,7 +49,7 @@ function addBraveProperties(moduleName, component) {
const allBraveTemplateModificationsMap = {}
function addBraveTemplateModifications(moduleName, component, modifyFn) {
- const template = component.template || component._template
+ const template = component._template || component.template
if (template) {
const templateContent = template.content
const t0 = debug && performance.now()
@@ -60,9 +64,7 @@ function addBraveTemplateModifications(moduleName, component, modifyFn) {
const styleOverridePrefix = 'brave-override-style-'
-function addBraveStyleOverride(moduleName, component) {
- // does have template style element?
- const template = component.template || component._template
+function addBraveStyleOverride(moduleName, component, template = component._template || component.template) {
if (!template) {
console.error(`No template found for component (${moduleName}) with found style overrides`, component)
return
@@ -107,17 +109,34 @@ export function RegisterPolymerTemplateModifications(modificationsMap) {
const awaitingComponentModifications = {}
for (const componentName in modificationsMap) {
const modifyFn = modificationsMap[componentName]
- const existingComponent = window.customElements.get(componentName)
- if (!existingComponent) {
- awaitingComponentModifications[componentName] = modificationsMap[componentName]
- continue
- }
- // Component is already defined, modify now.
- addBraveTemplateModifications(componentName, existingComponent, modifyFn)
+ // const existingComponent = window.customElements.get(componentName)
+ // if (!existingComponent) {
+ awaitingComponentModifications[componentName] = modificationsMap[componentName]
+ // NOTE(petemill): If module has already been defined, it's not ideal as the unmodified
+ // template may already have been cloned for an element. However, we assume PolymerElement._prepareTemplate
+ // has not been called yet for the component.
+ // However, this would be more robust if we moved to a subclassing approach.
}
Object.assign(allBraveTemplateModificationsMap, awaitingComponentModifications)
}
+export function RegisterPolymerComponentReplacement(name, component) {
+ if (debug) {
+ console.log(`RegisterPolymerComponentReplacement: ${name}`)
+ }
+ if (!ignoredComponents.includes(name)) {
+ console.warn(`RegisterPolymerComponentReplacement: did not find component '${name}' as being ignored via RegisterPolymerComponentToIgnore`)
+ }
+ define(name, component)
+}
+
+export function RegisterPolymerComponentToIgnore(name) {
+ if (debug) {
+ console.log(`RegisterPolymerComponentToIgnore ${name}`)
+ }
+ ignoredComponents.push(name)
+}
+
const moduleNamesWithStyleOverrides = []
export async function RegisterStyleOverride(componentName, styleTemplate) {
@@ -137,21 +156,11 @@ export async function RegisterStyleOverride(componentName, styleTemplate) {
if (debug) {
console.log(`REGISTERING STYLE OVERRIDE for ${componentName}`, styleTemplate)
}
- // If module has already been defined, it's not ideal as the unmodified
- // template may already have been cloned for an element. However, let's make
- // an attempt and apply it anyway. Otherwise, we wait until it's defined and
- // then modify the template as soon as possible.
- const existingComponent = window.customElements.get(componentName)
- if (existingComponent) {
- addBraveStyleOverride(componentName, existingComponent)
- } else {
- // Cannot await CustomElementRegistry.whenDefined here
- // since getting in the async queue will mean this template
- // mofification happens too late. Instead, save this in a list
- // so that the template modification can happen inside the
- // customElements.define hook.
- moduleNamesWithStyleOverrides.push(componentName)
- }
+ // NOTE(petemill): If module has already been defined, it's not ideal as the unmodified
+ // template may already have been cloned for an element. However, we assume PolymerElement._prepareTemplate
+ // has not been called yet for the component.
+ // However, this would be more robust if we moved to a subclassing approach.
+ moduleNamesWithStyleOverrides.push(componentName)
}
export function OverrideIronIcons(iconSetName, overridingIconSetName, iconOverrides) {
@@ -198,32 +207,9 @@ export function OverrideIronIcons(iconSetName, overridingIconSetName, iconOverri
srcIconSet.getIconNames()
}
-function PerformBraveModifications(name, component) {
- if (debug) {
- console.debug(`Polymer component registering: ${name}`, component)
- }
- addBraveBehaviors(name, component)
- addBraveProperties(name, component)
- const templateModifyFn = allBraveTemplateModificationsMap[name]
- if (templateModifyFn) {
- addBraveTemplateModifications(name, component, templateModifyFn)
- delete allBraveTemplateModificationsMap[name]
- }
- if (moduleNamesWithStyleOverrides.includes(name)) {
- addBraveStyleOverride(name, component)
- }
-}
-
-// TODO(petemill): Overriding Polymer.Class only works because
-// chromium components at the moment are passing objects rather
-// than classes. If this changes, or for something more robust,
-// we can instead hook in to `window.customElements.define`. This
-// will require changing how we inject behaviors to instead return a
-// subclass of the original component, with the lifecycle methods added.
-// That's because behaviors are a legacy polymer feature,
-// now migrated to subclassing.
-// That should work for any type of Polymer component (class or
-// object-to-generated-class).
+// Overriding Polymer.Class only works for some
+// chromium components which call Polymer() and pass objects rather
+// than classes.
const oldClass = Polymer.Class
Polymer.Class = function (info, mixin) {
if (!info) {
@@ -237,12 +223,99 @@ Polymer.Class = function (info, mixin) {
return oldClass(info, mixin)
}
if (debug) {
- console.log('defined', name)
+ console.debug(`Polymer component legacy registering: ${name}`, info)
}
- PerformBraveModifications(name, info)
+ addBraveBehaviorsLegacy(name, info)
return oldClass(info, mixin)
}
+// Also override for components which do not call Polymer() but instead
+// inherit from PolymerElement.
+const oldPrepareTemplate = PolymerElement._prepareTemplate;
+PolymerElement._prepareTemplate = function BravePolymer_PrepareTemplate() {
+ oldPrepareTemplate.call(this)
+ const name = this.is
+ if (!name) {
+ if (debug) {
+ console.warn('PolymerElement defined with no name', this, this.prototype)
+ }
+ return
+ }
+ if (debug) {
+ console.log('PolymerElement _prepareTemplate: ', name, this, this.prototype)
+ }
+ // Perform modifications that we want to change the original class / prototype
+ // features, such as editing template or properties.
+ // Other modifications, such as injecting overriden classes (aka behaviors),
+ // will happen at component definition time.
+ addBraveProperties(name, this.prototype)
+ const templateModifyFn = allBraveTemplateModificationsMap[name]
+ if (templateModifyFn) {
+ addBraveTemplateModifications(name, this.prototype, templateModifyFn)
+ // TODO(petemill): delete allBraveTemplateModificationsMap entry when done so that the
+ // function can be collected. We do not delete at the moment since
+ // _prepareTemplate can be called multiple times. We should move template
+ // modification to happen via automatic subclassing and overriding of template
+ // property.
+ }
+ if (moduleNamesWithStyleOverrides.includes(name)) {
+ addBraveStyleOverride(name, this.prototype)
+ }
+}
+
+const oldDefine = window.customElements.define
+
+function BraveDefineCustomElements (name, component, options, useIgnoreList = true) {
+ if (component.polymerElementVersion) {
+ if (debug) {
+ console.log('BraveDefineCustomElements PolymerElement defined', name, component, options)
+ }
+ // Global ignore (likely due to manual replacement)
+ if (useIgnoreList && ignoredComponents.includes(name)) {
+ if (debug) {
+ console.log(`BraveDefineCustomElements ignored ${name}`)
+ }
+ return
+ }
+ // Inject behaviors
+ if (allBehaviorsMap[name]) {
+ if (debug) {
+ console.log('BraveDefineCustomElements added behavior', allBehaviorsMap[name])
+ }
+ component = mixinBehaviors(allBehaviorsMap[name], component)
+ delete allBehaviorsMap[name]
+ }
+ }
+ oldDefine.call(this, name, component, options)
+}
+
+window.customElements.define = BraveDefineCustomElements
+
+export function define (name, component, options) {
+ // We still want style and template overrides
+ BraveDefineCustomElements.call(window.customElements, name, component, options, false)
+}
+
+/**
+ * Allows regular string tagged templating before parsing as html elements.
+ * Differs from polymer's html function only in that it allows strings and
+ * does not allow nested htmlelements.
+ * Named html for syntax highlighting in some IDEs.
+ * @param {*} strings
+ * @param {...any} values
+ * @returns HTMLTEmplateElement
+ */
+ export function html(strings, ...values) {
+ // Get regular string placeholders first (basic `i am ${'a'} string` parsing)
+ // since Polymer's html tagged template only supports html element
+ // placeholders.
+ const htmlRaw = values.reduce((acc, v, idx) =>
+ acc + v + strings[idx + 1], strings[0])
+ // Utilize polymer's tagged template element creation for no other reason than we are allowed
+ // to call innerHTML there.
+ return polymerHtml([htmlRaw]).content.cloneNode(true)
+}
+
// Overrides for all pages
RegisterStyleOverride('cr-toggle', CrToggleStyleTemplate)
RegisterStyleOverride('cr-button', CrButtonStyleTemplate)
diff --git a/utility/importer/chrome_importer.cc b/utility/importer/chrome_importer.cc
index 6ee8d0446f73..a324f8326b75 100644
--- a/utility/importer/chrome_importer.cc
+++ b/utility/importer/chrome_importer.cc
@@ -137,14 +137,13 @@ bool SetEncryptionKey(const base::FilePath& source_path) {
return true;
}
-std::u16string DecryptedCardFromColumn(const sql::Statement& s,
- int column_index) {
+std::u16string DecryptedCardFromColumn(sql::Statement* s, int column_index) {
std::u16string credit_card_number;
- int encrypted_number_len = s.ColumnByteLength(column_index);
+ int encrypted_number_len = s->ColumnByteLength(column_index);
if (encrypted_number_len) {
std::string encrypted_number;
encrypted_number.resize(encrypted_number_len);
- memcpy(&encrypted_number[0], s.ColumnBlob(column_index),
+ memcpy(&encrypted_number[0], s->ColumnBlob(column_index),
encrypted_number_len);
OSCrypt::DecryptString16(encrypted_number, &credit_card_number);
}
@@ -409,7 +408,8 @@ void ChromeImporter::RecursiveReadBookmarksFolder(
// Folders are added implicitly on adding children, so we only
// explicitly add empty folders.
const base::ListValue* children;
- if (dict->GetList("children", &children) && children->empty()) {
+ if (dict->GetList("children", &children) &&
+ children->GetList().empty()) {
entry.in_toolbar = is_in_toolbar;
entry.is_folder = true;
entry.url = GURL();
@@ -503,7 +503,7 @@ void ChromeImporter::ImportPayments() {
auto* brave_bridge =
static_cast(bridge_.get());
while (s.Step()) {
- const std::u16string card_number = DecryptedCardFromColumn(s, 3);
+ const std::u16string card_number = DecryptedCardFromColumn(&s, 3);
// Empty means decryption is failed. Or chrome's data is invalid.
// Skip it.
if (card_number.empty())
diff --git a/vendor/bat-native-ads/include/bat/ads/page_transition_types.h b/vendor/bat-native-ads/include/bat/ads/page_transition_types.h
index 402cc29fead6..671c93c1c4d7 100644
--- a/vendor/bat-native-ads/include/bat/ads/page_transition_types.h
+++ b/vendor/bat-native-ads/include/bat/ads/page_transition_types.h
@@ -19,7 +19,7 @@ namespace ads {
// A type is made of a core value and a set of qualifiers. A type has one core
// value and 0 or or more qualifiers.
-enum PageTransitionType : int32_t {
+enum PageTransitionType : uint32_t {
// User got to this page by clicking a link on another page.
kPageTransitionLink = 0,
diff --git a/vendor/bat-native-ads/src/bat/ads/internal/security/crypto_util.cc b/vendor/bat-native-ads/src/bat/ads/internal/security/crypto_util.cc
index c1202c9c43da..73ef386a4492 100644
--- a/vendor/bat-native-ads/src/bat/ads/internal/security/crypto_util.cc
+++ b/vendor/bat-native-ads/src/bat/ads/internal/security/crypto_util.cc
@@ -12,9 +12,9 @@
#include
#include "base/base64.h"
+#include "base/cxx17_backports.h"
#include "base/json/json_reader.h"
#include "base/rand_util.h"
-#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "bat/ads/internal/logging.h"
diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/contribution/contribution_unblinded_unittest.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/contribution/contribution_unblinded_unittest.cc
index 499cf7c2e90f..cab2f9bb8517 100644
--- a/vendor/bat-native-ledger/src/bat/ledger/internal/contribution/contribution_unblinded_unittest.cc
+++ b/vendor/bat-native-ledger/src/bat/ledger/internal/contribution/contribution_unblinded_unittest.cc
@@ -6,6 +6,7 @@
#include
#include
+#include "base/cxx17_backports.h"
#include "base/test/task_environment.h"
#include "bat/ledger/internal/contribution/contribution_unblinded.h"
#include "bat/ledger/internal/database/database_contribution_info.h"
diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_promotion.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_promotion.cc
index d099e7727e0c..00c8c9340d2f 100644
--- a/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_promotion.cc
+++ b/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_promotion.cc
@@ -147,7 +147,7 @@ void CredentialsPromotion::Claim(
auto blinded_creds = ParseStringToBaseList(creds->blinded_creds);
- if (!blinded_creds || blinded_creds->empty()) {
+ if (!blinded_creds || blinded_creds->GetList().empty()) {
BLOG(0, "Blinded creds are corrupted, we will try to blind again");
auto save_callback =
std::bind(&CredentialsPromotion::RetryPreviousStepSaved,
@@ -375,7 +375,7 @@ void CredentialsPromotion::VerifyPublicKey(
auto promotion_keys = ParseStringToBaseList(promotion->public_keys);
- if (!promotion_keys || promotion_keys->empty()) {
+ if (!promotion_keys || promotion_keys->GetList().empty()) {
BLOG(0, "Public key is missing");
callback(type::Result::LEDGER_ERROR);
return;
diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_sku.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_sku.cc
index eaaa72577652..9deabf4df0a9 100644
--- a/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_sku.cc
+++ b/vendor/bat-native-ledger/src/bat/ledger/internal/credentials/credentials_sku.cc
@@ -212,7 +212,7 @@ void CredentialsSKU::Claim(
auto blinded_creds = ParseStringToBaseList(creds->blinded_creds);
- if (!blinded_creds || blinded_creds->empty()) {
+ if (!blinded_creds || blinded_creds->GetList().empty()) {
BLOG(0, "Blinded creds are corrupted, we will try to blind again");
auto save_callback =
std::bind(&CredentialsSKU::RetryPreviousStepSaved,
diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/database/database_migration_unittest.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/database/database_migration_unittest.cc
index f4ab87062a36..a5bff233b810 100644
--- a/vendor/bat-native-ledger/src/bat/ledger/internal/database/database_migration_unittest.cc
+++ b/vendor/bat-native-ledger/src/bat/ledger/internal/database/database_migration_unittest.cc
@@ -682,7 +682,7 @@ TEST_F(LedgerDatabaseMigrationTest, Migration_27_UnblindedTokens) {
unblinded_token.value = sql.ColumnDouble(3);
unblinded_token.creds_id = sql.ColumnString(4);
unblinded_token.expires_at = sql.ColumnInt64(5);
- reserved_at = sql.ColumnInt64(10);
+ reserved_at = sql.ColumnInt64(6);
}
EXPECT_EQ(unblinded_token.id, 1ull);
From 51e145c2cbaa2fd06b6bf66af05735a5e5c33ffc Mon Sep 17 00:00:00 2001
From: Max <41635752+mkarolin@users.noreply.github.com>
Date: Thu, 19 Aug 2021 12:18:53 -0400
Subject: [PATCH 02/15] Merge pull request #9786 from brave/93.0.4577.51
Updated patches from Chromium 93.0.4577.42 to Chromium 93.0.4577.51.
---
patches/chrome-VERSION.patch | 4 ++--
patches/chrome-browser-about_flags.cc.patch | 4 ++--
.../chrome-browser-flags-android-chrome_feature_list.cc.patch | 4 ++--
patches/chrome-browser-profiles-profile_impl.cc.patch | 4 ++--
...er-renderer_context_menu-render_view_context_menu.cc.patch | 4 ++--
...ser-renderer_context_menu-render_view_context_menu.h.patch | 4 ++--
patches/chrome-test-BUILD.gn.patch | 2 +-
patches/content-renderer-render_frame_impl.cc.patch | 4 ++--
8 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/patches/chrome-VERSION.patch b/patches/chrome-VERSION.patch
index a0337173be02..f2d99b961f3f 100644
--- a/patches/chrome-VERSION.patch
+++ b/patches/chrome-VERSION.patch
@@ -1,12 +1,12 @@
diff --git a/chrome/VERSION b/chrome/VERSION
-index cbe2ecc29727f2a478da66c8ca0460f4a97f47e7..3e5ec1ca5c23eb099cc66d24e40d562500739fb4 100644
+index 674f56f1d8a0f6a1c5ec5c1c3ec91416060e232f..dc2788c8932b059563ef115c1ff110e3c338ff2e 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
MAJOR=93
-MINOR=0
-BUILD=4577
--PATCH=42
+-PATCH=51
+MINOR=1
+BUILD=29
+PATCH=67
diff --git a/patches/chrome-browser-about_flags.cc.patch b/patches/chrome-browser-about_flags.cc.patch
index 3c152263b97f..12ada03f6903 100644
--- a/patches/chrome-browser-about_flags.cc.patch
+++ b/patches/chrome-browser-about_flags.cc.patch
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
-index dbf7a49288ee8e895c02f7e8f8a17cd1ec608657..8fb0f43365777c7756f282f73ea2024871d343d2 100644
+index b83ed2f1004a7bd9e1acca1bc93f81a32f4e514b..12c5842d40147770a8efec12b79c3dc5283be8a5 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -314,14 +314,14 @@ const FeatureEntry::Choice kTouchTextSelectionStrategyChoices[] = {
@@ -21,7 +21,7 @@ index dbf7a49288ee8e895c02f7e8f8a17cd1ec608657..8fb0f43365777c7756f282f73ea20248
const FeatureEntry::Choice kLiteVideoDefaultDownlinkBandwidthKbps[] = {
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
-@@ -7613,6 +7613,7 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -7617,6 +7617,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-flags-android-chrome_feature_list.cc.patch b/patches/chrome-browser-flags-android-chrome_feature_list.cc.patch
index 536dbc721d4a..e3c74a727f99 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 7c62c644b31f650f7e323328c7133bed5c48d849..1834a9b89ccb7f3941c7f320598031849dd64e43 100644
+index 272fba37dc5b936d9ca6f03f57915bafca35e05e..18bb7105ca6b6502a3b09a4e1c2356ac1837f644 100644
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
-@@ -335,6 +335,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
+@@ -334,6 +334,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
};
const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) {
diff --git a/patches/chrome-browser-profiles-profile_impl.cc.patch b/patches/chrome-browser-profiles-profile_impl.cc.patch
index dbea0b166689..ec2cbdd3ee05 100644
--- a/patches/chrome-browser-profiles-profile_impl.cc.patch
+++ b/patches/chrome-browser-profiles-profile_impl.cc.patch
@@ -1,8 +1,8 @@
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
-index 17926a44d919f6572df47fce0f5557babd3d0924..f7bf46181b5c7da0b099b951b52073b8a2266142 100644
+index 9a6b9dd9fe3c9791333b5954db7c805708520409..00990a60de163dc12f7e29957225f47b0076f521 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
-@@ -373,7 +373,7 @@ std::unique_ptr Profile::CreateProfile(const base::FilePath& path,
+@@ -374,7 +374,7 @@ std::unique_ptr Profile::CreateProfile(const base::FilePath& path,
NOTREACHED();
}
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 a0e2e73f85f0..bddf17c86a3a 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 7029436a258ca3d3abd2a9ad189a3fdcc9972182..366b3d2668cbe89b8a2742586b18c5a835453a74 100644
+index f709ee1009830dda862a171da637ae7b43520c76..a719398dc73f99c6787a1ea670475761ebd20103 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
-@@ -1772,6 +1772,7 @@ void RenderViewContextMenu::AppendSearchProvider() {
+@@ -1788,6 +1788,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 64a506407944..fe522ab1b7d6 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 7b6f19105c8ec62a19c88da779810d177e5db2a8..a209182134913735ae3c992692ca85f607be44a3 100644
+index 3e75832061fd2d07c624a81118a8aafbb2c6aa80..3eabff7369b4576a041608f80350604d36a7d29d 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h
-@@ -126,6 +126,7 @@ class RenderViewContextMenu : public RenderViewContextMenuBase,
+@@ -130,6 +130,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-test-BUILD.gn.patch b/patches/chrome-test-BUILD.gn.patch
index ae7691580391..3fb476bb27df 100644
--- a/patches/chrome-test-BUILD.gn.patch
+++ b/patches/chrome-test-BUILD.gn.patch
@@ -1,5 +1,5 @@
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
-index 1625f8917ac257f11f4637ea60eca586ec2492a3..1f166bdc58544087a96905ace8cd928be4d5dccc 100644
+index 139a04d6cbc1376340cf73a395e051fd2c7c9b11..6bcafc12aef2172eff9969bdcfb5a9bfdb93dd9e 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -1284,6 +1284,7 @@ if (!is_android) {
diff --git a/patches/content-renderer-render_frame_impl.cc.patch b/patches/content-renderer-render_frame_impl.cc.patch
index aa265fe1ae80..0fb7a1adb2fd 100644
--- a/patches/content-renderer-render_frame_impl.cc.patch
+++ b/patches/content-renderer-render_frame_impl.cc.patch
@@ -1,8 +1,8 @@
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index c8139a90c462297ceaed71c5db1be8b35e310f20..c69c9f723d2f3160b9223884760afb1fa9295631 100644
+index 118192cb4ea365f4b8fc84a802b9c6bb030461fc..759855cac6d5e1b9262dd0eea0fc131713a1c897 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
-@@ -4496,6 +4496,7 @@ bool RenderFrameImpl::ShouldUseUserAgentOverride() const {
+@@ -4517,6 +4517,7 @@ bool RenderFrameImpl::ShouldUseUserAgentOverride() const {
// Temporarily return early and fix properly as part of
// https://crbug.com/426555.
if (web_view->MainFrame()->IsWebRemoteFrame())
From 371433f5b8c09d8ed21836583dc4d63f35e919dd Mon Sep 17 00:00:00 2001
From: Max <41635752+mkarolin@users.noreply.github.com>
Date: Fri, 20 Aug 2021 08:47:36 -0400
Subject: [PATCH 03/15] Merge pull request #9789 from
brave/maxk-cr93fu-profile-picker-fix
[cr93 followup] Fixes profile picker - hides "Set up" page.
---
.../browser/ui/webui/signin/profile_picker_ui.cc | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/chromium_src/chrome/browser/ui/webui/signin/profile_picker_ui.cc b/chromium_src/chrome/browser/ui/webui/signin/profile_picker_ui.cc
index 703e09b53525..e116139b2495 100644
--- a/chromium_src/chrome/browser/ui/webui/signin/profile_picker_ui.cc
+++ b/chromium_src/chrome/browser/ui/webui/signin/profile_picker_ui.cc
@@ -6,9 +6,22 @@
#include "chrome/browser/ui/webui/signin/profile_picker_ui.h"
#include "brave/grit/brave_generated_resources.h"
+#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/grit/generated_resources.h"
+namespace {
+
+class BraveAccountConsistencyModeManager {
+ public:
+ static bool IsDiceSignInAllowed() { return false; }
+};
+
+} // namespace
+
+#define AccountConsistencyModeManager BraveAccountConsistencyModeManager
+
#undef IDS_DEFAULT_AVATAR_LABEL_26
#define IDS_DEFAULT_AVATAR_LABEL_26 IDS_BRAVE_AVATAR_LABEL_PLACEHOLDER
#include "../../../../../../../chrome/browser/ui/webui/signin/profile_picker_ui.cc"
#undef IDS_DEFAULT_AVATAR_LABEL_26
+#undef AccountConsistencyModeManager
From 6a716a7de9637e18bffa6205513112e285d98da2 Mon Sep 17 00:00:00 2001
From: Kevin Smith
Date: Mon, 23 Aug 2021 15:01:26 -0400
Subject: [PATCH 04/15] Merge pull request #9823 from
brave/ksmith-rewards-ntp-grid
Fix unclickable button on Rewards NTP widget
---
.../brave_new_tab_ui/components/default/rewards/index.tsx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/components/brave_new_tab_ui/components/default/rewards/index.tsx b/components/brave_new_tab_ui/components/default/rewards/index.tsx
index 6a8d8bbe6066..5546dece0ab4 100644
--- a/components/brave_new_tab_ui/components/default/rewards/index.tsx
+++ b/components/brave_new_tab_ui/components/default/rewards/index.tsx
@@ -230,6 +230,12 @@ class Rewards extends React.PureComponent {
// only show a single notification from any source.
// For now, this only happens for the branded wallpaper notification.
promotions = singleOrphaned ? [] : (promotions || [])
+
+ // Do not display the notification wrapper if there are no notifications.
+ if (promotions.length === 0 && !this.props.showBrandedWallpaperNotification) {
+ return null
+ }
+
const Wrapper = singleOrphaned ? React.Fragment : NotificationsList
return (
From 53bd973ce057cd8881555ce907300748b40905a0 Mon Sep 17 00:00:00 2001
From: Max <41635752+mkarolin@users.noreply.github.com>
Date: Mon, 23 Aug 2021 20:50:13 -0400
Subject: [PATCH 05/15] Merge pull request #9805 from
brave/maxk-cr93fu-guest-settings
[cr93 followup] Fixes brave://settings in Guest window.
---
browser/resources/settings/brave_routes.js | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/browser/resources/settings/brave_routes.js b/browser/resources/settings/brave_routes.js
index 30616d29990e..25c79d45684f 100644
--- a/browser/resources/settings/brave_routes.js
+++ b/browser/resources/settings/brave_routes.js
@@ -4,16 +4,13 @@
// you can obtain one at http://mozilla.org/MPL/2.0/.
import {pageVisibility} from './brave_overrides/page_visibility.js'
+import {loadTimeData} from './i18n_setup.js'
export default function addBraveRoutes(r) {
+ const isGuest = loadTimeData.getBoolean('isGuest')
if (!r.BASIC) {
console.error('[Brave Settings Overrides] Routes: could not find BASIC page')
}
- if (r.SITE_SETTINGS_ADS) {
- delete r.SITE_SETTINGS_ADS
- } else {
- console.error('[Brave Settings Overrides] could not find expected route site_settings_ads')
- }
if (pageVisibility.getStarted) {
r.GET_STARTED = r.BASIC.createSection('/getStarted', 'getStarted')
// bring back people's /manageProfile (now in getStarted)
@@ -43,6 +40,11 @@ export default function addBraveRoutes(r) {
if (isNativeBraveWalletFeatureEnabled) {
r.SITE_SETTINGS_ETHEREUM = r.SITE_SETTINGS.createChild('ethereum')
}
+ if (r.SITE_SETTINGS_ADS) {
+ delete r.SITE_SETTINGS_ADS
+ } else {
+ console.error('[Brave Settings Overrides] could not find expected route site_settings_ads')
+ }
} else if (!isGuest) {
console.error('[Brave Settings Overrides] Routes: could not find SITE_SETTINGS page')
}
From 644b8cd8339f261b2702b74d7aba2409ec846e4e Mon Sep 17 00:00:00 2001
From: "Brian R. Bondy"
Date: Mon, 23 Aug 2021 21:12:37 -0400
Subject: [PATCH 06/15] Merge pull request #9827 from
brave/usbDevices-permission-erc
Give ethereum-remote-client permissions to usbDevices
---
...tensions-common-api-_permission_features.json.patch | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/patches/extensions-common-api-_permission_features.json.patch b/patches/extensions-common-api-_permission_features.json.patch
index 3c5727cfd8cd..913baccb3401 100644
--- a/patches/extensions-common-api-_permission_features.json.patch
+++ b/patches/extensions-common-api-_permission_features.json.patch
@@ -1,5 +1,5 @@
diff --git a/extensions/common/api/_permission_features.json b/extensions/common/api/_permission_features.json
-index d9e0ea3166747329a4f4a219f9867cb5b43b0c75..b08eeba0807226d342b224796b36b0441a6b0fc8 100644
+index d9e0ea3166747329a4f4a219f9867cb5b43b0c75..7a187519e2c78a056c9c64f30c263d641ca35a3f 100644
--- a/extensions/common/api/_permission_features.json
+++ b/extensions/common/api/_permission_features.json
@@ -319,6 +319,7 @@
@@ -18,3 +18,11 @@ index d9e0ea3166747329a4f4a219f9867cb5b43b0c75..b08eeba0807226d342b224796b36b044
"496B6890097EB6E19809ADEADD095A8721FBB2E0", // FIDO U2F APIs
"AD8ED80B705E1818AAD4684F9FF62B43D6D79620", // FIDO U2F APIs (dev)
"E24F1786D842E91E74C27929B0B3715A4689A473", // CryptoToken
+@@ -670,6 +672,7 @@
+ "channel": "stable",
+ "extension_types": ["extension"],
+ "allowlist": [
++ "21070F3D60711361C1210B870439BE49B5D995F4", // Ethereum Remote Client extension
+ "496B6890097EB6E19809ADEADD095A8721FBB2E0", // FIDO U2F APIs
+ "AD8ED80B705E1818AAD4684F9FF62B43D6D79620", // FIDO U2F APIs (dev)
+ "E24F1786D842E91E74C27929B0B3715A4689A473", // CryptoToken
From f3e1998459266ffbcf2674937a5d075c8e095cdf Mon Sep 17 00:00:00 2001
From: Brian Clifton
Date: Tue, 24 Aug 2021 09:38:41 -0700
Subject: [PATCH 07/15] Merge pull request #9792 from
brave/maxk-cr93fu-disable-kReadLater
[cr93 followup] Disables kReadLater feature.
---
app/DEPS | 1 +
app/brave_main_delegate.cc | 2 ++
app/brave_main_delegate_browsertest.cc | 50 +++++++++++++-------------
test/BUILD.gn | 2 ++
4 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/app/DEPS b/app/DEPS
index 44f89d42b90e..c849e547e4ba 100644
--- a/app/DEPS
+++ b/app/DEPS
@@ -20,6 +20,7 @@ include_rules = [
"+components/offline_pages/core/offline_page_feature.h",
"+components/omnibox/common",
"+components/password_manager/core/common",
+ "+components/reading_list/features/reading_list_switches.h",
"+components/safe_browsing/core/common/features.h",
"+components/security_state/core/features.h",
"+components/signin/public/base",
diff --git a/app/brave_main_delegate.cc b/app/brave_main_delegate.cc
index ea67de3a6f1c..7e4dcc82fa3e 100644
--- a/app/brave_main_delegate.cc
+++ b/app/brave_main_delegate.cc
@@ -38,6 +38,7 @@
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/password_manager/core/common/password_manager_features.h"
+#include "components/reading_list/features/reading_list_switches.h"
#include "components/security_state/core/features.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/translate/core/browser/translate_prefs.h"
@@ -233,6 +234,7 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) {
network::features::kTrustTokens.name,
network_time::kNetworkTimeServiceQuerying.name,
password_manager::features::kEnablePasswordsAccountStorage.name,
+ reading_list::switches::kReadLater.name,
#if defined(OS_ANDROID)
features::kWebNfc.name,
feed::kInterestFeedContentSuggestions.name,
diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc
index d44845424dc5..9abd3a4bd0ff 100644
--- a/app/brave_main_delegate_browsertest.cc
+++ b/app/brave_main_delegate_browsertest.cc
@@ -15,6 +15,7 @@
#include "components/network_time/network_time_tracker.h"
#include "components/omnibox/common/omnibox_features.h"
#include "components/password_manager/core/common/password_manager_features.h"
+#include "components/reading_list/features/reading_list_switches.h"
#include "components/security_state/core/features.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/content_features.h"
@@ -69,30 +70,31 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, OriginTrialsTest) {
IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
const base::Feature* disabled_features[] = {
- &autofill::features::kAutofillEnableAccountWalletStorage,
- &autofill::features::kAutofillServerCommunication,
- &blink::features::kFledgeInterestGroupAPI,
- &blink::features::kFledgeInterestGroups,
- &blink::features::kHandwritingRecognitionWebPlatformApiFinch,
- &blink::features::kInterestCohortAPIOriginTrial,
- &blink::features::kInterestCohortFeaturePolicy,
- &blink::features::kTextFragmentAnchor,
- &features::kDirectSockets,
- &features::kIdleDetection,
- &features::kLangClientHintHeader,
- &features::kNotificationTriggers,
- &features::kPrivacySandboxSettings,
- &features::kSignedExchangePrefetchCacheForNavigations,
- &features::kSignedExchangeSubresourcePrefetch,
- &features::kSubresourceWebBundles,
- &features::kWebOTP,
- &federated_learning::kFederatedLearningOfCohorts,
- &federated_learning::kFlocIdComputedEventLogging,
- &media::kLiveCaption,
- &net::features::kFirstPartySets,
- &network::features::kTrustTokens,
- &network_time::kNetworkTimeServiceQuerying,
- &password_manager::features::kEnablePasswordsAccountStorage,
+ &autofill::features::kAutofillEnableAccountWalletStorage,
+ &autofill::features::kAutofillServerCommunication,
+ &blink::features::kFledgeInterestGroupAPI,
+ &blink::features::kFledgeInterestGroups,
+ &blink::features::kHandwritingRecognitionWebPlatformApiFinch,
+ &blink::features::kInterestCohortAPIOriginTrial,
+ &blink::features::kInterestCohortFeaturePolicy,
+ &blink::features::kTextFragmentAnchor,
+ &features::kDirectSockets,
+ &features::kIdleDetection,
+ &features::kLangClientHintHeader,
+ &features::kNotificationTriggers,
+ &features::kPrivacySandboxSettings,
+ &features::kSignedExchangePrefetchCacheForNavigations,
+ &features::kSignedExchangeSubresourcePrefetch,
+ &features::kSubresourceWebBundles,
+ &features::kWebOTP,
+ &federated_learning::kFederatedLearningOfCohorts,
+ &federated_learning::kFlocIdComputedEventLogging,
+ &media::kLiveCaption,
+ &net::features::kFirstPartySets,
+ &network::features::kTrustTokens,
+ &network_time::kNetworkTimeServiceQuerying,
+ &password_manager::features::kEnablePasswordsAccountStorage,
+ &reading_list::switches::kReadLater,
};
for (const auto* feature : disabled_features)
diff --git a/test/BUILD.gn b/test/BUILD.gn
index f2f3dea85510..b5f22a10a6e6 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -721,6 +721,7 @@ if (!is_android) {
"//brave/vendor/bat-native-ads",
"//brave/vendor/bat-native-ledger",
"//brave/vendor/bat-native-ledger:publishers_proto",
+ "//components/reading_list/features:flags",
"//components/security_interstitials/content:security_interstitial_page",
"//media:test_support",
"//testing/gmock",
@@ -982,6 +983,7 @@ if (!is_android) {
"//components/federated_learning",
"//components/language/core/common",
"//components/network_time",
+ "//components/reading_list/features:flags",
"//components/spellcheck/browser",
"//services/device/public/cpp:device_features",
From 919a4244a02f71ec58af31286d49aa1755db8dcb Mon Sep 17 00:00:00 2001
From: samartnik <30602739+samartnik@users.noreply.github.com>
Date: Tue, 24 Aug 2021 11:22:08 -0400
Subject: [PATCH 08/15] Merge pull request #9830 from
brave/android_dark_theme_color_fixes
[Android] Fixed colors for the dark theme
---
android/java/res/layout/icon_row_menu_footer.xml | 3 ++-
android/java/res/values-night/brave_colors.xml | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/android/java/res/layout/icon_row_menu_footer.xml b/android/java/res/layout/icon_row_menu_footer.xml
index 2382b933ff0e..3b3641904440 100644
--- a/android/java/res/layout/icon_row_menu_footer.xml
+++ b/android/java/res/layout/icon_row_menu_footer.xml
@@ -9,7 +9,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical" >
+ android:orientation="vertical"
+ android:background="@color/menu_action_bar_bg_color" >
diff --git a/android/java/res/values-night/brave_colors.xml b/android/java/res/values-night/brave_colors.xml
index a42703f88c6c..30fc195f10a0 100644
--- a/android/java/res/values-night/brave_colors.xml
+++ b/android/java/res/values-night/brave_colors.xml
@@ -6,6 +6,11 @@
-->
+
+
+ #5B2A23
+ #F35333
+ @color/default_text_color_on_accent1_light
#F0F2FF
#1E2029
From 30d906b3be23757012f6ef0ad8f32e6da0d33e89 Mon Sep 17 00:00:00 2001
From: samartnik <30602739+samartnik@users.noreply.github.com>
Date: Tue, 24 Aug 2021 14:18:03 -0400
Subject: [PATCH 09/15] Merge pull request #9837 from
brave/android_ntp_launch_fix
[Android] Fixed NTP launching on start up
---
.../org/chromium/chrome/browser/tabmodel/BraveTabCreator.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java b/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java
index 1d28c9272ee0..60d52cec2cd0 100644
--- a/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java
+++ b/android/java/org/chromium/chrome/browser/tabmodel/BraveTabCreator.java
@@ -42,7 +42,8 @@ public BraveTabCreator(Activity activity, WindowAndroid nativeWindow,
@Override
public Tab launchUrl(String url, @TabLaunchType int type) {
- if (url.equals(UrlConstants.NTP_URL) && type == TabLaunchType.FROM_CHROME_UI) {
+ if (url.equals(UrlConstants.NTP_URL)
+ && (type == TabLaunchType.FROM_CHROME_UI || type == TabLaunchType.FROM_STARTUP)) {
registerPageView();
ChromeTabbedActivity chromeTabbedActivity = BraveActivity.getChromeTabbedActivity();
if (chromeTabbedActivity != null && Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
From 9ce52e28766f85a69c2712a0994d2621268db664 Mon Sep 17 00:00:00 2001
From: AlexeyBarabash
Date: Wed, 25 Aug 2021 12:09:23 +0300
Subject: [PATCH 10/15] Merge pull request #9799 from brave/sync_cr93_fix_17580
Remove Chromium leftovers from sync types screen on Android
---
.../browser/sync/settings/BraveManageSyncSettings.java | 8 ++++++--
.../org/chromium/chrome/browser/BytecodeTest.java | 2 ++
.../bytecode/BraveManageSyncSettingsClassAdapter.java | 3 +++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/android/java/org/chromium/chrome/browser/sync/settings/BraveManageSyncSettings.java b/android/java/org/chromium/chrome/browser/sync/settings/BraveManageSyncSettings.java
index 3600010736b7..38e7bfb959d3 100644
--- a/android/java/org/chromium/chrome/browser/sync/settings/BraveManageSyncSettings.java
+++ b/android/java/org/chromium/chrome/browser/sync/settings/BraveManageSyncSettings.java
@@ -15,10 +15,11 @@
// See org.brave.bytecode.BraveManageSyncSettingsClassAdapter
public class BraveManageSyncSettings extends ManageSyncSettings {
- private Preference mGoogleActivityControls;
+ private static final String PREF_ADVANCED_CATEGORY = "advanced_category";
+ private Preference mTurnOffSync;
+ private Preference mGoogleActivityControls;
private Preference mSyncEncryption;
-
private Preference mManageSyncData;
private CheckBoxPreference mSyncPaymentsIntegration;
@@ -27,10 +28,13 @@ public class BraveManageSyncSettings extends ManageSyncSettings {
public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) {
super.onCreatePreferences(savedInstanceState, rootKey);
+ getPreferenceScreen().removePreference(mTurnOffSync);
getPreferenceScreen().removePreference(mGoogleActivityControls);
getPreferenceScreen().removePreference(mSyncEncryption);
getPreferenceScreen().removePreference(mManageSyncData);
+ findPreference(PREF_ADVANCED_CATEGORY).setVisible(false);
+
mSyncPaymentsIntegration.setVisible(false);
}
}
diff --git a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java
index 367cd7fad663..00236671c0e2 100644
--- a/android/javatests/org/chromium/chrome/browser/BytecodeTest.java
+++ b/android/javatests/org/chromium/chrome/browser/BytecodeTest.java
@@ -442,6 +442,8 @@ public void testFieldsExist() throws Exception {
Assert.assertTrue(
fieldExists("org/chromium/chrome/browser/sync/settings/ManageSyncSettings",
"mSyncPaymentsIntegration"));
+ Assert.assertTrue(fieldExists(
+ "org/chromium/chrome/browser/sync/settings/ManageSyncSettings", "mTurnOffSync"));
Assert.assertTrue(
fieldExists("org/chromium/chrome/browser/toolbar/bottom/BottomControlsCoordinator",
"mMediator"));
diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveManageSyncSettingsClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveManageSyncSettingsClassAdapter.java
index b362918c287b..3c38ca50933e 100644
--- a/build/android/bytecode/java/org/brave/bytecode/BraveManageSyncSettingsClassAdapter.java
+++ b/build/android/bytecode/java/org/brave/bytecode/BraveManageSyncSettingsClassAdapter.java
@@ -16,6 +16,9 @@ public class BraveManageSyncSettingsClassAdapter extends BraveClassVisitor {
BraveManageSyncSettingsClassAdapter(ClassVisitor visitor) {
super(visitor);
+ deleteField(sBraveManageSyncSettingsClassName, "mTurnOffSync");
+ makeProtectedField(sManageSyncSettingsClassName, "mTurnOffSync");
+
deleteField(sBraveManageSyncSettingsClassName, "mGoogleActivityControls");
makeProtectedField(sManageSyncSettingsClassName, "mGoogleActivityControls");
From 063da13f5239ded2d13d187113f27dd58759c41a Mon Sep 17 00:00:00 2001
From: Simon Hong
Date: Wed, 25 Aug 2021 23:12:58 +0900
Subject: [PATCH 11/15] Merge pull request #9849 from
brave/cr93_first_run_regression
Fixed first-run dialog is not launched
---
.../first_run/first_run_internal_posix.cc | 2 ++
common/BUILD.gn | 15 +++++++++++++++
common/brave_paths_unittest.cc | 16 ++++++++++++++++
test/BUILD.gn | 1 +
4 files changed, 34 insertions(+)
create mode 100644 common/brave_paths_unittest.cc
diff --git a/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc b/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc
index 27be1abcf61b..e4caa4fe07e8 100644
--- a/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc
+++ b/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc
@@ -32,8 +32,10 @@
#if defined(OFFICIAL_BUILD)
#undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING
#define BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING() (1)
+#define FILE_LOCAL_STATE PATH_END
#endif
#include "../../../../../chrome/browser/first_run/first_run_internal_posix.cc"
#if defined(OFFICIAL_BUILD)
#undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING
+#undef FILE_LOCAL_STATE
#endif
diff --git a/common/BUILD.gn b/common/BUILD.gn
index 1458f9dd312a..96ad4575d3a4 100644
--- a/common/BUILD.gn
+++ b/common/BUILD.gn
@@ -185,6 +185,21 @@ config("constants_configs") {
}
}
+source_set("unit_tests") {
+ testonly = true
+
+ if (!is_ios) {
+ sources = [ "brave_paths_unittest.cc" ]
+
+ deps = [
+ "//base",
+ "//brave/common",
+ "//chrome/common",
+ "//testing/gtest",
+ ]
+ }
+}
+
mojom("mojo_bindings") {
sources = [ "brave_renderer_configuration.mojom" ]
diff --git a/common/brave_paths_unittest.cc b/common/brave_paths_unittest.cc
new file mode 100644
index 000000000000..af3a43b2bd77
--- /dev/null
+++ b/common/brave_paths_unittest.cc
@@ -0,0 +1,16 @@
+/* Copyright (c) 2021 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/common/brave_paths.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "chrome/common/chrome_paths.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(BravePathsTest, PathTest) {
+ base::FilePath test_dir;
+ EXPECT_TRUE(base::PathService::Get(brave::DIR_TEST_DATA, &test_dir));
+ EXPECT_FALSE(base::PathService::Get(chrome::PATH_END, &test_dir));
+}
diff --git a/test/BUILD.gn b/test/BUILD.gn
index b5f22a10a6e6..2e521393d8da 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -168,6 +168,7 @@ test("brave_unit_tests") {
"//brave/chromium_src/components/autofill_assistant/browser:unit_tests",
"//brave/common:network_constants",
"//brave/common:pref_names",
+ "//brave/common:unit_tests",
"//brave/components/adblock_rust_ffi",
"//brave/components/brave_ads/test:brave_ads_unit_tests",
"//brave/components/brave_component_updater/browser",
From 69264e2d92f589fa9d57a206ca4ce11776e0b67b Mon Sep 17 00:00:00 2001
From: Brian Clifton
Date: Wed, 25 Aug 2021 09:32:02 -0700
Subject: [PATCH 12/15] Merge pull request #9839 from
brave/93.0.4577.58_master_116
Upgrade patches from Chromium 93.0.4577.51 to Chromium 93.0.4577.58
---
patches/chrome-VERSION.patch | 4 ++--
patches/chrome-browser-about_flags.cc.patch | 2 +-
...components-signin-internal-identity_manager-BUILD.gn.patch | 4 ++--
patches/third_party-blink-renderer-core-BUILD.gn.patch | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/patches/chrome-VERSION.patch b/patches/chrome-VERSION.patch
index f2d99b961f3f..e8b287f31a63 100644
--- a/patches/chrome-VERSION.patch
+++ b/patches/chrome-VERSION.patch
@@ -1,12 +1,12 @@
diff --git a/chrome/VERSION b/chrome/VERSION
-index 674f56f1d8a0f6a1c5ec5c1c3ec91416060e232f..dc2788c8932b059563ef115c1ff110e3c338ff2e 100644
+index 0c1c52e4a24298dafe6f31ca123212620145ac11..dc2788c8932b059563ef115c1ff110e3c338ff2e 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
MAJOR=93
-MINOR=0
-BUILD=4577
--PATCH=51
+-PATCH=58
+MINOR=1
+BUILD=29
+PATCH=67
diff --git a/patches/chrome-browser-about_flags.cc.patch b/patches/chrome-browser-about_flags.cc.patch
index 12ada03f6903..b280fe4860af 100644
--- a/patches/chrome-browser-about_flags.cc.patch
+++ b/patches/chrome-browser-about_flags.cc.patch
@@ -1,5 +1,5 @@
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
-index b83ed2f1004a7bd9e1acca1bc93f81a32f4e514b..12c5842d40147770a8efec12b79c3dc5283be8a5 100644
+index 11f9808ee1e06d51887100ae97f29b3215eb16aa..d56361c0f1381482db9b027061043efbf344e722 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -314,14 +314,14 @@ const FeatureEntry::Choice kTouchTextSelectionStrategyChoices[] = {
diff --git a/patches/components-signin-internal-identity_manager-BUILD.gn.patch b/patches/components-signin-internal-identity_manager-BUILD.gn.patch
index f918a50e4426..909d67afef2c 100644
--- a/patches/components-signin-internal-identity_manager-BUILD.gn.patch
+++ b/patches/components-signin-internal-identity_manager-BUILD.gn.patch
@@ -1,8 +1,8 @@
diff --git a/components/signin/internal/identity_manager/BUILD.gn b/components/signin/internal/identity_manager/BUILD.gn
-index e04392e9238a45e0578fe28fcd5c6f78a03c5cd6..fa27d96f68c452d07175f084f9bc811edf0df872 100644
+index 18e582ee309dcecbd03a72a8e0a11353c4ffed33..41a36579529679af9a22c6585ea6163e879138b8 100644
--- a/components/signin/internal/identity_manager/BUILD.gn
+++ b/components/signin/internal/identity_manager/BUILD.gn
-@@ -131,6 +131,7 @@ source_set("identity_manager") {
+@@ -132,6 +132,7 @@ source_set("identity_manager") {
"device_accounts_synchronizer_impl.h",
]
}
diff --git a/patches/third_party-blink-renderer-core-BUILD.gn.patch b/patches/third_party-blink-renderer-core-BUILD.gn.patch
index bf5251ca215a..52d762b981f5 100644
--- a/patches/third_party-blink-renderer-core-BUILD.gn.patch
+++ b/patches/third_party-blink-renderer-core-BUILD.gn.patch
@@ -1,5 +1,5 @@
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
-index 318e550f425aeee4995471a016c81adc51f4f98f..710127cedb4ba699b8394a003606f23adf7598de 100644
+index 347c19ef18510490d886abb7b1fc88a75f7e63c9..ed5dfc4f98147a0e044e38f8ec9fef1705a7610e 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -168,6 +168,7 @@ component("core") {
From 72f50d6ae51789a8ce12a81502cc967b03057a8d Mon Sep 17 00:00:00 2001
From: AlexeyBarabash
Date: Wed, 25 Aug 2021 19:23:39 +0300
Subject: [PATCH 13/15] Merge pull request #9851 from
brave/fix_android_test_17693
Fix tests on Android caused by regression PR9799
---
android/java/apk_for_test.flags | 1 +
1 file changed, 1 insertion(+)
diff --git a/android/java/apk_for_test.flags b/android/java/apk_for_test.flags
index d9be0453767d..c78839af8842 100644
--- a/android/java/apk_for_test.flags
+++ b/android/java/apk_for_test.flags
@@ -72,6 +72,7 @@
*** mSyncEncryption;
*** mManageSyncData;
*** mSyncPaymentsIntegration;
+ *** mTurnOffSync;
}
-keep class org.chromium.chrome.browser.search_engines.settings.SearchEngineAdapter {
From e059ea9583f6f16c1251054457bb5912f2512c6c Mon Sep 17 00:00:00 2001
From: Brian Clifton
Date: Wed, 25 Aug 2021 15:20:04 -0700
Subject: [PATCH 14/15] Merge pull request #9807 from
brave/maxk-cr93fu-enable-kEnablePasswordsAccountStorage
[cr93 followup] Removed disablement of kEnablePasswordsAccountStorage.
---
app/brave_main_delegate.cc | 1 -
app/brave_main_delegate_browsertest.cc | 1 -
.../core/browser/sync_credentials_filter.cc | 22 +++++++++++++++++++
.../core/browser/sync_credentials_filter.h | 19 ++++++++++++++++
4 files changed, 41 insertions(+), 2 deletions(-)
create mode 100644 chromium_src/components/password_manager/core/browser/sync_credentials_filter.cc
create mode 100644 chromium_src/components/password_manager/core/browser/sync_credentials_filter.h
diff --git a/app/brave_main_delegate.cc b/app/brave_main_delegate.cc
index 7e4dcc82fa3e..6f91eac32c23 100644
--- a/app/brave_main_delegate.cc
+++ b/app/brave_main_delegate.cc
@@ -233,7 +233,6 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) {
net::features::kFirstPartySets.name,
network::features::kTrustTokens.name,
network_time::kNetworkTimeServiceQuerying.name,
- password_manager::features::kEnablePasswordsAccountStorage.name,
reading_list::switches::kReadLater.name,
#if defined(OS_ANDROID)
features::kWebNfc.name,
diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc
index 9abd3a4bd0ff..52402edf0532 100644
--- a/app/brave_main_delegate_browsertest.cc
+++ b/app/brave_main_delegate_browsertest.cc
@@ -93,7 +93,6 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
&net::features::kFirstPartySets,
&network::features::kTrustTokens,
&network_time::kNetworkTimeServiceQuerying,
- &password_manager::features::kEnablePasswordsAccountStorage,
&reading_list::switches::kReadLater,
};
diff --git a/chromium_src/components/password_manager/core/browser/sync_credentials_filter.cc b/chromium_src/components/password_manager/core/browser/sync_credentials_filter.cc
new file mode 100644
index 000000000000..cd1d0585c17f
--- /dev/null
+++ b/chromium_src/components/password_manager/core/browser/sync_credentials_filter.cc
@@ -0,0 +1,22 @@
+/* Copyright (c) 2021 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 "components/password_manager/core/browser/sync_credentials_filter.h"
+
+#define ShouldSave ShouldSave_ChromiumImpl
+#include "../../../../../../components/password_manager/core/browser/sync_credentials_filter.cc"
+#undef ShouldSave
+
+namespace password_manager {
+
+bool SyncCredentialsFilter::ShouldSave(const PasswordForm& form) const {
+ bool should_save = ShouldSave_ChromiumImpl(form);
+ if (!should_save && sync_util::IsGaiaCredentialPage(form.signon_realm)) {
+ return true;
+ }
+ return should_save;
+}
+
+} // namespace password_manager
diff --git a/chromium_src/components/password_manager/core/browser/sync_credentials_filter.h b/chromium_src/components/password_manager/core/browser/sync_credentials_filter.h
new file mode 100644
index 000000000000..e71e455e6335
--- /dev/null
+++ b/chromium_src/components/password_manager/core/browser/sync_credentials_filter.h
@@ -0,0 +1,19 @@
+/* Copyright (c) 2021 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_COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SYNC_CREDENTIALS_FILTER_H_
+#define BRAVE_CHROMIUM_SRC_COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SYNC_CREDENTIALS_FILTER_H_
+
+#include "components/password_manager/core/browser/credentials_filter.h"
+
+#define ShouldSave \
+ ShouldSave_ChromiumImpl(const PasswordForm& form) const; \
+ bool ShouldSave
+
+#include "../../../../../../components/password_manager/core/browser/sync_credentials_filter.h"
+
+#undef ShouldSave
+
+#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SYNC_CREDENTIALS_FILTER_H_
From 413acfcfd635590abef585e34fcf96b15964b3ed Mon Sep 17 00:00:00 2001
From: Max <41635752+mkarolin@users.noreply.github.com>
Date: Wed, 25 Aug 2021 21:53:59 -0400
Subject: [PATCH 15/15] Merge pull request #9858 from
brave/maxk-cr93fu-fix-webtorrent-crash
[cr93 followup] Fix for webtorrent crash.
---
...tcp_server-sockets_tcp_server_api.cc.patch | 23 +++++++++++++++++++
..._tcp_server-sockets_tcp_server_api.h.patch | 14 +++++++++++
...sockets_tcp_server-api-background.js.patch | 16 +++++++++++++
3 files changed, 53 insertions(+)
create mode 100644 patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch
create mode 100644 patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch
create mode 100644 patches/extensions-test-data-sockets_tcp_server-api-background.js.patch
diff --git a/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch b/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch
new file mode 100644
index 000000000000..285221794881
--- /dev/null
+++ b/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.cc.patch
@@ -0,0 +1,23 @@
+diff --git a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc
+index fcba8ac797b18084efd5a79ae7cdf25487a61407..abf5c544601b32ca6898f64b9bd3927dceff4a41 100644
+--- a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc
++++ b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.cc
+@@ -256,15 +256,15 @@ SocketsTcpServerGetInfoFunction::~SocketsTcpServerGetInfoFunction() = default;
+ ExtensionFunction::ResponseAction SocketsTcpServerGetInfoFunction::Work() {
+ std::unique_ptr params =
+ sockets_tcp_server::GetInfo::Params::Create(*args_);
+- EXTENSION_FUNCTION_VALIDATE(params_.get());
++ EXTENSION_FUNCTION_VALIDATE(params.get());
+
+- ResumableTCPServerSocket* socket = GetTcpSocket(params_->socket_id);
++ ResumableTCPServerSocket* socket = GetTcpSocket(params->socket_id);
+ if (!socket) {
+ return RespondNow(Error(kSocketNotFoundError));
+ }
+
+ sockets_tcp_server::SocketInfo socket_info =
+- CreateSocketInfo(params_->socket_id, socket);
++ CreateSocketInfo(params->socket_id, socket);
+ return RespondNow(
+ ArgumentList(sockets_tcp_server::GetInfo::Results::Create(socket_info)));
+ }
diff --git a/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch b/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch
new file mode 100644
index 000000000000..aea55cef8541
--- /dev/null
+++ b/patches/extensions-browser-api-sockets_tcp_server-sockets_tcp_server_api.h.patch
@@ -0,0 +1,14 @@
+diff --git a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h
+index 39d68080d449de6a3de282afe4d6335652402e06..d60fa8bbe677c83037f26c5b3cfd286d6a79bd8a 100644
+--- a/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h
++++ b/extensions/browser/api/sockets_tcp_server/sockets_tcp_server_api.h
+@@ -134,9 +134,6 @@ class SocketsTcpServerGetInfoFunction : public TCPServerSocketApiFunction {
+
+ // SocketApiFunction:
+ ResponseAction Work() override;
+-
+- private:
+- std::unique_ptr params_;
+ };
+
+ class SocketsTcpServerGetSocketsFunction : public TCPServerSocketApiFunction {
diff --git a/patches/extensions-test-data-sockets_tcp_server-api-background.js.patch b/patches/extensions-test-data-sockets_tcp_server-api-background.js.patch
new file mode 100644
index 000000000000..6fbf01aae0b0
--- /dev/null
+++ b/patches/extensions-test-data-sockets_tcp_server-api-background.js.patch
@@ -0,0 +1,16 @@
+diff --git a/extensions/test/data/sockets_tcp_server/api/background.js b/extensions/test/data/sockets_tcp_server/api/background.js
+index 8a2ff5ee95c74b1cc4e9a9e6bf62db889fe83309..f25b1e7dead44c84bc3019103a95a3c9101f9a91 100644
+--- a/extensions/test/data/sockets_tcp_server/api/background.js
++++ b/extensions/test/data/sockets_tcp_server/api/background.js
+@@ -43,6 +43,11 @@ var testSocketListening = function() {
+ function onServerSocketCreate(socketInfo) {
+ console.log("Server socket created: sd=" + socketInfo.socketId);
+ socketId = socketInfo.socketId;
++ chrome.sockets.tcpServer.getInfo(socketId, onGetInfo);
++ }
++
++ function onGetInfo(socketInfo) {
++ chrome.test.assertEq(socketInfo.socketId, socketId);
+ chrome.sockets.tcpServer.listen(socketId, address, port, onListen);
+ }
+