diff --git a/android/browsertests_apk/AndroidManifest.xml.jinja2 b/android/browsertests_apk/AndroidManifest.xml.jinja2 index 118c45569644..fa687a2b87e7 100644 --- a/android/browsertests_apk/AndroidManifest.xml.jinja2 +++ b/android/browsertests_apk/AndroidManifest.xml.jinja2 @@ -34,7 +34,8 @@ android:theme="@style/Theme.Chromium.TabbedMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize" android:hardwareAccelerated="true" - android:process=":test_process"> + android:process=":test_process" + android:exported="true"> @@ -109,6 +110,27 @@ + + + + + + + + + + + + + + + + + + diff --git a/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java b/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java index a1cfc368a016..83b8432c4ca4 100644 --- a/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java +++ b/android/feed/core/java/src/org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator.java @@ -7,6 +7,7 @@ import android.app.Activity; import android.view.View; +import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ScrollView; @@ -51,13 +52,14 @@ public BraveFeedSurfaceCoordinator(Activity activity, SnackbarManager snackbarMa PrivacyPreferencesManagerImpl privacyPreferencesManager, @NonNull Supplier toolbarSupplier, FeedLaunchReliabilityLoggingState launchReliabilityLoggingState, - @Nullable FeedSwipeRefreshLayout swipeRefreshLayout, boolean overScrollDisabled) { + @Nullable FeedSwipeRefreshLayout swipeRefreshLayout, boolean overScrollDisabled, + @Nullable ViewGroup viewportView) { super(activity, snackbarManager, windowAndroid, snapScrollHelper, ntpHeader, sectionHeaderView, showDarkBackground, delegate, pageNavigationDelegate, profile, isPlaceholderShownInitially, bottomSheetController, shareDelegateSupplier, externalScrollableContainerDelegate, launchOrigin, privacyPreferencesManager, toolbarSupplier, launchReliabilityLoggingState, swipeRefreshLayout, - overScrollDisabled); + overScrollDisabled, viewportView); } @Override diff --git a/android/java/AndroidManifest.xml b/android/java/AndroidManifest.xml index f0d2bffa0a97..22f036f8a27a 100644 --- a/android/java/AndroidManifest.xml +++ b/android/java/AndroidManifest.xml @@ -89,7 +89,8 @@ + android:theme="@style/Theme.Chromium.Activity.Fullscreen" + android:exported="true"> diff --git a/android/java/apk_for_test.flags b/android/java/apk_for_test.flags index 81505ae63cd5..e3066b07853e 100644 --- a/android/java/apk_for_test.flags +++ b/android/java/apk_for_test.flags @@ -363,3 +363,7 @@ -keep class org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator { public (...); } + +-keep class org.chromium.chrome.browser.theme.ThemeUtils { + *** getTextBoxColorForToolbarBackgroundInNonNativePage(...); +} diff --git a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java index 59ae0da7bda5..f0d41c030a75 100644 --- a/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java +++ b/android/java/org/chromium/chrome/browser/local_database/DatabaseHelper.java @@ -5,21 +5,22 @@ package org.chromium.chrome.browser.local_database; +import android.annotation.SuppressLint; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; -import android.util.Pair; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; +import android.util.Pair; -import java.util.ArrayList; -import java.util.List; - -import org.chromium.base.Log; import org.chromium.base.ContextUtils; +import org.chromium.base.Log; import org.chromium.chrome.browser.ntp_background_images.model.TopSite; import org.chromium.chrome.browser.ntp_background_images.util.NTPUtil; +import java.util.ArrayList; +import java.util.List; + public class DatabaseHelper extends SQLiteOpenHelper { private static volatile DatabaseHelper mInstance; @@ -88,6 +89,7 @@ public void insertTopSite(TopSite topSite) { } } + @SuppressLint("Range") public List getAllTopSites() { List topSites = new ArrayList<>(); @@ -168,6 +170,7 @@ private boolean isAdsTrackerAlreadyAdded(BraveStatsTable braveStat) { return count > 0; } + @SuppressLint("Range") public List getAllStats() { List braveStats = new ArrayList<>(); @@ -198,6 +201,7 @@ public List getAllStats() { return braveStats; } + @SuppressLint("Range") public List getAllStatsWithDate(String thresholdTime, String currentTime) { List braveStats = new ArrayList<>(); // Select All Query @@ -229,6 +233,7 @@ public List getAllStatsWithDate(String thresholdTime, String cu return braveStats; } + @SuppressLint("Range") public List> getStatsWithDate(String thresholdTime, String currentTime) { List> braveStats = new ArrayList<>(); @@ -254,6 +259,7 @@ public List> getStatsWithDate(String thresholdTime, String return braveStats; } + @SuppressLint("Range") public List> getSitesWithDate(String thresholdTime, String currentTime) { List> braveStats = new ArrayList<>(); // Select All Query @@ -298,6 +304,7 @@ public long insertSavedBandwidth(SavedBandwidthTable savedBandwidthTable) { return db.insert(SavedBandwidthTable.TABLE_NAME, null, values); } + @SuppressLint("Range") public long getTotalSavedBandwidthWithDate(String thresholdTime, String currentTime) { long sum = 0; String selectQuery = "SELECT SUM(" + SavedBandwidthTable.COLUMN_SAVED_BANDWIDTH + ") as total FROM " @@ -315,6 +322,7 @@ public long getTotalSavedBandwidthWithDate(String thresholdTime, String currentT return sum; } + @SuppressLint("Range") public long getTotalSavedBandwidth() { long sum = 0; String selectQuery = "SELECT SUM(" + SavedBandwidthTable.COLUMN_SAVED_BANDWIDTH + ") as total FROM " diff --git a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java index bc1cf3ccc5f8..7feb10b0dffc 100644 --- a/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java +++ b/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java @@ -77,6 +77,7 @@ windowAndroid, new SnapScrollHelper(mNewTabPageManager, mNewTabPageLayout), NewTabPageUtils.decodeOriginFromNtpUrl(url), PrivacyPreferencesManagerImpl.getInstance(), mToolbarSupplier, /* FeedLaunchReliabilityLoggingState */ null, - FeedSwipeRefreshLayout.create(activity), /* overScrollDisabled= */ false); + FeedSwipeRefreshLayout.create(activity), /* overScrollDisabled= */ false, + /* viewportView= */ null); } } diff --git a/android/java/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java b/android/java/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java index dc43ed499e43..5d02f16bdc82 100644 --- a/android/java/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java +++ b/android/java/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java @@ -168,6 +168,8 @@ void setIncognitoCookieControlsToggleEnforcement(@CookieControlsEnforcement int */ void setIncognitoCookieControlsIconOnclickListener(OnClickListener listener) {} + void setIncognitoNewTabHeader(String newTabPageHeader) {} + @Override public void onAttachedToWindow() { super.onAttachedToWindow(); diff --git a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java index 9adb8ef6ed8c..415027f34fcf 100644 --- a/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java +++ b/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java @@ -63,12 +63,6 @@ public void signinAndEnableSync(@SigninAccessPoint int accessPoint, Account acco @Override public void signin(CoreAccountInfo accountInfo, @Nullable SignInCallback callback) {} - @Override - public void removeSignInAllowedObserver(SignInAllowedObserver observer) {} - - @Override - public void addSignInAllowedObserver(SignInAllowedObserver observer) {} - @Override public void removeSignInStateObserver(SignInStateObserver observer) {} diff --git a/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java b/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java index f1a71edda569..0b0c1601da27 100644 --- a/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java +++ b/android/java/org/chromium/chrome/browser/site_settings/BraveSiteSettingsDelegate.java @@ -13,7 +13,7 @@ import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.browser.app.BraveActivity; import org.chromium.chrome.browser.site_settings.ChromeSiteSettingsDelegate; -import org.chromium.components.embedder_support.browser_context.BrowserContextHandle; +import org.chromium.content_public.browser.BrowserContextHandle; import org.chromium.url.GURL; public class BraveSiteSettingsDelegate extends ChromeSiteSettingsDelegate { diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java index 1b8f8e66a809..2f29ecac7576 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/BottomToolbarNewTabButton.java @@ -33,8 +33,8 @@ class BottomToolbarNewTabButton extends ChromeImageButton /** The gray pill background behind the plus icon. */ private Drawable mBackground; - /** The {@link Resources} used to compute the background color. */ - private final Resources mResources; + /** The {@link Context} used to compute the background color. */ + private final Context mContext; /** A provider that notifies when incognito mode is entered or exited. */ private IncognitoStateProvider mIncognitoStateProvider; @@ -45,7 +45,7 @@ class BottomToolbarNewTabButton extends ChromeImageButton public BottomToolbarNewTabButton(Context context, AttributeSet attrs) { super(context, attrs); - mResources = context.getResources(); + mContext = context; } @Override @@ -105,7 +105,7 @@ private void updateBackground() { return; } mBackground.setColorFilter( - ThemeUtils.getTextBoxColorForToolbarBackgroundInNonNativePage(mResources, + ThemeUtils.getTextBoxColorForToolbarBackgroundInNonNativePage(mContext, mThemeColorProvider.getThemeColor(), mThemeColorProvider.useLight() && mIncognitoStateProvider.isIncognitoSelected()), diff --git a/android/java/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java b/android/java/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java index e0b614b47b33..a9bbf632d8a4 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java +++ b/android/java/org/chromium/chrome/browser/toolbar/bottom/SearchAccelerator.java @@ -32,8 +32,8 @@ class SearchAccelerator extends ChromeImageButton /** The gray pill background behind the search icon. */ private final Drawable mBackground; - /** The {@link Resources} used to compute the background color. */ - private final Resources mResources; + /** The {@link Context} used to compute the background color. */ + private final Context mContext; /** A provider that notifies components when the theme color changes.*/ private ThemeColorProvider mThemeColorProvider; @@ -44,9 +44,10 @@ class SearchAccelerator extends ChromeImageButton public SearchAccelerator(Context context, AttributeSet attrs) { super(context, attrs); - mResources = context.getResources(); + mContext = context; - mBackground = ApiCompatibilityUtils.getDrawable(mResources, R.drawable.ntp_search_box); + mBackground = ApiCompatibilityUtils.getDrawable( + mContext.getResources(), R.drawable.ntp_search_box); mBackground.mutate(); setBackground(mBackground); @@ -97,7 +98,7 @@ private void updateBackground() { if (mThemeColorProvider == null || mIncognitoStateProvider == null) return; mBackground.setColorFilter(ThemeUtils.getTextBoxColorForToolbarBackgroundInNonNativePage( - mResources, mThemeColorProvider.getThemeColor(), + mContext, mThemeColorProvider.getThemeColor(), mIncognitoStateProvider.isIncognitoSelected() && mThemeColorProvider.useLight()), PorterDuff.Mode.SRC_IN); diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveTabSwitcherModeTTPhone.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveTabSwitcherModeTTPhone.java index e009ca6f9416..c5d8cf4ddb67 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveTabSwitcherModeTTPhone.java +++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveTabSwitcherModeTTPhone.java @@ -61,6 +61,6 @@ void onBottomToolbarVisibilityChanged(boolean isVisible) { public int getToolbarColorForCurrentState() { // Return primary background color regardless of GridTabSwitcher state. Otherwise toolbar of // browsing mode is still visible in tab switching mode with stack layout. - return ChromeColors.getPrimaryBackgroundColor(getResources(), mIsIncognito); + return ChromeColors.getPrimaryBackgroundColor(getContext(), mIsIncognito); } } diff --git a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java index ddaa58324c55..6a1d6cd32551 100644 --- a/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java +++ b/android/java/org/chromium/chrome/browser/toolbar/top/BraveToolbarLayoutImpl.java @@ -993,7 +993,7 @@ public void populateUrlAnimatorSetImpl(boolean showExpandedState, public void updateModernLocationBarColorImpl(int color) { if (mShieldsLayout != null && mShieldsLayoutIsColorBackground) { mShieldsLayout.setBackgroundColor( - ChromeColors.getDefaultThemeColor(getContext().getResources(), isIncognito())); + ChromeColors.getDefaultThemeColor(getContext(), isIncognito())); } mCurrentToolbarColor = color; if (mShieldsLayout != null) { @@ -1191,7 +1191,7 @@ private void updateNotificationBadgeForNewInstall() { @Override public void onThemeColorChanged(int color, boolean shouldAnimate) { final int textBoxColor = ThemeUtils.getTextBoxColorForToolbarBackgroundInNonNativePage( - getContext().getResources(), color, isIncognito()); + getContext(), color, isIncognito()); updateModernLocationBarColorImpl(textBoxColor); } @@ -1250,7 +1250,7 @@ private void updateShieldsLayoutBackground(boolean rounded) { mShieldsLayoutIsColorBackground = false; } else { mShieldsLayout.setBackgroundColor( - ChromeColors.getDefaultThemeColor(getContext().getResources(), isIncognito())); + ChromeColors.getDefaultThemeColor(getContext(), isIncognito())); mShieldsLayoutIsColorBackground = true; } updateModernLocationBarColorImpl(mCurrentToolbarColor); diff --git a/android/java/res/xml/legal_information_preferences.xml b/android/java/res/xml/legal_information_preferences.xml index 15adc6e0291b..863586119075 100644 --- a/android/java/res/xml/legal_information_preferences.xml +++ b/android/java/res/xml/legal_information_preferences.xml @@ -15,8 +15,8 @@ android:title="@string/google_terms_of_service_title" app:url="@string/brave_terms_of_service_url" /> + + {COUNT, plural, + =0 {Open all in &new tab group} + =1 {Open in &new tab group} + other {Open all ({COUNT}) in &new tab group}} + &Open in new tab @@ -138,6 +144,12 @@ =1 {Open in &Private Window} other {Open All ({COUNT}) in &Private Window}} + + {COUNT, plural, + =0 {Open All in &New Tab Group} + =1 {Open in &New Tab Group} + other {Open All ({COUNT}) in &New Tab Group}} + &Open in New Tab diff --git a/app/brave_main_delegate.cc b/app/brave_main_delegate.cc index a2ea04be710d..688af8527b5c 100644 --- a/app/brave_main_delegate.cc +++ b/app/brave_main_delegate.cc @@ -212,10 +212,11 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) { blink::features::kHandwritingRecognitionWebPlatformApiFinch.name, blink::features::kInterestCohortAPIOriginTrial.name, blink::features::kInterestCohortFeaturePolicy.name, + blink::features::kLangClientHintHeader.name, + blink::features::kNavigatorPluginsFixed.name, blink::features::kTextFragmentAnchor.name, features::kDirectSockets.name, features::kIdleDetection.name, - features::kLangClientHintHeader.name, features::kNotificationTriggers.name, features::kPrivacySandboxSettings.name, features::kSignedExchangePrefetchCacheForNavigations.name, diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc index 52402edf0532..177704661419 100644 --- a/app/brave_main_delegate_browsertest.cc +++ b/app/brave_main_delegate_browsertest.cc @@ -77,10 +77,11 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &blink::features::kHandwritingRecognitionWebPlatformApiFinch, &blink::features::kInterestCohortAPIOriginTrial, &blink::features::kInterestCohortFeaturePolicy, + &blink::features::kLangClientHintHeader, + &blink::features::kNavigatorPluginsFixed, &blink::features::kTextFragmentAnchor, &features::kDirectSockets, &features::kIdleDetection, - &features::kLangClientHintHeader, &features::kNotificationTriggers, &features::kPrivacySandboxSettings, &features::kSignedExchangePrefetchCacheForNavigations, diff --git a/app/brave_strings.grd b/app/brave_strings.grd index 9d514230b741..b782e5fd4cb7 100644 --- a/app/brave_strings.grd +++ b/app/brave_strings.grd @@ -1250,6 +1250,11 @@ Brave is unable to recover your settings. A Brave profile with this account already exists on this device + + + The following accounts are not signed into any Brave profiles. If you want to use an account in another profile, remove that profile first. + + diff --git a/app/brave_strings_override.grd b/app/brave_strings_override.grd index b2b51a5428a7..70e3525972d0 100644 --- a/app/brave_strings_override.grd +++ b/app/brave_strings_override.grd @@ -295,6 +295,9 @@ If you update this file, be sure also to update google_chrome_strings.grd. --> + + + diff --git a/app/generated_resources.grd b/app/generated_resources.grd index 47b17fae60ac..0ffff4b65b66 100644 --- a/app/generated_resources.grd +++ b/app/generated_resources.grd @@ -394,8 +394,8 @@ are declared in tools/grit/grit_rule.gni. Permission requested, press ⌘ + Option + Down arrow to respond - - + + Permission requested, press F6 to respond @@ -648,8 +648,8 @@ are declared in tools/grit/grit_rule.gni. &Loop - - Show &controls + + Show all &controls Rotate &clockwise @@ -889,8 +889,8 @@ are declared in tools/grit/grit_rule.gni. &Loop - - Show &Controls + + Show All &Controls Rotate &Clockwise @@ -1019,6 +1019,10 @@ are declared in tools/grit/grit_rule.gni. Suggest Password... + + + Share + @@ -2739,6 +2743,18 @@ are declared in tools/grit/grit_rule.gni. Notifications were automatically blocked because you usually don't allow them + + Location blocked + + + Location blocked + + + This site was blocked from knowing your precise location because you usually don't allow this + + + Allow for this site + @@ -3752,7 +3768,7 @@ are declared in tools/grit/grit_rule.gni. You already requested "$1Gmail Checker" - Your admin has blocked "$1Gmail Checker" + Your admin has blocked "$1Gmail Checker" - App ID $2abacabadabacabaeabacabadabacabaf "$1Extension Manager" would like to remove "$2Gmail Checker". @@ -3874,7 +3890,7 @@ are declared in tools/grit/grit_rule.gni. - • $1Read and change all your data on the websites you visit + • $1Read and change all your data on all websites ($146) @@ -3907,16 +3923,16 @@ are declared in tools/grit/grit_rule.gni. - Read and change all your data on your computer and the websites you visit + Read and change all your data on your computer and all websites - Read and change all your data on the websites you visit + Read and change all your data on all websites Read and change all your data on the current website when invoked - Read all your data on the websites you visit + Read all your data on all websites Use your microphone @@ -3958,7 +3974,7 @@ are declared in tools/grit/grit_rule.gni. Block parts of web pages - Block content on any page you visit + Block content on any page Access document scanners attached via USB or on the local network @@ -4963,7 +4979,10 @@ Keep your key file in a safe place. You will need it to create new versions of y Update password for $1example.com? - $1Username $2***** will be saved to your Brave sync chain, $3user@gmail.com + Save it in your Brave sync chain, $1user@gmail.com + + + Update it in your Brave sync chain, $1user@gmail.com Passwords are saved in your Brave sync chain so you can use them on any device @@ -5677,6 +5696,12 @@ Keep your key file in a safe place. You will need it to create new versions of y your carts + + $11 item + + + $12 items + Google Drive files @@ -5701,6 +5726,9 @@ Keep your key file in a safe place. You will need it to create new versions of y From your Google Drive + + Brave Photos + You’re seeing your recent and suggested documents based on your previous activity using Google Drive. <br> @@ -5843,6 +5871,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Mark as unread + + To add a page to read later, click the button + You'll find your reading list here @@ -5852,14 +5883,30 @@ Keep your key file in a safe place. You will need it to create new versions of y Add current tab - - - - Mark as unread + + Can't add current tab - - Mark as read + + Remove current tab + + + + + Mark as Unread + + + Mark as Read + + + + + Mark as unread + + + Mark as read + + Delete @@ -6141,6 +6188,12 @@ Keep your key file in a safe place. You will need it to create new versions of y To group tabs together, right-click a tab + + Unnamed group - $1"New Tab" and one other + + + $1New Group - $2"New Tab" and one other + Got It @@ -6353,6 +6406,12 @@ Keep your key file in a safe place. You will need it to create new versions of y Update + + Update... + + + Continue + Save passwords for this site @@ -6377,8 +6436,8 @@ Keep your key file in a safe place. You will need it to create new versions of y Suggest strong password - - Update password for %1$sexample.com + + Confirm your username Passwords are saved in your Brave sync chain (%1$suser@gmail.com) so you can use them on any device @@ -6874,6 +6933,14 @@ Keep your key file in a safe place. You will need it to create new versions of y New window + + + $1Brave News belongs to desk $2School + + + Desk $1School has $23 browser windows open + + @@ -7029,6 +7096,9 @@ Keep your key file in a safe place. You will need it to create new versions of y $12 Tabs + + Toggle Recently Closed Items + @@ -7527,6 +7597,9 @@ Keep your key file in a safe place. You will need it to create new versions of y Open + + Sending link to $1Ted's Pixel2 + @@ -7594,6 +7667,23 @@ Keep your key file in a safe place. You will need it to create new versions of y Share link to + + Share link to $1Facebook + + + + + Screenshot copied to clipboard + + + Download + + + Edit + + + Share + @@ -8378,14 +8468,6 @@ Please help our engineers fix this problem. Tell us what happened right before y Failed To Create Data Directory - - - $1https://backgroundfetch.com wants to download multiple files - - - Download multiple files - - Recent Tabs @@ -8976,9 +9058,6 @@ Please help our engineers fix this problem. Tell us what happened right before y New Private Window - - Background Apps - Reopen Closed Tab @@ -9160,9 +9239,6 @@ Please help our engineers fix this problem. Tell us what happened right before y Restore All Tabs - - History isn’t saved in Private - Minimize @@ -9919,6 +9995,9 @@ Please help our engineers fix this problem. Tell us what happened right before y {SCREEN_INDEX, plural, =1{Screen #} other{Screen #}} + + Options for sharing are managed by your organization. Some items may be hidden. + This Tab @@ -9928,6 +10007,13 @@ Please help our engineers fix this problem. Tell us what happened right before y + + Screen sharing has ended + + + Your organization doesn't allow you to share this content. If you need help, contact your administrator. + + Documents are <a is="action-link" href="https://support.google.com/cloudprint/answer/2541843" target="_blank">sent to Brave</a> to prepare them for printing. View, edit and manage your printers and printer history on the <a is="action-link" href="https://www.google.com/cloudprint#jobs" target="_blank">Google Cloud Print dashboard</a>. @@ -10032,8 +10118,8 @@ Please help our engineers fix this problem. Tell us what happened right before y $1Brave Search - Permission requested, press ⌘ + Option + Up arrow to respond - - + + $1Brave Search - Permission requested, press F6 to respond @@ -10374,9 +10460,6 @@ Please help our engineers fix this problem. Tell us what happened right before y - - Open $1.txt, .csv, .md files - , ''' @@ -10516,9 +10599,6 @@ Please help our engineers fix this problem. Tell us what happened right before y - - See the make and model of your Security Key - @@ -10707,7 +10787,7 @@ Please help our engineers fix this problem. Tell us what happened right before y - + Use your security key with $1google.com @@ -10977,7 +11057,7 @@ Please help our engineers fix this problem. Tell us what happened right before y - + Verify with this phone @@ -11018,6 +11098,20 @@ Please help our engineers fix this problem. Tell us what happened right before y Close windows + + + Sites you visit aren’t saved in Private + + + To clear Private browsing history from your device, close all Private tabs + + + Close Private + + + Got it + + {0, plural, @@ -11175,8 +11269,22 @@ Please help our engineers fix this problem. Tell us what happened right before y Google Drive + + + Storing $1Google Drive Authentication Token + + + Upon signing in, an unique authentication token will be stored and used for all future eligible downloads. + + + Cancel + + + Continue + + - + Sign into $1Google Drive to complete download @@ -11363,6 +11471,15 @@ Please help our engineers fix this problem. Tell us what happened right before y Right click and select “Search part of the page with Brave Lens” to search any region of the site to learn more about the visual content you see while you browse and shop on the web. + + + + Network Settings + + + Available WiFi networks + + diff --git a/app/generated_resources_override.grd b/app/generated_resources_override.grd index cae381d2fa24..c5d0176eeec0 100644 --- a/app/generated_resources_override.grd +++ b/app/generated_resources_override.grd @@ -148,7 +148,7 @@ are declared in tools/grit/grit_rule.gni. - + @@ -177,7 +177,8 @@ are declared in tools/grit/grit_rule.gni. - + + @@ -509,6 +510,10 @@ are declared in tools/grit/grit_rule.gni. + + + + @@ -597,7 +602,9 @@ are declared in tools/grit/grit_rule.gni. - + + + @@ -671,7 +678,6 @@ are declared in tools/grit/grit_rule.gni. - @@ -804,9 +810,6 @@ are declared in tools/grit/grit_rule.gni. Always Show Bookmarks - - History isn’t saved in Private - @@ -866,7 +869,7 @@ are declared in tools/grit/grit_rule.gni. - + @@ -916,13 +919,13 @@ are declared in tools/grit/grit_rule.gni. - + Sign-in data will be stored on this device after you exit Private mode. You'll be able to sign in to this website with your device again later. - + @@ -941,7 +944,16 @@ are declared in tools/grit/grit_rule.gni. This only affects Private windows - + + Sites you visit aren’t saved in Private + + + To clear Private browsing history from your device, close all Private tabs + + + Close Private + + @@ -954,6 +966,8 @@ are declared in tools/grit/grit_rule.gni. - + + + diff --git a/app/global_media_controls_strings.grdp b/app/global_media_controls_strings.grdp index 890291739cf3..8010b5b23a20 100644 --- a/app/global_media_controls_strings.grdp +++ b/app/global_media_controls_strings.grdp @@ -29,4 +29,13 @@ Can't download speech files. Try again later. + + Global Media Controls + + + Show device list + + + Hide device list + diff --git a/app/os_settings_search_tag_strings.grdp b/app/os_settings_search_tag_strings.grdp index 7d5d72cd3d4b..b3df5931d2c7 100644 --- a/app/os_settings_search_tag_strings.grdp +++ b/app/os_settings_search_tag_strings.grdp @@ -860,6 +860,21 @@ View installed apps + + Notifications + + + Turn on Do Not Disturb + + + Mute Notifications + + + Turn off Do Not Disturb + + + Unmute Notifications + Remove Google Play Store diff --git a/app/os_settings_strings.grdp b/app/os_settings_strings.grdp index 2a16f70facb0..46b631d98c33 100644 --- a/app/os_settings_strings.grdp +++ b/app/os_settings_strings.grdp @@ -851,11 +851,14 @@ Search - Quick Answers + Quick answers With a right-click or long press, show related info for your text selection + + Get definitions, translations, or unit conversions when you right-click or touch & hold text. Customize translation languages in <a target="_blank" href="#">Website languages</a>. + Definition @@ -1115,6 +1118,45 @@ and Ctrl+Alt+Brightness down to zoom out. $1English speech is sent to Brave for processing. + + Change + + + Change Dictation language + + + Search languages + + + Clear search + + + Suggested + + + All languages + + + No search results + + + Update + + + Cancel + + + Works offline + + + $1English (works offline) + + + $1English (selected) + + + $1English (not selected) + Enable on-screen keyboard @@ -1510,7 +1552,7 @@ Press an assigned switch to remove assignment Manage your accounts here. <a>Learn more</a> - This page allows you to manage your signed-in Brave accounts. <a>Learn more</a> + This page allows you to manage your signed-in Brave sync chains. <a>Learn more</a> Bookmarks, passwords, and other browser data are synced with the primary account. @@ -1960,6 +2002,9 @@ Press an assigned switch to remove assignment No paired devices + + Pair new device + No Bluetooth devices found @@ -1969,7 +2014,31 @@ Press an assigned switch to remove assignment Bluetooth - + + Connected to Bluetooth device named $1Beats + + + Connected to Bluetooth devices named $1Beats and $2Mouse + + + Connected to $1Beats and $22 other Bluetooth devices + + + $1Beats and $22 others + + + $1Beats, $2Mouse + + + Off + + + On + + + Bluetooth device details + + Connect to Bluetooth device @@ -2475,12 +2544,6 @@ Press an assigned switch to remove assignment Enabling - - Turning off - - - Initializing - Applying changes... @@ -2502,12 +2565,6 @@ Press an assigned switch to remove assignment Mobile data enable - - Get data connection - - - Let this device find other devices with your Brave sync chain that have a mobile data connection - Wi-Fi enable @@ -2861,9 +2918,15 @@ Press an assigned switch to remove assignment Remove $1John Smith + + $1John Smith removed + Add user + + $1user@gmail.com added + Email address @@ -3786,6 +3849,15 @@ Press an assigned switch to remove assignment Notifications + + Do not disturb + + + When turned on, all notifications will be silenced + + + For website notifications, go to <a>Brave Settings</a> + Google Play Store @@ -3808,6 +3880,16 @@ Press an assigned switch to remove assignment App details + + + + Permission settings applied here are applied across all Borealis apps. <a>Learn more</a> + + + Permissions for apps installed by Borealis are managed via the <a>Borealis app settings</a>. + Borealis permission settings are applied across all Borealis applications. + + The change in camera setting requires Parallels Desktop to relaunch. Relaunch Parallels Desktop to proceed. diff --git a/app/profiles_strings.grdp b/app/profiles_strings.grdp index 48fe432f43eb..2f4a05c51c5e 100644 --- a/app/profiles_strings.grdp +++ b/app/profiles_strings.grdp @@ -636,9 +636,6 @@ ... - - Sign in - Continue without an account @@ -693,5 +690,21 @@ Switch + + + + Sign in + + + + + + Continue + + + Choose an account + + + diff --git a/app/profiles_strings_override.grdp b/app/profiles_strings_override.grdp index 52a40f0e6386..a853d0225a42 100644 --- a/app/profiles_strings_override.grdp +++ b/app/profiles_strings_override.grdp @@ -61,5 +61,11 @@ Private - + + + + + + + diff --git a/app/settings_brave_strings.grdp b/app/settings_brave_strings.grdp index 3b37353e1896..5bcc2d25a9de 100644 --- a/app/settings_brave_strings.grdp +++ b/app/settings_brave_strings.grdp @@ -162,7 +162,7 @@ - This page allows you to manage your signed-in Brave accounts. These accounts will be available in Brave browser and Play Store apps, as well as services like Gmail, Drive, and YouTube. <a>Learn more</a> + You can manage your signed-in Brave sync chains. Your Brave sync chains are used for Brave browser, Play Store, Gmail, and more. If you want to add an account for someone else, like a family member, add a new profile to your $1Bravebook instead. <a>Learn more</a> diff --git a/app/settings_brave_strings_override.grdp b/app/settings_brave_strings_override.grdp index 6fbf34099968..ebd65a0e2307 100644 --- a/app/settings_brave_strings_override.grdp +++ b/app/settings_brave_strings_override.grdp @@ -18,7 +18,10 @@ - + + You can manage your signed-in Brave sync chains. Your Brave sync chains are used for Brave browser, Play Store, Gmail, and more. If you want to add an account for someone else, like a family member, add a new profile to your $1Bravebook instead. <a>Learn more</a> + + diff --git a/app/settings_strings.grdp b/app/settings_strings.grdp index d0f40b748a2e..2002699d8692 100644 --- a/app/settings_strings.grdp +++ b/app/settings_strings.grdp @@ -138,7 +138,7 @@ Use Classic - + Reset to default @@ -1042,6 +1042,35 @@ Open certain file types automatically after downloading + + + $1Google Drive Connection + + + Learn more + + + For data safety and security, your organization requries all eligible downloads to be saved to your organization's $1Google Drive account. + + + Sign in to $1Google Drive + + + All eligible downloads are routed to your organization's $1Google Drive account. + + + Unlink Account + + + Account + + + $1Google Drive Location + + + Local Location + + On startup @@ -1084,28 +1113,9 @@ Languages - - Language - Search languages - - Show language options - - - - Add languages or reorder list. - - - Manage languages in Chrome OS settings - - - - - Order languages based on your preference - - Move to the top @@ -1121,95 +1131,103 @@ Add languages - - Offer to translate pages in this language - - - Offer to translate pages that aren't in a language you read - - - This language is used when translating pages - - - Language is set by your Organization - - - Your administrator has set a default language which cannot be modified. - - - - Keyboard apps - - Add languages - - All languages - - - Enabled languages - - - No languages added - - - Automatically translate these languages - - - Don’t offer to translate these languages - - - Spell check - - - Basic spell check - - - Enhanced spell check - - - Uses the same spell checker that’s used in Brave search. Text you type in the browser is sent to Brave. - - - - Spell check isn’t supported for the languages you selected + + + Language - - Use spell check for + + Show language options - - Customize spell check + + Order languages based on your preference + + + Offer to translate pages in this language + + + Offer to translate pages that aren't in a language you read - - Manage spell check + + This language is used when translating pages - - Add a new word + + Language is set by your Organization - - Add word + + Your administrator has set a default language which cannot be modified. - - Already added + + No languages added - - Cannot exceed 99 letters + + Automatically translate these languages - - Delete word + + Don’t offer to translate these languages - - Custom words + + Spell check - - Saved custom words will appear here + + Basic spell check - - Spell check dictionary download failed. + + Enhanced spell check + + + Uses the same spell checker that’s used in Brave search. Text you type in the browser is sent to Brave. + + + + Spell check isn’t supported for the languages you selected + + + Use spell check for + + + Customize spell check + + + Manage spell check + + + Add a new word + + + Add word + + + Already added + + + Cannot exceed 99 letters + + + Delete word + + + Custom words + + + Saved custom words will appear here + + + Spell check dictionary download failed. + + + Please check with your network administrator to make sure that the firewall is not blocking downloads from Brave servers. + + + + + + Manage languages in Chrome OS settings - - Please check with your network administrator to make sure that the firewall is not blocking downloads from Brave servers. + + Keyboard apps @@ -1223,6 +1241,11 @@ More + + + Manage secure DNS in Chrome OS settings + + @@ -1315,6 +1338,54 @@ Review the most important privacy and security controls in one place + + Privacy review + + + Understand and review the most critical privacy settings in one place + + + Review my settings + + + Next + + + What you get + + + What you share with Brave + + + Review your current settings for the most critical privacy and security controls + + + Let's go + + + Review completed! + + + Back to settings + + + Review settings for search and browsing optimization + + + Faster browsing: For example, proactively load specific further content based on the current page + + + Improved browsing: For example, suggestions in the Omnibox before you start typing + + + Improved Brave using page metrics + + + URL of the pages you visit, e.g. https://www.google.com + + + The URLs are shared with Brave to understand the browsing behavior + @@ -1606,7 +1677,7 @@ Always use secure connections - Upgrade all navigations to HTTPS and warn you before loading sites that don't support it + Upgrade navigations to HTTPS and warn you before loading sites that don't support it Manage certificates diff --git a/app/settings_strings_override.grdp b/app/settings_strings_override.grdp index 3d798692e042..9ec9832aff24 100644 --- a/app/settings_strings_override.grdp +++ b/app/settings_strings_override.grdp @@ -28,7 +28,7 @@ - + Show bookmarks @@ -50,13 +50,14 @@ - - - + + + - + + diff --git a/app/shared_settings_strings.grdp b/app/shared_settings_strings.grdp index 273efe393c9a..c98caec2d621 100644 --- a/app/shared_settings_strings.grdp +++ b/app/shared_settings_strings.grdp @@ -355,6 +355,21 @@ You can turn on sync anytime in settings + + + + + Changes you make here apply only to Brave. To make changes to your Lacros settings, open Lacros and go to settings. + + + + + + + + Changes you make here apply only to Lacros. To make changes to your Brave settings, open Brave and go to settings. + + diff --git a/app/shared_settings_strings_override.grdp b/app/shared_settings_strings_override.grdp index 49be0844b94e..acc14c488a31 100644 --- a/app/shared_settings_strings_override.grdp +++ b/app/shared_settings_strings_override.grdp @@ -7,6 +7,12 @@ Automatically sends crash reports to Brave + + + + + + 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 4759d6a86c02..a2682b2ad75e 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 @@ -9,4 +9,5 @@ Brave bookmarks Brave search Brave quick action search + Brave dino 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 08ee9332ba16..0c789dd5e67a 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 @@ -11,4 +11,5 @@ Brave bookmarks Brave search Brave quick action search + Brave dino 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 6c19ba4a5398..470c2bc3842a 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 @@ -9,4 +9,5 @@ Brave bookmarks Brave search Brave quick action search + Brave dino 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 9ae924fefd1b..43f202e5ee37 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 @@ -11,4 +11,5 @@ Brave bookmarks Brave search Brave quick action search + Brave dino 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 bcd336dcd3dd..1c9b04aead6a 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 @@ -11,4 +11,5 @@ Brave bookmarks Brave search Brave quick action search + Brave dino diff --git a/app/theme/brave/android/values/channel_constants.xml b/app/theme/brave/android/values/channel_constants.xml index 6c19ba4a5398..470c2bc3842a 100644 --- a/app/theme/brave/android/values/channel_constants.xml +++ b/app/theme/brave/android/values/channel_constants.xml @@ -9,4 +9,5 @@ Brave bookmarks Brave search Brave quick action search + Brave dino diff --git a/browser/DEPS b/browser/DEPS index cd4fda13ccf9..c063e3d1279f 100644 --- a/browser/DEPS +++ b/browser/DEPS @@ -12,7 +12,6 @@ include_rules = [ "+chrome/common", "+chrome/grit", "+chrome/installer/util", - "+chrome/services/mac_notifications/public/cpp", "+chrome/test", "+content/browser/service_worker", "+content/public/browser", diff --git a/browser/brave_browser_process_impl.cc b/browser/brave_browser_process_impl.cc index c4d4a865ce41..e6d5ec0bdb25 100644 --- a/browser/brave_browser_process_impl.cc +++ b/browser/brave_browser_process_impl.cc @@ -46,11 +46,6 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/shared_url_loader_factory.h" -#if BUILDFLAG(ENABLE_SYSTEM_NOTIFICATIONS) -#include "chrome/browser/notifications/notification_platform_bridge.h" -#include "brave/browser/notifications/brave_notification_platform_bridge.h" -#endif - #if BUILDFLAG(ENABLE_BRAVE_REFERRALS) #include "brave/components/brave_referrals/browser/brave_referrals_service.h" #endif @@ -358,27 +353,7 @@ void BraveBrowserProcessImpl::CreateProfileManager() { NotificationPlatformBridge* BraveBrowserProcessImpl::notification_platform_bridge() { -#if !defined(OS_MAC) return BrowserProcessImpl::notification_platform_bridge(); -#else -#if BUILDFLAG(ENABLE_SYSTEM_NOTIFICATIONS) - if (!created_notification_bridge_) - CreateNotificationPlatformBridge(); - return notification_bridge_.get(); -#else - return nullptr; -#endif -#endif -} - -void BraveBrowserProcessImpl::CreateNotificationPlatformBridge() { -#if defined(OS_MAC) -#if BUILDFLAG(ENABLE_SYSTEM_NOTIFICATIONS) - DCHECK(!notification_bridge_); - notification_bridge_ = BraveNotificationPlatformBridge::Create(); - created_notification_bridge_ = true; -#endif -#endif } #if BUILDFLAG(ENABLE_SPEEDREADER) diff --git a/browser/brave_browser_process_impl.h b/browser/brave_browser_process_impl.h index c0a540ede9c3..5ec28dab3a54 100644 --- a/browser/brave_browser_process_impl.h +++ b/browser/brave_browser_process_impl.h @@ -122,7 +122,6 @@ class BraveBrowserProcessImpl : public BraveBrowserProcess, void Init() override; void CreateProfileManager(); - void CreateNotificationPlatformBridge(); #if BUILDFLAG(ENABLE_TOR) void OnTorEnabledChanged(); diff --git a/browser/brave_profile_prefs.cc b/browser/brave_profile_prefs.cc index 0ba0cfc6e350..e1b51ba0e2cd 100644 --- a/browser/brave_profile_prefs.cc +++ b/browser/brave_profile_prefs.cc @@ -220,7 +220,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { registry->SetDefaultPrefValue(feed::prefs::kArticlesListVisible, base::Value(false)); // Translate is not available on Android - registry->SetDefaultPrefValue(prefs::kOfferTranslateEnabled, + registry->SetDefaultPrefValue(translate::prefs::kOfferTranslateEnabled, base::Value(false)); // Explicitly disable safe browsing extended reporting by default in case they // change it in upstream. diff --git a/browser/brave_wallet/brave_wallet_tab_helper.cc b/browser/brave_wallet/brave_wallet_tab_helper.cc index 937a5c624996..46840c3f9c99 100644 --- a/browser/brave_wallet/brave_wallet_tab_helper.cc +++ b/browser/brave_wallet/brave_wallet_tab_helper.cc @@ -60,7 +60,7 @@ GURL BraveWalletTabHelper::GetBubbleURL() { // Only check the first entry because it will not be grouped with other // types. if (manager->Requests().empty() || - manager->Requests()[0]->GetRequestType() != + manager->Requests()[0]->request_type() != permissions::RequestType::kBraveEthereum) return webui_url; @@ -70,7 +70,7 @@ GURL BraveWalletTabHelper::GetBubbleURL() { for (auto* request : manager->Requests()) { std::string account; if (!brave_wallet::ParseRequestingOriginFromSubRequest( - request->GetOrigin(), &requesting_origin, &account)) { + request->requesting_origin(), &requesting_origin, &account)) { continue; } accounts.push_back(account); diff --git a/browser/ipfs/ipfs_host_resolver.h b/browser/ipfs/ipfs_host_resolver.h index 86f76b1c002c..37aeb368d531 100644 --- a/browser/ipfs/ipfs_host_resolver.h +++ b/browser/ipfs/ipfs_host_resolver.h @@ -11,6 +11,7 @@ #include #include "base/callback_forward.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "net/base/host_port_pair.h" #include "net/base/network_isolation_key.h" #include "net/dns/public/dns_query_type.h" diff --git a/browser/net/brave_ad_block_tp_network_delegate_helper.cc b/browser/net/brave_ad_block_tp_network_delegate_helper.cc index f0fd25d53454..bc8710d67468 100644 --- a/browser/net/brave_ad_block_tp_network_delegate_helper.cc +++ b/browser/net/brave_ad_block_tp_network_delegate_helper.cc @@ -12,6 +12,7 @@ #include "base/base64url.h" #include "base/feature_list.h" +#include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "brave/browser/brave_browser_process.h" #include "brave/browser/brave_shields/brave_shields_web_contents_observer.h" diff --git a/browser/net/brave_referrals_network_delegate_helper.cc b/browser/net/brave_referrals_network_delegate_helper.cc index cde994b4e8fc..fd97efd1d613 100644 --- a/browser/net/brave_referrals_network_delegate_helper.cc +++ b/browser/net/brave_referrals_network_delegate_helper.cc @@ -24,7 +24,7 @@ int OnBeforeStartTransaction_ReferralsWork( if (!BraveReferralsHeaders::GetInstance()->GetMatchingReferralHeaders( &request_headers_dict, ctx->request_url)) return net::OK; - for (const auto& it : request_headers_dict->DictItems()) { + for (const auto it : request_headers_dict->DictItems()) { if (it.first == kBravePartnerHeader) { headers->SetHeader(it.first, it.second.GetString()); ctx->set_headers.insert(it.first); diff --git a/browser/notifications/BUILD.gn b/browser/notifications/BUILD.gn index 09b5526b48ee..ace5e821029c 100644 --- a/browser/notifications/BUILD.gn +++ b/browser/notifications/BUILD.gn @@ -13,42 +13,17 @@ source_set("notifications") { ] deps = [ + "//base", "//chrome/browser/notifications", "//third_party/abseil-cpp:absl", + "//url", ] - if (is_mac) { - sources += [ - "brave_alert_dispatcher_mac.h", - "brave_alert_dispatcher_mac.mm", - ] - - if (enable_system_notifications) { - sources += [ - "brave_notification_platform_bridge.h", - "brave_notification_platform_bridge_mac.mm", - ] - } - - deps += [ - "//base", - "//chrome/browser/ui/cocoa/notifications:common", - "//chrome/services/mac_notifications/public/cpp", - "//skia", - "//ui/message_center/public/cpp", - ] - - frameworks = [ "Foundation.framework" ] - } else if (is_android) { + if (is_android) { sources += [ "brave_notification_platform_bridge_helper_android.cc", "brave_notification_platform_bridge_helper_android.h", ] - - deps += [ - "//base", - "//chrome/common", - ] } } diff --git a/browser/notifications/brave_alert_dispatcher_mac.h b/browser/notifications/brave_alert_dispatcher_mac.h deleted file mode 100644 index 47613aa66e72..000000000000 --- a/browser/notifications/brave_alert_dispatcher_mac.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (c) 2019 The Brave Software Team. Distributed under the MPL2 - * license. This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_BROWSER_NOTIFICATIONS_BRAVE_ALERT_DISPATCHER_MAC_H_ -#define BRAVE_BROWSER_NOTIFICATIONS_BRAVE_ALERT_DISPATCHER_MAC_H_ - -#import - -#include - -#include "chrome/browser/notifications/alert_dispatcher_mac.h" - -// clang-format off -@interface BraveAlertDispatcherMac : NSObject - -- (void)dispatchNotification:(NSDictionary *)data; // NOLINT - -- (void)closeNotificationWithId:(NSString *)notificationId // NOLINT - profileId:(NSString *)profileId // NOLINT - incognito:(BOOL)incognito; // NOLINT - --(void)closeNotificationsWithProfileId:(NSString*)profileId // NOLINT - incognito : (BOOL)incognito; // NOLINT - -- (void)closeAllNotifications; - -- (void) -getDisplayedAlertsForProfileId:(NSString *)profileId // NOLINT - incognito:(BOOL)incognito - callback:(GetDisplayedNotificationsCallback)callback; // NOLINT - -- (void)getAllDisplayedAlertsWithCallback: // NOLINT - (GetAllDisplayedNotificationsCallback)callback; // NOLINT - -@end -// clang-format on - -#endif // BRAVE_BROWSER_NOTIFICATIONS_BRAVE_ALERT_DISPATCHER_MAC_H_ diff --git a/browser/notifications/brave_alert_dispatcher_mac.mm b/browser/notifications/brave_alert_dispatcher_mac.mm deleted file mode 100644 index d3b9db3c4eda..000000000000 --- a/browser/notifications/brave_alert_dispatcher_mac.mm +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (c) 2019 The Brave Software Team. Distributed under the MPL2 - * license. This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#import "brave/browser/notifications/brave_alert_dispatcher_mac.h" - -#include -#include -#include -#include - -#include "base/callback.h" -#include "base/containers/flat_set.h" -#include "base/mac/scoped_nsobject.h" -#include "base/strings/sys_string_conversions.h" -#include "chrome/browser/ui/cocoa/notifications/notification_builder_mac.h" -#include "chrome/services/mac_notifications/public/cpp/notification_constants_mac.h" - -// clang-format off -@implementation BraveAlertDispatcherMac { - base::scoped_nsobject alerts_; -} - -- (void)dispatchNotification:(NSDictionary *)data { - base::scoped_nsobject builder( - [[NotificationBuilder alloc] initWithDictionary:data]); - - NSUserNotification * toast = [builder buildUserNotification]; - [[NSUserNotificationCenter defaultUserNotificationCenter] - deliverNotification: toast]; -} - -- (void)closeNotificationWithId:(NSString *)notificationId - profileId:(NSString *)profileId - incognito:(BOOL)incognito { - NSUserNotificationCenter * notificationCenter = - [NSUserNotificationCenter defaultUserNotificationCenter]; - for (NSUserNotification * candidate in - [notificationCenter deliveredNotifications]) { - NSString* candidateId = [candidate.userInfo - objectForKey: notification_constants::kNotificationId]; - - NSString* candidateProfileId = [candidate.userInfo - objectForKey: notification_constants::kNotificationProfileId]; - - if ([candidateId isEqualToString: notificationId] && - [profileId isEqualToString: candidateProfileId]) { - [notificationCenter removeDeliveredNotification:candidate]; - break; - } - } -} - -- (void)closeNotificationsWithProfileId:(NSString*)profileId - incognito:(BOOL)incognito { - DCHECK(profileId); - NSUserNotificationCenter * notificationCenter = - [NSUserNotificationCenter defaultUserNotificationCenter]; - for (NSUserNotification * candidate in - [notificationCenter deliveredNotifications]) { - NSString* candidateProfileId = [candidate.userInfo - objectForKey: notification_constants::kNotificationProfileId]; - - bool candidateIncognito = [[candidate.userInfo - objectForKey:notification_constants::kNotificationIncognito] boolValue]; - - if ([profileId isEqualToString: candidateProfileId] && - incognito == candidateIncognito) { - [notificationCenter removeDeliveredNotification:candidate]; - } - } -} - -- (void)closeAllNotifications { - [[NSUserNotificationCenter defaultUserNotificationCenter] - removeAllDeliveredNotifications]; -} - -- (void) -getDisplayedAlertsForProfileId:(NSString *)profileId - incognito:(BOOL)incognito - callback:(GetDisplayedNotificationsCallback)callback { - NSUserNotificationCenter * notificationCenter = - [NSUserNotificationCenter defaultUserNotificationCenter]; - std::set displayedNotifications; - for (NSUserNotification * toast in - [notificationCenter deliveredNotifications]) { - NSString * toastProfileId = [toast.userInfo - objectForKey:notification_constants::kNotificationProfileId]; - if ([toastProfileId isEqualToString:profileId]) { - displayedNotifications.insert(base::SysNSStringToUTF8([toast.userInfo - objectForKey: notification_constants::kNotificationId])); - } - } - - std::move(callback).Run(std::move(displayedNotifications), - true /* supports_synchronization */); -} - -- (void)getAllDisplayedAlertsWithCallback: - (GetAllDisplayedNotificationsCallback)callback { - NSUserNotificationCenter * notificationCenter = - [NSUserNotificationCenter defaultUserNotificationCenter]; - - std::vector alertIds; - for (NSUserNotification * toast in - [notificationCenter deliveredNotifications]) { - std::string notificationId = base::SysNSStringToUTF8( - [toast.userInfo objectForKey:notification_constants::kNotificationId]); - std::string profileId = base::SysNSStringToUTF8([toast.userInfo - objectForKey:notification_constants::kNotificationProfileId]); - bool incognito = [[toast.userInfo - objectForKey:notification_constants::kNotificationIncognito] boolValue]; - - alertIds.push_back( - {std::move(notificationId), std::move(profileId), incognito}); - } - - // Create set from std::vector to avoid N^2 insertion runtime. - base::flat_set alertSet(std::move(alertIds)); - std::move(callback).Run(std::move(alertSet)); -} - -@end -// clang-format on diff --git a/browser/notifications/brave_notification_platform_bridge.h b/browser/notifications/brave_notification_platform_bridge.h deleted file mode 100644 index c0f2f4eb650e..000000000000 --- a/browser/notifications/brave_notification_platform_bridge.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2019 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_BROWSER_NOTIFICATIONS_BRAVE_NOTIFICATION_PLATFORM_BRIDGE_H_ -#define BRAVE_BROWSER_NOTIFICATIONS_BRAVE_NOTIFICATION_PLATFORM_BRIDGE_H_ - -#include - -#include "base/macros.h" - -class NotificationPlatformBridge; - -class BraveNotificationPlatformBridge { - public: - static std::unique_ptr Create(); - - private: - BraveNotificationPlatformBridge() = default; - ~BraveNotificationPlatformBridge() = default; - - DISALLOW_COPY_AND_ASSIGN(BraveNotificationPlatformBridge); -}; - -#endif // BRAVE_BROWSER_NOTIFICATIONS_BRAVE_NOTIFICATION_PLATFORM_BRIDGE_H_ diff --git a/browser/notifications/brave_notification_platform_bridge_mac.mm b/browser/notifications/brave_notification_platform_bridge_mac.mm deleted file mode 100644 index db5948171916..000000000000 --- a/browser/notifications/brave_notification_platform_bridge_mac.mm +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2019 The Brave Software Team. Distributed under the MPL2 - * license. This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/browser/notifications/brave_notification_platform_bridge.h" - -#include - -#include "brave/browser/notifications/brave_alert_dispatcher_mac.h" -#include "chrome/browser/notifications/notification_platform_bridge_mac.h" -#include "ui/message_center/public/cpp/notification.h" -#include "ui/message_center/public/cpp/notification_types.h" - -@class NSUserNotificationCenter; - -// static -std::unique_ptr -BraveNotificationPlatformBridge::Create() { - base::scoped_nsobject alert_dispatcher( - [[BraveAlertDispatcherMac alloc] init]); - return std::make_unique( - [NSUserNotificationCenter defaultUserNotificationCenter], - alert_dispatcher.get()); -} diff --git a/browser/permissions/permission_lifetime_manager_browsertest.cc b/browser/permissions/permission_lifetime_manager_browsertest.cc index b09ebc7c86fa..8a1b49e1e500 100644 --- a/browser/permissions/permission_lifetime_manager_browsertest.cc +++ b/browser/permissions/permission_lifetime_manager_browsertest.cc @@ -93,7 +93,7 @@ class PermissionLifetimeManagerBrowserTest : public InProcessBrowserTest { active_web_contents()->GetBrowserContext()); } - const util::WallClockTimer& permission_lifetime_timer() { + const base::WallClockTimer& permission_lifetime_timer() { return *permission_lifetime_manager()->expiration_timer_; } diff --git a/browser/permissions/permission_lifetime_manager_unittest.cc b/browser/permissions/permission_lifetime_manager_unittest.cc index f5c93577d4ba..b55eb29513cf 100644 --- a/browser/permissions/permission_lifetime_manager_unittest.cc +++ b/browser/permissions/permission_lifetime_manager_unittest.cc @@ -20,7 +20,8 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/browser/website_settings_info.h" #include "components/content_settings/core/browser/website_settings_registry.h" -#include "components/permissions/permission_request_impl.h" +#include "components/permissions/permission_request.h" +#include "components/permissions/request_type.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" #include "components/sync_preferences/testing_pref_service_syncable.h" @@ -36,8 +37,7 @@ namespace permissions { namespace { -using PermissionDecidedCallback = - PermissionRequestImpl::PermissionDecidedCallback; +using PermissionDecidedCallback = PermissionRequest::PermissionDecidedCallback; constexpr base::StringPiece kOneTypeOneExpirationPrefValue = R"({ "$1": { @@ -159,9 +159,9 @@ class PermissionLifetimeManagerTest : public testing::Test { manager_.reset(); } - const util::WallClockTimer& timer() { return *manager()->expiration_timer_; } + const base::WallClockTimer& timer() { return *manager()->expiration_timer_; } - std::unique_ptr CreateRequestAndChooseContentSetting( + std::unique_ptr CreateRequestAndChooseContentSetting( const GURL& origin, ContentSettingsType content_type, base::TimeDelta lifetime, @@ -176,14 +176,14 @@ class PermissionLifetimeManagerTest : public testing::Test { content_setting); ExpectContentSetting(FROM_HERE, origin, content_type, content_setting); - auto request = std::make_unique( - origin, content_type, true, PermissionDecidedCallback(), - base::OnceClosure()); + auto request = std::make_unique( + origin, ContentSettingsTypeToRequestType(content_type), true, + PermissionDecidedCallback(), base::OnceClosure()); request->SetLifetime(lifetime); return request; } - std::unique_ptr CreateRequestAndAllowContentSetting( + std::unique_ptr CreateRequestAndAllowContentSetting( const GURL& origin, ContentSettingsType content_type, base::TimeDelta lifetime) { diff --git a/browser/permissions/permission_manager_browsertest.cc b/browser/permissions/permission_manager_browsertest.cc index 8d4d7f08cb9d..af6afc297a16 100644 --- a/browser/permissions/permission_manager_browsertest.cc +++ b/browser/permissions/permission_manager_browsertest.cc @@ -163,10 +163,10 @@ IN_PROC_BROWSER_TEST_F(PermissionManagerBrowserTest, // Check sub-requests are created as expected. EXPECT_EQ(permission_request_manager->Requests().size(), addresses.size()); for (size_t i = 0; i < permission_request_manager->Requests().size(); i++) { - EXPECT_EQ(permission_request_manager->Requests()[i]->GetRequestType(), + EXPECT_EQ(permission_request_manager->Requests()[i]->request_type(), RequestType::kBraveEthereum); EXPECT_EQ(sub_request_origins[i], - permission_request_manager->Requests()[i]->GetOrigin()); + permission_request_manager->Requests()[i]->requesting_origin()); } // Test dismissing request. @@ -194,10 +194,10 @@ IN_PROC_BROWSER_TEST_F(PermissionManagerBrowserTest, // Check sub-requests are created as expected. EXPECT_EQ(permission_request_manager->Requests().size(), addresses.size()); for (size_t i = 0; i < permission_request_manager->Requests().size(); i++) { - EXPECT_EQ(permission_request_manager->Requests()[i]->GetRequestType(), + EXPECT_EQ(permission_request_manager->Requests()[i]->request_type(), RequestType::kBraveEthereum); EXPECT_EQ(sub_request_origins[i], - permission_request_manager->Requests()[i]->GetOrigin()); + permission_request_manager->Requests()[i]->requesting_origin()); } // Test accepting request with one of the address. @@ -257,10 +257,10 @@ IN_PROC_BROWSER_TEST_F(PermissionManagerBrowserTest, // Check sub-requests are created as expected. EXPECT_EQ(permission_request_manager->Requests().size(), addresses.size()); for (size_t i = 0; i < permission_request_manager->Requests().size(); i++) { - EXPECT_EQ(permission_request_manager->Requests()[i]->GetRequestType(), + EXPECT_EQ(permission_request_manager->Requests()[i]->request_type(), RequestType::kBraveEthereum); EXPECT_EQ(sub_request_origins[i], - permission_request_manager->Requests()[i]->GetOrigin()); + permission_request_manager->Requests()[i]->requesting_origin()); } // Close tab with active request pending. diff --git a/browser/resources/resource_ids b/browser/resources/resource_ids index 4a26eea7e016..b482788a96a6 100644 --- a/browser/resources/resource_ids +++ b/browser/resources/resource_ids @@ -2,124 +2,123 @@ { "SRCDIR": "../../..", "brave/common/extensions/api/brave_api_resources.grd": { - "includes": [32000], + "includes": [38000], }, "brave/components/resources/brave_components_resources.grd": { - "includes": [33000], + "includes": [38100], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_adblock/brave_adblock.grd": { - "includes": [33070], + "includes": [38200], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_new_tab/brave_new_tab.grd": { - "includes": [33140], + "includes": [38250], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_welcome/brave_welcome.grd": { - "includes": [33500], + "includes": [38600], }, "<(SHARED_INTERMEDIATE_DIR)/brave/browser/resources/settings/brave_settings_resources.grd": { "META": {"sizes": {"includes": [100],}}, - "includes": [34500], + "includes": [38800], }, "brave/app/brave_generated_resources.grd": { - "includes": [35000], - "messages": [35500], + "includes": [39200], + "messages": [39700], }, "brave/app/theme/brave_theme_resources.grd": { - "structures": [36000], + "structures": [40200], }, "brave/app/theme/brave_unscaled_resources.grd": { - "includes": [36500], + "includes": [40700], }, "brave/components/brave_sync/resources.grd": { - "includes": [37000] + "includes": [41200] }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_sync/brave_sync.grd": { - "includes": [37100], + "includes": [41300], }, - # brave webtorrent 37500 # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_webtorrent/brave_webtorrent.grd": { - "includes": [37520], + "includes": [41800], }, "brave/components/brave_rewards/resources/extension/extension_static_resources.grd": { - "includes": [38000] + "includes": [42300] }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_rewards_panel/brave_rewards_panel.grd": { - "includes": [38160], + "includes": [42500], }, "brave/components/brave_rewards/resources/brave_rewards_static_resources.grd": { - "includes": [38320] + "includes": [42700] }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_rewards_page/brave_rewards_page.grd": { - "includes": [38480], + "includes": [42900], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_rewards_internals/brave_rewards_internals.grd": { - "includes": [38640], + "includes": [43400], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_rewards_tip/brave_rewards_tip.grd": { - "includes": [38800], + "includes": [43700], }, "brave/components/resources/brave_components_strings.grd": { - "messages": [39000] + "messages": [43900] }, "brave/vendor/bat-native-ads/data/resources/bat_ads_resources.grd": { - "includes": [40000] + "includes": [44000] }, "brave/ui/webui/resources/brave_webui_resources.grd": { - "includes": [41000], - "structures": [42000], + "includes": [45000], + "structures": [46000], }, "<(SHARED_INTERMEDIATE_DIR)/brave/browser/resources/extensions/brave_extensions_resources.grd": { "META": {"sizes": {"includes": [50],}}, - "includes": [43000], + "includes": [47000], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_wallet_page/brave_wallet_page.grd": { - "includes": [43600], + "includes": [47600], }, "<(ROOT_GEN_DIR)/brave/web-ui-ethereum_remote_client_page/ethereum_remote_client_page.grd": { - "includes": [43700], + "includes": [47700], }, "<(ROOT_GEN_DIR)/brave/web-ui-brave_wallet_panel/brave_wallet_panel.grd": { - "includes": [43800], + "includes": [47800], }, "brave/components/brave_extension/extension/resources.grd": { - "includes": [44000], + "includes": [48000], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-brave_extension/brave_extension.grd": { - "includes": [44500], + "includes": [48500], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-webcompat_reporter/webcompat_reporter.grd": { - "includes": [45000], + "includes": [49000], }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-ipfs/ipfs.grd": { - "includes": [45500], + "includes": [49500], }, "<(ROOT_GEN_DIR)/brave/web-ui-cosmetic_filters/cosmetic_filters.grd": { - "includes": [46000] + "includes": [50000] }, "brave/components/tor/resources/tor_static_resources.grd": { - "includes": [46250] + "includes": [50250] }, # This file is generated during the build. "<(ROOT_GEN_DIR)/brave/web-ui-tor_internals/tor_internals.grd": { - "includes": [46500], + "includes": [50500], }, "<(ROOT_GEN_DIR)/brave/web-ui-brave_wallet_script/brave_wallet_script.grd": { - "includes": [46750] + "includes": [50750] }, "<(ROOT_GEN_DIR)/brave/web-ui-brave_vpn_panel/brave_vpn_panel.grd": { - "includes": [47000] + "includes": [51000] }, } diff --git a/browser/resources/settings/BUILD.gn b/browser/resources/settings/BUILD.gn index a3daa95f1efe..006f622503ae 100644 --- a/browser/resources/settings/BUILD.gn +++ b/browser/resources/settings/BUILD.gn @@ -16,7 +16,7 @@ import("//tools/polymer/polymer.gni") import("//ui/webui/resources/tools/generate_grd.gni") import("//ui/webui/resources/tools/js_modulizer.gni") -preprocess_folder = "preprocessed" +preprocess_folder = "tsc" preprocess_manifest = "brave_preprocessed_manifest.json" preprocess_gen_manifest = "brave_preprocessed_gen_manifest.json" @@ -117,6 +117,7 @@ preprocess_if_expr("preprocess") { "brave_overrides/site_settings_page.js", "brave_overrides/sync_account_control.js", "brave_overrides/sync_controls.js", + "brave_reset_page/brave_reset_profile_dialog_behavior.js", "brave_routes.js", "brave_sync_page/brave_sync_browser_proxy.js", ] diff --git a/browser/resources/settings/brave_appearance_page/super_referral.js b/browser/resources/settings/brave_appearance_page/super_referral.js index 014d12885878..cf688360e034 100644 --- a/browser/resources/settings/brave_appearance_page/super_referral.js +++ b/browser/resources/settings/brave_appearance_page/super_referral.js @@ -7,7 +7,7 @@ import {Polymer, html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bun import {assert} from 'chrome://resources/js/assert.m.js'; import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js'; import {loadTimeData} from "../i18n_setup.js" -import {AppearanceBrowserProxy, AppearanceBrowserProxyImpl} from '../appearance_page/appearance_browser_proxy.js'; +import {AppearanceBrowserProxyImpl} from '../appearance_page/appearance_browser_proxy.js'; /** * ID for autogenerated themes. Should match diff --git a/browser/resources/settings/brave_overrides/basic_page.js b/browser/resources/settings/brave_overrides/basic_page.js index 6cf69a90129a..feefd0214a0d 100644 --- a/browser/resources/settings/brave_overrides/basic_page.js +++ b/browser/resources/settings/brave_overrides/basic_page.js @@ -20,7 +20,8 @@ import '../social_blocking_page/social_blocking_page.m.js' const isGuest = loadTimeData.getBoolean('isGuest') export function getSectionElement (templateContent, sectionName) { - const sectionEl = templateContent.querySelector(`template[if*='pageVisibility.${sectionName}']`) || + const sectionEl = templateContent.querySelector(`template[if*='showPage_(pageVisibility.${sectionName}']`) || + templateContent.querySelector(`template[if*='pageVisibility.${sectionName}']`) || templateContent.querySelector(`settings-section[section="${sectionName}"]`) if (!sectionEl) { console.error(`[Brave Settings Overrides] Could not find section '${sectionName}'`) diff --git a/browser/resources/settings/brave_overrides/index.js b/browser/resources/settings/brave_overrides/index.js index 3cb2c2f13d5d..73ee3b671d5b 100644 --- a/browser/resources/settings/brave_overrides/index.js +++ b/browser/resources/settings/brave_overrides/index.js @@ -28,6 +28,7 @@ import './people_page.js' import './personalization_options.js' import './printing_page.js' import './privacy_page.js' +import './reset_profile_dialog.js' import './safety_check_passwords_child.js' import './search_engines_section.js' import './security_page.js' diff --git a/browser/resources/settings/brave_overrides/reset_profile_dialog.js b/browser/resources/settings/brave_overrides/reset_profile_dialog.js index 0b7f12c3402b..04315d4fc998 100644 --- a/browser/resources/settings/brave_overrides/reset_profile_dialog.js +++ b/browser/resources/settings/brave_overrides/reset_profile_dialog.js @@ -3,24 +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 {BraveResetProfileDialogBehavior} from '../brave_reset_page/brave_reset_profile_dialog_behavior.js' import {RegisterPolymerComponentBehaviors} from 'chrome://brave-resources/polymer_overriding.js' RegisterPolymerComponentBehaviors({ 'settings-reset-profile-dialog': [ - ready: function() { - this.fixSendSettingsCheckbox(); - }, - - /** - * Unchecks, disables, and hides sendSettings checkbox. - * Also, hide the entire footer. - * @private - */ - fixSendSettingsCheckbox: function() { - this.$.sendSettings.checked = false; - this.$.sendSettings.hidden = true; - this.$.sendSettings.disabled = true; - this.$.sendSettings.parentNode.hidden = true; - } + BraveResetProfileDialogBehavior ] }) diff --git a/browser/resources/settings/brave_reset_page/brave_reset_profile_dialog_behavior.js b/browser/resources/settings/brave_reset_page/brave_reset_profile_dialog_behavior.js new file mode 100644 index 000000000000..fa60e9ae793f --- /dev/null +++ b/browser/resources/settings/brave_reset_page/brave_reset_profile_dialog_behavior.js @@ -0,0 +1,26 @@ +/* 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/. */ + +const BraveResetProfileDialogBehaviorImpl = { + ready: function() { + this.fixSendSettingsCheckbox(); + }, + + /** + * Unchecks, disables, and hides sendSettings checkbox. + * Also, hide the entire footer. + * @private + */ + fixSendSettingsCheckbox: function() { + this.$.sendSettings.checked = false; + this.$.sendSettings.hidden = true; + this.$.sendSettings.disabled = true; + this.$.sendSettings.parentNode.hidden = true; + } +}; + +export const BraveResetProfileDialogBehavior = [ + BraveResetProfileDialogBehaviorImpl +] diff --git a/browser/tor/tor_profile_manager.cc b/browser/tor/tor_profile_manager.cc index 5d11af0df343..baa717ec13b1 100644 --- a/browser/tor/tor_profile_manager.cc +++ b/browser/tor/tor_profile_manager.cc @@ -127,6 +127,6 @@ void TorProfileManager::InitTorProfileUserPrefs(Profile* profile) { // support extensions in Tor mode and users cannot disable this through // settings page for Tor windows. #if BUILDFLAG(ENABLE_BRAVE_TRANSLATE_EXTENSION) - pref_service->SetBoolean(prefs::kOfferTranslateEnabled, false); + pref_service->SetBoolean(translate::prefs::kOfferTranslateEnabled, false); #endif } diff --git a/browser/tor/tor_profile_manager_unittest.cc b/browser/tor/tor_profile_manager_unittest.cc index ad2943970f90..3e1bbf9a5b38 100644 --- a/browser/tor/tor_profile_manager_unittest.cc +++ b/browser/tor/tor_profile_manager_unittest.cc @@ -77,7 +77,7 @@ TEST_F(TorProfileManagerUnitTest, InitTorProfileUserPrefs) { #if BUILDFLAG(ENABLE_BRAVE_TRANSLATE_EXTENSION) // Check translate.enabled for translate bubble. - EXPECT_FALSE( - tor_profile->GetPrefs()->GetBoolean(prefs::kOfferTranslateEnabled)); + EXPECT_FALSE(tor_profile->GetPrefs()->GetBoolean( + translate::prefs::kOfferTranslateEnabled)); #endif } diff --git a/browser/touch_to_fill/android/internal/java/res/layout/touch_to_fill_header_item.xml b/browser/touch_to_fill/android/internal/java/res/layout/touch_to_fill_header_item.xml index 0bddcd6a8ef7..c7edaaa41f27 100644 --- a/browser/touch_to_fill/android/internal/java/res/layout/touch_to_fill_header_item.xml +++ b/browser/touch_to_fill/android/internal/java/res/layout/touch_to_fill_header_item.xml @@ -19,7 +19,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:importantForAccessibility="no" - app:srcCompat="@drawable/touch_to_fill_new_header_image" + app:srcCompat="@drawable/touch_to_fill_header_image" android:visibility="gone" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -315,7 +315,7 @@ CHAR_LIMIT guidelines: Allow Brave sign-in - Show Brave sign-in prompts when you sign in to your Brave sync chain + Shows prompts to sign in to Brave Autocomplete searches and URLs @@ -1195,6 +1195,21 @@ Your Brave account may have other forms of browsing history like searches and ac Captions + + Page Zoom + + + Use this setting to increase/decrease the zoom factor for a given page. + + + Decrease zoom + + + Increase zoom + + + %1$d100 %% + @@ -1257,11 +1272,11 @@ Your Brave account may have other forms of browsing history like searches and ac %1$sहिन्दी - Language ready, restart %2$sBrave. - + %1$sहिन्दी - This language couldn't be downloaded. Try again later. - %1$sHindi is ready. + %1$sHindi is ready Restart Brave @@ -1415,6 +1430,17 @@ Your Brave account may have other forms of browsing history like searches and ac Brave has saved you %1$d10 GB + + + Download anyway + + + Do you want to download %1$smalware.exe anyway? + + + File might be harmful + + Download later instead? @@ -1642,11 +1668,11 @@ Your Brave account may have other forms of browsing history like searches and ac https://www.google.com/chrome/terms/ - - Brave Privacy Notice + + Brave Privacy Policy - - https://www.google.com/intl/$LOCALE/chrome/browser/privacy/ + + https://policies.google.com/privacy https://families.google.com/intl/$LOCALE/familylink/privacy/child-policy/ @@ -2001,6 +2027,42 @@ To change this setting, <resetlink>reset sync

%1$s8:30PM. + + + See notification for download status + + + (%1$s100 MB)\n%2$shttps://...example.com + + + {FILE_COUNT, plural, + =1 {Downloading file…} + other {Downloading # files…}} + + + {FILE_COUNT, plural, + =1 {File downloaded} + other {# downloads complete}} + + + {FILE_COUNT, plural, + =1 {1 download failed} + other {# downloads failed}} + + + {FILE_COUNT, plural, + =1 {1 download pending} + other {# downloads pending}} + + + {FILE_COUNT, plural, + =1 {1 download scheduled} + other {# downloads scheduled}} + + + Download will start when on Wi-Fi + + Almost finished! @@ -2531,11 +2593,11 @@ To change this setting, <resetlink>reset sync

Search your history - - History isn’t saved in Private + + Sites you visit aren’t saved in Private - - Brave doesn’t save your browsing history when you choose to browse privately. You can still use bookmarks to access your favorite sites. + + To clear Private browsing history from your device, close all Private tabs. @@ -2586,6 +2648,11 @@ To change this setting, <resetlink>reset sync

+ + + Use without an account + + Add account @@ -2626,13 +2693,13 @@ To change this setting, <resetlink>reset sync

- Something went wrong + Can't sign in - Brave couldn’t verify your information + Something went wrong during sign-in - Sorry, we couldn’t validate your credentials + Your stored sign-in info might be out of date Skip @@ -2685,6 +2752,12 @@ To change this setting, <resetlink>reset sync

+ + New tab + + + New Private tab + Recent tabs @@ -2769,6 +2842,12 @@ To change this setting, <resetlink>reset sync

Hide and unhide topics + + Autoplay + + + Manage Video Preview Settings + Following @@ -2784,6 +2863,9 @@ To change this setting, <resetlink>reset sync

Updates Unavailable + + Waiting for content + Turn off @@ -2802,7 +2884,6 @@ To change this setting, <resetlink>reset sync

Discover by Brave - off - For you Following Unread stories ready @@ -2820,8 +2901,12 @@ 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. + + Keep up with your favorite sites + + + To follow a site, go to the site, open the Brave menu, and tap Follow. + For new stories, pull down to refresh @@ -3010,6 +3095,9 @@ To change this setting, <resetlink>reset sync

Move to other window + + Manage windows (%1$d3) + Forward @@ -3344,9 +3432,17 @@ To change this setting, <resetlink>reset sync

Bookmarks and web history + + Help improve Brave. <LINK>Take survey</LINK> + + Help improve Brave? + + + Take survey + @@ -3572,6 +3668,9 @@ To change this setting, <resetlink>reset sync

Unsupported number of Brave instances. + + You can have up to 5 windows. + Close tab @@ -3652,37 +3751,37 @@ To change this setting, <resetlink>reset sync

Following... - - Followed %1$sBrave + + Following %1$sReuters - + Go to feed - + Can’t follow. Something went wrong. - + Can’t unfollow. Something went wrong. - + Try again - - Unfollowed %1$sBrave + + Unfollowed %1$sReuters - + Refollow - - You’re following %1$sBrave + + You’re following %1$sReuters - - You’ll now see stories from %1$sBrave when you open a new tab. You can control the sites you’re following in Manage Follows. + + You'll now see stories from %1$sReuters when you open a new tab. Sites you follow are saved in your Brave account. You can manage them in Discover settings. - - Soon, you’ll see stories from %1$sBrave when you open a new tab. You can control the sites you’re following in Manage Follows. + + Soon, you’ll see stories from %1$sReuters when you open a new tab. Sites you follow are saved in your Brave account. You can manage them in Discover settings. - + Open a new tab @@ -3929,6 +4028,74 @@ To change this setting, <resetlink>reset sync

+ + + Manage windows + + + Empty window + + + {TAB_COUNT, plural, + =1 {%1$s private tab} + other {%1$s2 private tabs}} + + + {TAB_COUNT, plural, + =1 {%1$s tab} + other {%2$s1 tabs, %1$s private}} + + + No tabs + + + {TAB_COUNT, plural, + =1 {1 tab} + other {# tabs}} + + + Close window + + + Current + + + Window is open + + + Brave is already running here. + + + Move tab + + + Close window? + + + Close window + + + The window will be closed + + + The tab %1$sYouTube will be closed + + + {TAB_COUNT, plural, + =1 {%1$sYouTube and %2$s more tab will be closed} + other {%1$sYouTube and %2$s more tabs will be closed}} + + + {TAB_COUNT, plural, + =1 {%1$s1 private tab will be closed} + other {%1$s4 private tabs will be closed}} + + + {TAB_COUNT, plural, + =1 {%1$s2 private and %2$s1 more tab will be closed} + other {%1$s4 private and %2$s4 more tabs will be closed}} + + Download pages to use them offline @@ -4027,6 +4194,20 @@ To change this setting, <resetlink>reset sync

Quick Action Search Widget Icon + + Private is not available on this device + + + Voice search is not available on this device + + + Brave Lens is not available on this device + + + + + Brave Dino + @@ -4767,7 +4948,7 @@ To change this setting, <resetlink>reset sync

%1$sClassic template selected - Select a template for your highlight + Select a template for your highlight. To return to the main dialog, use an up then down gesture, then tap Next. Highlight was shortened @@ -4778,6 +4959,14 @@ To change this setting, <resetlink>reset sync

” + + + + Always use secure connections + + + Upgrade navigations to HTTPS and warn you before loading sites that don’t support it + diff --git a/browser/ui/android/strings/android_chrome_strings_override.grd b/browser/ui/android/strings/android_chrome_strings_override.grd index e883a7b2f174..f2345a9704fe 100644 --- a/browser/ui/android/strings/android_chrome_strings_override.grd +++ b/browser/ui/android/strings/android_chrome_strings_override.grd @@ -30,86 +30,86 @@ CHAR_LIMIT guidelines: --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -145,9 +145,13 @@ CHAR_LIMIT guidelines: Private tab - - History isn’t saved in Private + + Sites you visit aren’t saved in Private + + To clear Private browsing history from your device, close all Private tabs. + + Private Tabs @@ -155,6 +159,9 @@ CHAR_LIMIT guidelines: Close all Private tabs + + New Private tab + New Private tab @@ -195,6 +202,30 @@ CHAR_LIMIT guidelines: + + {TAB_COUNT, plural, + =1 {%1$s private tab} + other {%1$s2 private tabs}} + + + {TAB_COUNT, plural, + =1 {%1$s tab} + other {%2$s1 tabs, %1$s private}} + + + {TAB_COUNT, plural, + =1 {%1$s1 private tab will be closed} + other {%1$s4 private tabs will be closed}} + + + {TAB_COUNT, plural, + =1 {%1$s2 private and %2$s1 more tab will be closed} + other {%1$s4 private and %2$s4 more tabs will be closed}} + + + + Private is not available on this device + To share with profiles nearby, let them scan this QR Code diff --git a/browser/ui/android/theme/BUILD.gn b/browser/ui/android/theme/BUILD.gn new file mode 100644 index 000000000000..bc2d1f7b13bd --- /dev/null +++ b/browser/ui/android/theme/BUILD.gn @@ -0,0 +1,17 @@ +# Copyright 2021 The Brave Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/rules.gni") + +android_library("java") { + sources = + [ "java/src/org/chromium/chrome/browser/theme/BraveThemeUtils.java" ] + deps = [ + "//base:base_java", + "//chrome/browser/ui/android/theme:java", + "//chrome/browser/ui/android/theme:java_resources", + "//third_party/androidx:androidx_annotation_annotation_java", + ] + resources_package = "org.chromium.chrome.browser.theme" +} diff --git a/browser/ui/android/theme/java/src/org/chromium/chrome/browser/theme/BraveThemeUtils.java b/browser/ui/android/theme/java/src/org/chromium/chrome/browser/theme/BraveThemeUtils.java new file mode 100644 index 000000000000..c43c4361b388 --- /dev/null +++ b/browser/ui/android/theme/java/src/org/chromium/chrome/browser/theme/BraveThemeUtils.java @@ -0,0 +1,25 @@ +/* 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.theme; + +import android.content.Context; + +import androidx.annotation.ColorInt; + +import org.chromium.base.ApiCompatibilityUtils; + +public class BraveThemeUtils { + public static @ColorInt int getTextBoxColorForToolbarBackgroundInNonNativePage( + Context context, @ColorInt int color, boolean isIncognito) { + if (isIncognito) { + return ApiCompatibilityUtils.getColor( + context.getResources(), R.color.toolbar_text_box_background_incognito); + } + + return ThemeUtils.getTextBoxColorForToolbarBackgroundInNonNativePage( + context, color, isIncognito); + } +} diff --git a/browser/ui/session_crashed_bubble_brave.cc b/browser/ui/session_crashed_bubble_brave.cc index 49f9a6e4a816..b2769caa7968 100644 --- a/browser/ui/session_crashed_bubble_brave.cc +++ b/browser/ui/session_crashed_bubble_brave.cc @@ -8,7 +8,9 @@ #include "chrome/browser/ui/session_crashed_bubble.h" // static -void SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(Browser* browser) { +void SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave( + Browser* browser, + bool skip_tab_checking) { // If crash report permission ask dialog is launched, tab restore bubble will // be shown after closing aks dialog. if (ShouldShowCrashReportPermissionAskDialog()) { @@ -16,5 +18,5 @@ void SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(Browser* browser) { return; } - ShowIfNotOffTheRecordProfile(browser); + ShowIfNotOffTheRecordProfile(browser, skip_tab_checking); } diff --git a/browser/ui/startup/default_brave_browser_prompt.cc b/browser/ui/startup/default_brave_browser_prompt.cc index 764dcdd2d6f1..f93218a2b9ba 100644 --- a/browser/ui/startup/default_brave_browser_prompt.cc +++ b/browser/ui/startup/default_brave_browser_prompt.cc @@ -46,14 +46,15 @@ void ShowPrompt() { // Show the default browser request prompt in the most recently active, // visible, tabbed browser. Do not show the prompt if no such browser exists. BrowserList* browser_list = BrowserList::GetInstance(); - for (auto browser_iterator = browser_list->begin_last_active(); - browser_iterator != browser_list->end_last_active(); + for (auto browser_iterator = + browser_list->begin_browsers_ordered_by_activation(); + browser_iterator != browser_list->end_browsers_ordered_by_activation(); ++browser_iterator) { Browser* browser = *browser_iterator; // |browser| may be null in UI tests. Also, don't show the prompt in an app // window, which is not meant to be treated as a Chrome window. - if (!browser || browser->deprecated_is_app()) + if (!browser || !browser->is_type_normal()) continue; // In ChromeBot tests, there might be a race. This line appears to get diff --git a/browser/ui/tabs/brave_tab_menu_model.cc b/browser/ui/tabs/brave_tab_menu_model.cc index c7eb87cb602e..dc11677c8edf 100644 --- a/browser/ui/tabs/brave_tab_menu_model.cc +++ b/browser/ui/tabs/brave_tab_menu_model.cc @@ -13,10 +13,12 @@ #include "chrome/grit/generated_resources.h" #include "components/sessions/core/tab_restore_service.h" -BraveTabMenuModel::BraveTabMenuModel(ui::SimpleMenuModel::Delegate* delegate, - TabStripModel* tab_strip_model, - int index) - : TabMenuModel(delegate, tab_strip_model, index) { +BraveTabMenuModel::BraveTabMenuModel( + ui::SimpleMenuModel::Delegate* delegate, + TabMenuModelDelegate* tab_menu_model_delegate, + TabStripModel* tab_strip_model, + int index) + : TabMenuModel(delegate, tab_menu_model_delegate, tab_strip_model, index) { web_contents_ = tab_strip_model->GetWebContentsAt(index); if (web_contents_) { Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); diff --git a/browser/ui/tabs/brave_tab_menu_model.h b/browser/ui/tabs/brave_tab_menu_model.h index 572520ea8683..73155952bc38 100644 --- a/browser/ui/tabs/brave_tab_menu_model.h +++ b/browser/ui/tabs/brave_tab_menu_model.h @@ -27,6 +27,7 @@ class BraveTabMenuModel : public TabMenuModel { }; BraveTabMenuModel(ui::SimpleMenuModel::Delegate* delegate, + TabMenuModelDelegate* tab_menu_model_delegate, TabStripModel* tab_strip_model, int index); ~BraveTabMenuModel() override; diff --git a/browser/ui/views/brave_ads/ad_notification_control_buttons_view.cc b/browser/ui/views/brave_ads/ad_notification_control_buttons_view.cc index 6be5c5f9a452..254c596ffe92 100644 --- a/browser/ui/views/brave_ads/ad_notification_control_buttons_view.cc +++ b/browser/ui/views/brave_ads/ad_notification_control_buttons_view.cc @@ -48,6 +48,12 @@ AdNotificationControlButtonsView::AdNotificationControlButtonsView( AdNotificationControlButtonsView::~AdNotificationControlButtonsView() = default; +void AdNotificationControlButtonsView::OnThemeChanged() { + View::OnThemeChanged(); + + UpdateContent(); +} + void AdNotificationControlButtonsView::UpdateContent() { UpdateInfoButton(); UpdateCloseButton(); @@ -77,8 +83,6 @@ void AdNotificationControlButtonsView::CreateView() { void AdNotificationControlButtonsView::CreateInfoButton() { DCHECK(!info_button_); info_button_ = AddChildView(std::make_unique()); - - UpdateInfoButton(); } void AdNotificationControlButtonsView::UpdateInfoButton() { @@ -99,8 +103,6 @@ void AdNotificationControlButtonsView::CreateCloseButton() { close_button_->SetAccessibleName( l10n_util::GetStringUTF16(IDS_BRAVE_ADS_AD_NOTIFICATION_CLOSE_BUTTON)); - - UpdateCloseButton(); } void AdNotificationControlButtonsView::UpdateCloseButton() { diff --git a/browser/ui/views/brave_ads/ad_notification_control_buttons_view.h b/browser/ui/views/brave_ads/ad_notification_control_buttons_view.h index 805e647287b3..008d99c89807 100644 --- a/browser/ui/views/brave_ads/ad_notification_control_buttons_view.h +++ b/browser/ui/views/brave_ads/ad_notification_control_buttons_view.h @@ -27,6 +27,9 @@ class AdNotificationControlButtonsView : public views::View { AdNotificationView* ad_notification_view); ~AdNotificationControlButtonsView() override; + // views::View: + void OnThemeChanged() override; + void UpdateContent(); private: diff --git a/browser/ui/views/brave_ads/ad_notification_header_view.cc b/browser/ui/views/brave_ads/ad_notification_header_view.cc index 777d719206e1..ed5d7d1238fe 100644 --- a/browser/ui/views/brave_ads/ad_notification_header_view.cc +++ b/browser/ui/views/brave_ads/ad_notification_header_view.cc @@ -126,16 +126,12 @@ void AdNotificationHeaderView::CreateView(const int width) { } views::Label* AdNotificationHeaderView::CreateTitleLabel() { - const bool should_use_dark_colors = GetNativeTheme()->ShouldUseDarkColors(); - views::Label* label = new views::Label(); const gfx::FontList font_list({kTitleFontName}, kTitleFontStyle, kTitleFontSize, kTitleFontWeight); label->SetFontList(font_list); - label->SetEnabledColor(should_use_dark_colors ? kDarkModeTitleColor - : kLightModeTitleColor); label->SetBackgroundColor(SK_ColorTRANSPARENT); label->SetHorizontalAlignment(kTitleHorizontalAlignment); diff --git a/browser/ui/views/brave_ads/text_ad_notification_view.cc b/browser/ui/views/brave_ads/text_ad_notification_view.cc index c5df8ea47a58..ba546cf9e361 100644 --- a/browser/ui/views/brave_ads/text_ad_notification_view.cc +++ b/browser/ui/views/brave_ads/text_ad_notification_view.cc @@ -155,8 +155,6 @@ views::View* TextAdNotificationView::CreateBodyView( views::Label* TextAdNotificationView::CreateBodyLabel( const AdNotification& ad_notification) { - const bool should_use_dark_colors = GetNativeTheme()->ShouldUseDarkColors(); - const std::u16string body = ad_notification.body(); views::Label* label = new views::Label(body); @@ -165,8 +163,6 @@ views::Label* TextAdNotificationView::CreateBodyLabel( kBodyFontWeight); label->SetFontList(font_list); - label->SetEnabledColor(should_use_dark_colors ? kDarkModeBodyColor - : kLightModeBodyColor); label->SetBackgroundColor(SK_ColorTRANSPARENT); label->SetHorizontalAlignment(kBodyHorizontalAlignment); diff --git a/browser/ui/views/crash_report_permission_ask_dialog_browsertest.cc b/browser/ui/views/crash_report_permission_ask_dialog_browsertest.cc index cb7fcf38ab3b..e76398ae49e2 100644 --- a/browser/ui/views/crash_report_permission_ask_dialog_browsertest.cc +++ b/browser/ui/views/crash_report_permission_ask_dialog_browsertest.cc @@ -19,7 +19,8 @@ class CrashReportPermissionAskDialogTest : public DialogBrowserTest { // TestBrowserUi: void ShowUi(const std::string& name) override { - SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave(browser()); + SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave( + browser(), /*skip_tab_checking=*/false); } }; 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 2efbe298a25b..32428ddf00f3 100644 --- a/browser/ui/views/crash_report_permission_ask_dialog_view.cc +++ b/browser/ui/views/crash_report_permission_ask_dialog_view.cc @@ -47,7 +47,8 @@ void ScheduleSessionCrashedBubble() { // It's ok to use lastly used browser because there will be only one when // this launched after un-cleaned exit. if (auto* browser = BrowserList::GetInstance()->GetLastActive()) - SessionCrashedBubble::ShowIfNotOffTheRecordProfile(browser); + SessionCrashedBubble::ShowIfNotOffTheRecordProfile( + browser, /*skip_tab_checking=*/false); } gfx::FontList GetFont(int font_size, gfx::Font::Weight weight) { diff --git a/browser/ui/views/permission_bubble/ethereum_permission_prompt_impl.h b/browser/ui/views/permission_bubble/ethereum_permission_prompt_impl.h index 25b2bd629fe9..e4799dd24f5c 100644 --- a/browser/ui/views/permission_bubble/ethereum_permission_prompt_impl.h +++ b/browser/ui/views/permission_bubble/ethereum_permission_prompt_impl.h @@ -6,6 +6,7 @@ #ifndef BRAVE_BROWSER_UI_VIEWS_PERMISSION_BUBBLE_ETHEREUM_PERMISSION_PROMPT_IMPL_H_ #define BRAVE_BROWSER_UI_VIEWS_PERMISSION_BUBBLE_ETHEREUM_PERMISSION_PROMPT_IMPL_H_ +#include "base/time/time.h" #include "components/permissions/permission_prompt.h" class Browser; 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 042e04c9d05f..77566102d302 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 @@ -203,7 +203,7 @@ void SidebarAddItemBubbleDelegateView::AddChildViews() { void SidebarAddItemBubbleDelegateView::OnDefaultItemsButtonPressed( const sidebar::SidebarItem& item) { GetSidebarService(browser_)->AddItem(item); - RemoveAllChildViews(true); + RemoveAllChildViews(); AddChildViews(); if (children().size() == 1) GetWidget()->CloseWithReason(views::Widget::ClosedReason::kUnspecified); @@ -211,7 +211,7 @@ void SidebarAddItemBubbleDelegateView::OnDefaultItemsButtonPressed( void SidebarAddItemBubbleDelegateView::OnCurrentItemButtonPressed() { browser_->sidebar_controller()->AddItemWithCurrentTab(); - RemoveAllChildViews(true); + RemoveAllChildViews(); AddChildViews(); if (children().size() == 1) GetWidget()->CloseWithReason(views::Widget::ClosedReason::kUnspecified); diff --git a/browser/ui/views/tabs/brave_tab_context_menu_contents.cc b/browser/ui/views/tabs/brave_tab_context_menu_contents.cc index 7505af6f840d..fd4cd64d5925 100644 --- a/browser/ui/views/tabs/brave_tab_context_menu_contents.cc +++ b/browser/ui/views/tabs/brave_tab_context_menu_contents.cc @@ -24,7 +24,8 @@ BraveTabContextMenuContents::BraveTabContextMenuContents( browser_(const_cast(controller->browser())), controller_(controller) { model_ = std::make_unique( - this, controller->model(), index); + this, controller->browser()->tab_menu_model_delegate(), + controller->model(), index); restore_service_ = TabRestoreServiceFactory::GetForProfile(browser_->profile()); menu_runner_ = std::make_unique( diff --git a/browser/ui/views/translate/brave_translate_bubble_view.cc b/browser/ui/views/translate/brave_translate_bubble_view.cc index 2f11f8c2fe82..a21e689912e3 100644 --- a/browser/ui/views/translate/brave_translate_bubble_view.cc +++ b/browser/ui/views/translate/brave_translate_bubble_view.cc @@ -68,12 +68,6 @@ BraveTranslateBubbleView::BraveCreateViewBeforeTranslate() { l10n_util::GetStringUTF16(IDS_BRAVE_TRANSLATE_BUBBLE_DONT_ASK_AGAIN)); dont_ask_button->SetID(BUTTON_ID_ALWAYS_TRANSLATE); - // Use the same text color as the cancel button. - const auto color = - views::style::GetColor(*dont_ask_button, views::style::CONTEXT_BUTTON_MD, - views::style::STYLE_PRIMARY); - dont_ask_button->SetTextColor(views::Button::STATE_NORMAL, color); - auto accept_button = std::make_unique( base::BindRepeating(&BraveTranslateBubbleView::ButtonPressed, base::Unretained(this), BUTTON_ID_DONE), @@ -92,6 +86,18 @@ BraveTranslateBubbleView::BraveCreateViewBeforeTranslate() { views::GridLayout::kFixedSize, provider->GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL)); + // We can't call views::style::GetColor() until the associated widget has been + // initialized or views::View::GetNativeTheme() will be called to avoid using + // the global NativeInstance, which would be an error. + RegisterWidgetInitializedCallback(base::BindOnce( + [](views::LabelButton* dont_ask_button) { + const auto color = views::style::GetColor( + *dont_ask_button, views::style::CONTEXT_BUTTON_MD, + views::style::STYLE_PRIMARY); + dont_ask_button->SetTextColor(views::Button::STATE_NORMAL, color); + }, + base::Unretained(dont_ask_button.get()))); + layout->AddView(std::move(dont_ask_button)); if (views::PlatformStyle::kIsOkButtonLeading) { @@ -131,7 +137,7 @@ void BraveTranslateBubbleView::DisableOfferTranslatePref() { PrefService* const prefs = profile->GetOriginalProfile()->GetPrefs(); DCHECK(prefs); - prefs->SetBoolean(prefs::kOfferTranslateEnabled, false); + prefs->SetBoolean(translate::prefs::kOfferTranslateEnabled, false); } void BraveTranslateBubbleView::ButtonPressed(ButtonID button_id) { diff --git a/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc b/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc index ff19ad4a15d7..90c30d721ef1 100644 --- a/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc +++ b/browser/ui/views/translate/brave_translate_bubble_view_unittest.cc @@ -31,7 +31,7 @@ class MockTranslateBubbleModel : public TranslateBubbleModel { translation_declined_(false), original_language_index_on_translation_(-1), target_language_index_on_translation_(-1), - can_blocklist_site_(true) {} + can_add_site_to_never_prompt_list_(true) {} TranslateBubbleModel::ViewState GetViewState() const override { return view_state_transition_.view_state(); @@ -126,11 +126,15 @@ class MockTranslateBubbleModel : public TranslateBubbleModel { target_language_index_on_translation_ == target_language_index_; } - bool CanBlocklistSite() override { return can_blocklist_site_; } + bool CanAddSiteToNeverPromptList() override { + return can_add_site_to_never_prompt_list_; + } void ReportUIInteraction(translate::UIInteraction ui_interaction) override {} - void SetCanBlocklistSite(bool value) { can_blocklist_site_ = value; } + void SetCanAddSiteToNeverPromptList(bool value) { + can_add_site_to_never_prompt_list_ = value; + } TranslateBubbleViewStateTransition view_state_transition_; translate::TranslateErrors::Type error_type_; @@ -146,7 +150,7 @@ class MockTranslateBubbleModel : public TranslateBubbleModel { bool translation_declined_; int original_language_index_on_translation_; int target_language_index_on_translation_; - bool can_blocklist_site_; + bool can_add_site_to_never_prompt_list_; }; class MockBraveTranslateBubbleView : public BraveTranslateBubbleView { diff --git a/browser/ui/webui/DEPS b/browser/ui/webui/DEPS index 49aba830c1ff..1aa2abaa36f8 100644 --- a/browser/ui/webui/DEPS +++ b/browser/ui/webui/DEPS @@ -1,4 +1,5 @@ include_rules = [ "+chrome/services/qrcode_generator/public/cpp", + "+chrome/services/qrcode_generator/public/mojom", "+bat/ledger/mojom_structs.h", ] diff --git a/browser/ui/webui/brave_welcome_ui.cc b/browser/ui/webui/brave_welcome_ui.cc index 10b82af1041a..c684cc7efab0 100644 --- a/browser/ui/webui/brave_welcome_ui.cc +++ b/browser/ui/webui/brave_welcome_ui.cc @@ -101,8 +101,9 @@ void WelcomeDOMHandler::HandleImportNowRequested(const base::ListValue* args) { } void WelcomeDOMHandler::HandleRecordP3A(const base::ListValue* args) { - if (!args->GetInteger(0, &screen_number_)) + if (!args->GetList()[0].is_int()) return; + screen_number_ = args->GetList()[0].GetInt(); if (!args->GetBoolean(1, &finished_)) return; if (!args->GetBoolean(2, &skipped_)) diff --git a/browser/ui/webui/new_tab_page/top_sites_message_handler.cc b/browser/ui/webui/new_tab_page/top_sites_message_handler.cc index e2bd5adb29e8..23343b09b6cc 100644 --- a/browser/ui/webui/new_tab_page/top_sites_message_handler.cc +++ b/browser/ui/webui/new_tab_page/top_sites_message_handler.cc @@ -223,14 +223,13 @@ void TopSitesMessageHandler::HandleReorderMostVisitedTile( if (!args->GetString(0, &url)) return; - int new_pos; - if (!args->GetInteger(1, &new_pos)) + if (!args->GetList()[1].is_int()) return; - GURL gurl(url); - // same as `MostVisitedHandler::ReorderMostVisitedTile` if (most_visited_sites_->IsCustomLinksEnabled()) { + GURL gurl(url); + int new_pos = args->GetList()[1].GetInt(); most_visited_sites_->ReorderCustomLink(gurl, new_pos); } } diff --git a/browser/ui/webui/settings/brave_appearance_handler.cc b/browser/ui/webui/settings/brave_appearance_handler.cc index b7c6cb4aeb9a..b1c0e56fe3f3 100644 --- a/browser/ui/webui/settings/brave_appearance_handler.cc +++ b/browser/ui/webui/settings/brave_appearance_handler.cc @@ -69,10 +69,10 @@ void BraveAppearanceHandler::RegisterMessages() { void BraveAppearanceHandler::SetBraveThemeType(const base::ListValue* args) { CHECK_EQ(args->GetSize(), 1U); + CHECK(args->GetList()[0].is_int()); AllowJavascript(); - int int_type; - args->GetInteger(0, &int_type); + int int_type = args->GetList()[0].GetInt(); dark_mode::SetBraveDarkModeType( static_cast(int_type)); } diff --git a/browser/ui/webui/settings/brave_default_extensions_handler.cc b/browser/ui/webui/settings/brave_default_extensions_handler.cc index 74a3fc7a9623..200f175ac4a1 100644 --- a/browser/ui/webui/settings/brave_default_extensions_handler.cc +++ b/browser/ui/webui/settings/brave_default_extensions_handler.cc @@ -483,9 +483,9 @@ void BraveDefaultExtensionsHandler::LaunchIPFSService( void BraveDefaultExtensionsHandler::SetIPFSStorageMax( const base::ListValue* args) { CHECK_EQ(args->GetSize(), 1U); + CHECK(args->GetList()[0].is_int()); CHECK(profile_); - int storage_max_gb = 0; - args->GetInteger(0, &storage_max_gb); + int storage_max_gb = args->GetList()[0].GetInt(); PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); prefs->SetInteger(kIpfsStorageMax, storage_max_gb); ipfs::IpfsService* service = diff --git a/browser/ui/webui/settings/brave_sync_handler.h b/browser/ui/webui/settings/brave_sync_handler.h index e15798ae9221..3fbd450ace55 100644 --- a/browser/ui/webui/settings/brave_sync_handler.h +++ b/browser/ui/webui/settings/brave_sync_handler.h @@ -11,6 +11,7 @@ #include "base/values.h" #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" #include "chrome/services/qrcode_generator/public/cpp/qrcode_generator_service.h" +#include "chrome/services/qrcode_generator/public/mojom/qrcode_generator.mojom.h" #include "components/sync_device_info/device_info_tracker.h" namespace syncer { diff --git a/browser/widevine/widevine_permission_request.cc b/browser/widevine/widevine_permission_request.cc index d4606a875416..f585f00e7fcd 100644 --- a/browser/widevine/widevine_permission_request.cc +++ b/browser/widevine/widevine_permission_request.cc @@ -19,7 +19,16 @@ bool WidevinePermissionRequest::is_test_ = false; WidevinePermissionRequest::WidevinePermissionRequest( content::WebContents* web_contents, bool for_restart) - : web_contents_(web_contents), for_restart_(for_restart) {} + : PermissionRequest( + web_contents->GetVisibleURL(), + permissions::RequestType::kWidevine, + /*has_gesture=*/false, + base::BindOnce(&WidevinePermissionRequest::PermissionDecided, + base::Unretained(this)), + base::BindOnce(&WidevinePermissionRequest::DeleteRequest, + base::Unretained(this))), + web_contents_(web_contents), + for_restart_(for_restart) {} WidevinePermissionRequest::~WidevinePermissionRequest() = default; @@ -28,40 +37,36 @@ std::u16string WidevinePermissionRequest::GetMessageTextFragment() const { GetWidevinePermissionRequestTextFrangmentResourceId(for_restart_)); } -GURL WidevinePermissionRequest::GetOrigin() const { - return web_contents_->GetVisibleURL(); -} - -void WidevinePermissionRequest::PermissionGranted(bool is_one_time) { +void WidevinePermissionRequest::PermissionDecided(ContentSetting result, + bool is_one_time) { + // Permission granted + if (result == ContentSetting::CONTENT_SETTING_ALLOW) { #if defined(OS_LINUX) - // Prevent relaunch during the browser test. - // This will cause abnormal termination during the test. - if (for_restart_ && !is_test_) { - // Try relaunch after handling permission grant logics in this turn. - base::SequencedTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(&chrome::AttemptRelaunch)); - } + // Prevent relaunch during the browser test. + // This will cause abnormal termination during the test. + if (for_restart_ && !is_test_) { + // Try relaunch after handling permission grant logics in this turn. + base::SequencedTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&chrome::AttemptRelaunch)); + } #endif - if (!for_restart_) - EnableWidevineCdmComponent(); -} - -void WidevinePermissionRequest::PermissionDenied() { - DontAskWidevineInstall(web_contents_, dont_ask_widevine_install_); -} - -void WidevinePermissionRequest::Cancelled() { - // Do nothing. + if (!for_restart_) { + EnableWidevineCdmComponent(); + } + // Permission denied + } else if (result == ContentSetting::CONTENT_SETTING_BLOCK) { + DontAskWidevineInstall(web_contents_, dont_ask_widevine_install_); + // Cancelled + } else { + DCHECK(result == CONTENT_SETTING_DEFAULT); + // Do nothing. + } } -void WidevinePermissionRequest::RequestFinished() { +void WidevinePermissionRequest::DeleteRequest() { delete this; } -permissions::RequestType WidevinePermissionRequest::GetRequestType() const { - return permissions::RequestType::kWidevine; -} - std::u16string WidevinePermissionRequest::GetExplanatoryMessageText() const { return l10n_util::GetStringUTF16(IDS_WIDEVINE_INSTALL_MESSAGE); } diff --git a/browser/widevine/widevine_permission_request.h b/browser/widevine/widevine_permission_request.h index a36e27a8ac06..3b32a574287b 100644 --- a/browser/widevine/widevine_permission_request.h +++ b/browser/widevine/widevine_permission_request.h @@ -19,6 +19,11 @@ class WidevinePermissionRequest : public permissions::PermissionRequest { public: WidevinePermissionRequest(content::WebContents* web_contents, bool for_restart); + + WidevinePermissionRequest(const WidevinePermissionRequest&) = delete; + WidevinePermissionRequest& operator=(const WidevinePermissionRequest&) = + delete; + ~WidevinePermissionRequest() override; std::u16string GetExplanatoryMessageText() const; @@ -33,12 +38,8 @@ class WidevinePermissionRequest : public permissions::PermissionRequest { // PermissionRequest overrides: std::u16string GetMessageTextFragment() const override; - GURL GetOrigin() const override; - void PermissionGranted(bool is_one_time) override; - void PermissionDenied() override; - void Cancelled() override; - void RequestFinished() override; - permissions::RequestType GetRequestType() const override; + void PermissionDecided(ContentSetting result, bool is_one_time); + void DeleteRequest(); // It's safe to use this raw |web_contents_| because this request is deleted // by PermissionManager that is tied with this |web_contents_|. @@ -51,8 +52,6 @@ class WidevinePermissionRequest : public permissions::PermissionRequest { // installation to ask user about restarting because installed widevine can // only be used after re-launch. bool for_restart_ = false; - - DISALLOW_COPY_AND_ASSIGN(WidevinePermissionRequest); }; #endif // BRAVE_BROWSER_WIDEVINE_WIDEVINE_PERMISSION_REQUEST_H_ diff --git a/build/android/bytecode/BUILD.gn b/build/android/bytecode/BUILD.gn index b0bc803138bb..08ce1469fb82 100644 --- a/build/android/bytecode/BUILD.gn +++ b/build/android/bytecode/BUILD.gn @@ -45,6 +45,7 @@ java_binary("java_bytecode_rewriter") { "//brave/build/android/bytecode/java/org/brave/bytecode/BraveTabSwitcherModeTTPhoneClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveTabUiFeatureUtilitiesClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveTabbedActivityClassAdapter.java", + "//brave/build/android/bytecode/java/org/brave/bytecode/BraveThemeUtilsClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveTileViewClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveToolbarLayoutClassAdapter.java", "//brave/build/android/bytecode/java/org/brave/bytecode/BraveToolbarManagerClassAdapter.java", diff --git a/build/android/bytecode/bytecode_rewriter.gni b/build/android/bytecode/bytecode_rewriter.gni index 1b69dd35947d..d642c3fb1991 100644 --- a/build/android/bytecode/bytecode_rewriter.gni +++ b/build/android/bytecode/bytecode_rewriter.gni @@ -4,6 +4,7 @@ brave_bytecode_jars = [ "obj/brave/android/features/tab_ui/java.javac.jar", "obj/brave/android/java/org/chromium/chrome/browser/search_engines/settings/java.javac.jar", "obj/brave/browser/notifications/java.javac.jar", + "obj/brave/browser/ui/android/theme/java.javac.jar", "obj/chrome/android/base_module_java.javac.jar", "obj/chrome/android/chrome_java.javac.jar", "obj/chrome/android/features/tab_ui/java.javac.jar", @@ -13,6 +14,7 @@ brave_bytecode_jars = [ "obj/chrome/browser/site_settings/android/java.javac.jar", "obj/chrome/browser/ui/android/appmenu/internal/java.javac.jar", "obj/chrome/browser/ui/android/omnibox/java.javac.jar", + "obj/chrome/browser/ui/android/theme/java.javac.jar", "obj/chrome/browser/ui/android/toolbar/java.javac.jar", "obj/components/browser_ui/notifications/android/java.javac.jar", "obj/components/browser_ui/site_settings/android/java.javac.jar", diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java index 0e94782999b4..fa94d262014b 100644 --- a/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java +++ b/build/android/bytecode/java/org/brave/bytecode/BraveClassAdapter.java @@ -39,11 +39,12 @@ public static ClassVisitor createAdapter(ClassVisitor chain) { chain = new BraveSingleCategorySettingsClassAdapter(chain); chain = new BraveSiteSettingsDelegateClassAdapter(chain); chain = new BraveStatusMediatorClassAdapter(chain); - chain = new BraveTabbedActivityClassAdapter(chain); chain = new BraveTabGroupUiCoordinatorClassAdapter(chain); chain = new BraveTabSwitcherModeTTCoordinatorPhoneClassAdapter(chain); chain = new BraveTabSwitcherModeTTPhoneClassAdapter(chain); chain = new BraveTabUiFeatureUtilitiesClassAdapter(chain); + chain = new BraveTabbedActivityClassAdapter(chain); + chain = new BraveThemeUtilsClassAdapter(chain); chain = new BraveTileViewClassAdapter(chain); chain = new BraveToolbarLayoutClassAdapter(chain); chain = new BraveToolbarManagerClassAdapter(chain); diff --git a/build/android/bytecode/java/org/brave/bytecode/BraveThemeUtilsClassAdapter.java b/build/android/bytecode/java/org/brave/bytecode/BraveThemeUtilsClassAdapter.java new file mode 100644 index 000000000000..9f597faec2c2 --- /dev/null +++ b/build/android/bytecode/java/org/brave/bytecode/BraveThemeUtilsClassAdapter.java @@ -0,0 +1,20 @@ +/* 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.brave.bytecode; + +import org.objectweb.asm.ClassVisitor; + +public class BraveThemeUtilsClassAdapter extends BraveClassVisitor { + static String sThemeUtilsClassName = "org/chromium/chrome/browser/theme/ThemeUtils"; + static String sBraveThemeUtilsClassName = "org/chromium/chrome/browser/theme/BraveThemeUtils"; + + public BraveThemeUtilsClassAdapter(ClassVisitor visitor) { + super(visitor); + + changeMethodOwner(sThemeUtilsClassName, + "getTextBoxColorForToolbarBackgroundInNonNativePage", sBraveThemeUtilsClassName); + } +} diff --git a/build/android/config.gni b/build/android/config.gni index 2a2e700708fd..7c315784a2a5 100644 --- a/build/android/config.gni +++ b/build/android/config.gni @@ -13,6 +13,7 @@ brave_chrome_java_deps = [ "//brave/browser/notifications:brave_java", "//brave/browser/notifications:java", "//brave/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings:java", + "//brave/browser/ui/android/theme:java", "//brave/third_party/android_deps:com_airbnb_android_java", "//brave/third_party/android_deps:com_android_installreferrer_java", "//brave/third_party/android_deps:google_play_services_safetynet_java", diff --git a/build/commands/lib/config.js b/build/commands/lib/config.js index ad3b5cf7a87c..40724b7f9537 100755 --- a/build/commands/lib/config.js +++ b/build/commands/lib/config.js @@ -203,7 +203,7 @@ Config.prototype.buildArgs = function () { is_asan: this.isAsan(), enable_full_stack_frames_for_profiling: this.isAsan(), v8_enable_verify_heap: this.isAsan(), - fieldtrial_testing_like_official_build: true, + disable_fieldtrial_testing_config: true, safe_browsing_mode: 1, brave_services_key: this.braveServicesKey, root_extra_deps: ["//brave"], 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 e4caa4fe07e8..27be1abcf61b 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,10 +32,8 @@ #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/chromium_src/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chromium_src/chrome/browser/notifications/notification_platform_bridge_mac.mm deleted file mode 100644 index 3298eb568ef2..000000000000 --- a/chromium_src/chrome/browser/notifications/notification_platform_bridge_mac.mm +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright 2019 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "chrome/browser/notifications/notification_platform_bridge_mac.h" - -#import - -#include "base/mac/mac_util.h" - -@interface NotificationTimeoutMac : NSObject - -- (void)startTimer:(NSUserNotification *)notification; - -@end - -@implementation NotificationTimeoutMac { - NSMutableArray * timers_; -} - -- (id)init { - if (self = [super init]) { - timers_ = [[NSMutableArray alloc] init]; - } - - return self; -} - -- (void)dealloc { - for (NSTimer * timer in timers_) { - [timer invalidate]; - timer = nil; - } - - [timers_ removeAllObjects]; - - [timers_ release]; - timers_ = nil; - - [super dealloc]; -} - -- (void)startTimer:(NSUserNotification *)notification { - NSTimer * timer = - [NSTimer scheduledTimerWithTimeInterval:5.0 - target:self - selector:@selector(timerFired:) - userInfo:[notification retain] - repeats:NO]; - [timers_ addObject:timer]; -} - -- (void)timerFired:(NSTimer *)timer { - NSUserNotification* notification = timer.userInfo; - if (!notification) { - return; - } - - auto* notification_center = - [NSUserNotificationCenter defaultUserNotificationCenter]; - [notification_center removeDeliveredNotification:notification]; - - [notification release]; - notification = nil; - - [timers_ removeObject:timer]; -} - -@end - -static NotificationTimeoutMac* - g_notification_platform_bridge_notification_timeout = - [[[NotificationTimeoutMac alloc] init] retain]; - -#define BRAVE_DISPLAY_ \ - [g_notification_platform_bridge_notification_timeout startTimer:toast]; - -#include "../../../../../chrome/browser/notifications/notification_platform_bridge_mac.mm" // NOLINT -#undef BRAVE_DISPLAY_ diff --git a/chromium_src/chrome/browser/notifications/notification_platform_bridge_mac_utils.mm b/chromium_src/chrome/browser/notifications/notification_platform_bridge_mac_utils.mm deleted file mode 100644 index cab285d60f70..000000000000 --- a/chromium_src/chrome/browser/notifications/notification_platform_bridge_mac_utils.mm +++ /dev/null @@ -1,9 +0,0 @@ -/* Copyright 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/. */ - -#define BRAVE_SUPPORTSALERTSIMPL_ return true; - -#include "../../../../../chrome/browser/notifications/notification_platform_bridge_mac_utils.mm" // NOLINT -#undef BRAVE_SUPPORTSALERTSIMPL_ diff --git a/chromium_src/chrome/browser/ui/session_crashed_bubble.h b/chromium_src/chrome/browser/ui/session_crashed_bubble.h index 5e71ab9d5ebe..3c8ce61e2738 100644 --- a/chromium_src/chrome/browser/ui/session_crashed_bubble.h +++ b/chromium_src/chrome/browser/ui/session_crashed_bubble.h @@ -6,8 +6,8 @@ #ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_SESSION_CRASHED_BUBBLE_H_ #define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_SESSION_CRASHED_BUBBLE_H_ -#define ShowIfNotOffTheRecordProfile \ - ShowIfNotOffTheRecordProfileBrave(Browser* browser); \ +#define ShowIfNotOffTheRecordProfile \ + ShowIfNotOffTheRecordProfileBrave(Browser* browser, bool skip_tab_checking); \ static void ShowIfNotOffTheRecordProfile #include "../../../../../chrome/browser/ui/session_crashed_bubble.h" diff --git a/chromium_src/chrome/browser/ui/tab_helpers.cc b/chromium_src/chrome/browser/ui/tab_helpers.cc index 6d4f0075a4d2..fa5e1f680833 100644 --- a/chromium_src/chrome/browser/ui/tab_helpers.cc +++ b/chromium_src/chrome/browser/ui/tab_helpers.cc @@ -5,10 +5,6 @@ #include "brave/browser/brave_tab_helpers.h" -// Include this to make sure we don't unintentionally rename NetErrorTabHelper -// into NoTabHelper inside WebContentsReceiverSet. -#include "content/public/browser/web_contents_receiver_set.h" - #define BRAVE_TAB_HELPERS \ brave::AttachTabHelpers(web_contents); diff --git a/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc b/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc index cf753426163d..be620da70918 100644 --- a/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc +++ b/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_bubble_view.cc @@ -66,7 +66,7 @@ bool HasWidevinePermissionRequest( // When widevine permission is requested, |requests| only includes Widevine // permission because it is not a candidate for grouping. if (requests.size() == 1 && - requests[0]->GetRequestType() == permissions::RequestType::kWidevine) + requests[0]->request_type() == permissions::RequestType::kWidevine) return true; return false; diff --git a/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc b/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc index 4e1f926853fb..7dd4d490a202 100644 --- a/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc +++ b/chromium_src/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc @@ -28,7 +28,7 @@ std::unique_ptr CreatePermissionPrompt( } #if BUILDFLAG(BRAVE_WALLET_ENABLED) && !defined(OS_ANDROID) && !defined(OS_IOS) - if (delegate->Requests()[0]->GetRequestType() == + if (delegate->Requests()[0]->request_type() == permissions::RequestType::kBraveEthereum) { return std::make_unique(browser, web_contents, delegate); diff --git a/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc b/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc index 5c5f13a1b256..2f3937e2c493 100644 --- a/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc +++ b/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc @@ -30,7 +30,7 @@ void TabHoverCardBubbleView_ChromiumImpl::BraveUpdateCardContent( base::ReplaceFirstSubstringAfterOffset( &new_domain, 0ul, kChromeUISchemeU16, base::ASCIIToUTF16(content::kBraveUIScheme)); - domain_label_->SetText(new_domain); + domain_label_->SetText(new_domain, /*is_filename*/ false); } } diff --git a/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc b/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc index 6ebc7096dd18..2be85f0a1861 100644 --- a/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc +++ b/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc @@ -3,48 +3,32 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" +#include "chrome/app/chrome_command_ids.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_command_controller.h" +#include "chrome/browser/ui/browser_commands.h" +#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/test/test_browser_dialog.h" -#include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/tabs/tab.h" +#include "chrome/browser/ui/views/tabs/tab_close_button.h" #include "chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h" #include "chrome/browser/ui/views/tabs/tab_hover_card_controller.h" +#include "chrome/browser/ui/views/tabs/tab_hover_card_metrics.h" #include "chrome/browser/ui/views/tabs/tab_strip.h" -#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/grit/generated_resources.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/test/browser_test.h" #include "ui/gfx/animation/animation_test_api.h" #include "ui/views/controls/label.h" +#include "ui/views/test/widget_test.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h" using views::Widget; -// Helper to wait until the hover card widget is visible. -class HoverCardVisibleWaiter : public views::WidgetObserver { - public: - explicit HoverCardVisibleWaiter(Widget* hover_card) - : hover_card_(hover_card) { - hover_card_->AddObserver(this); - } - ~HoverCardVisibleWaiter() override { hover_card_->RemoveObserver(this); } - - void Wait() { - if (hover_card_->IsVisible()) - return; - run_loop_.Run(); - } - - // WidgetObserver overrides: - void OnWidgetVisibilityChanged(Widget* widget, bool visible) override { - if (visible) - run_loop_.Quit(); - } - - private: - Widget* const hover_card_; - base::RunLoop run_loop_; -}; - class TabHoverCardBubbleViewBrowserTest : public DialogBrowserTest { public: TabHoverCardBubbleViewBrowserTest() @@ -52,54 +36,70 @@ class TabHoverCardBubbleViewBrowserTest : public DialogBrowserTest { gfx::Animation::RichAnimationRenderMode::FORCE_DISABLED)) { TabHoverCardController::disable_animations_for_testing_ = true; } + TabHoverCardBubbleViewBrowserTest(const TabHoverCardBubbleViewBrowserTest&) = + delete; + TabHoverCardBubbleViewBrowserTest& operator=( + const TabHoverCardBubbleViewBrowserTest&) = delete; ~TabHoverCardBubbleViewBrowserTest() override = default; - void SetUp() override { - DialogBrowserTest::SetUp(); + void SetUpOnMainThread() override { + DialogBrowserTest::SetUpOnMainThread(); + tab_strip_ = BrowserView::GetBrowserViewForBrowser(browser())->tabstrip(); + } + + TabStrip* tab_strip() { return tab_strip_; } + + TabHoverCardBubbleView* hover_card() { + return tab_strip()->hover_card_controller_->hover_card_; + } + + std::u16string GetHoverCardTitle() { + return hover_card()->GetTitleTextForTesting(); } - TabHoverCardBubbleView* GetHoverCard(const TabStrip* tab_strip) { - return tab_strip->hover_card_controller_->hover_card_; + std::u16string GetHoverCardDomain() { + return hover_card()->GetDomainTextForTesting(); } - static Widget* GetHoverCardWidget(TabHoverCardBubbleView* hover_card) { - return hover_card->GetWidget(); + int GetHoverCardsSeenCount() { + return tab_strip() + ->hover_card_controller_->metrics_for_testing() + ->cards_seen_count(); } - const std::u16string& GetHoverCardTitle( - const TabHoverCardBubbleView* hover_card) { - return hover_card->title_label_->GetText(); + void MouseExitTabStrip() { + ui::MouseEvent stop_hover_event(ui::ET_MOUSE_EXITED, gfx::Point(), + gfx::Point(), base::TimeTicks(), + ui::EF_NONE, 0); + tab_strip()->OnMouseExited(stop_hover_event); } - const std::u16string& GetHoverCardDomain( - const TabHoverCardBubbleView* hover_card) { - return hover_card->domain_label_->GetText(); + void ClickMouseOnTab(int index) { + Tab* const tab = tab_strip()->tab_at(index); + ui::MouseEvent click_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), + base::TimeTicks(), ui::EF_NONE, 0); + tab->OnMousePressed(click_event); } - void HoverMouseOverTabAt(TabStrip* tab_strip, int index) { + void HoverMouseOverTabAt(int index) { // We don't use Tab::OnMouseEntered here to invoke the hover card because // that path is disabled in browser tests. If we enabled it, the real mouse // might interfere with the test. - tab_strip->UpdateHoverCard(tab_strip->tab_at(index), - TabController::HoverCardUpdateType::kHover); + tab_strip()->UpdateHoverCard(tab_strip()->tab_at(index), + TabController::HoverCardUpdateType::kHover); } // DialogBrowserTest: void ShowUi(const std::string& name) override { - TabStrip* tab_strip = - BrowserView::GetBrowserViewForBrowser(browser())->tabstrip(); - HoverMouseOverTabAt(tab_strip, 0); - TabHoverCardBubbleView* hover_card = GetHoverCard(tab_strip); - Widget* widget = GetHoverCardWidget(hover_card); - HoverCardVisibleWaiter waiter(widget); - waiter.Wait(); + HoverMouseOverTabAt(0); + views::test::WidgetVisibleWaiter(hover_card()->GetWidget()).Wait(); } private: std::unique_ptr> animation_mode_reset_; - DISALLOW_COPY_AND_ASSIGN(TabHoverCardBubbleViewBrowserTest); + TabStrip* tab_strip_ = nullptr; }; // This test appears to be flaky on Windows. Upstream tests were also found to @@ -112,19 +112,16 @@ class TabHoverCardBubbleViewBrowserTest : public DialogBrowserTest { #endif IN_PROC_BROWSER_TEST_F(TabHoverCardBubbleViewBrowserTest, MAYBE_ChromeSchemeUrl) { - TabStrip* tab_strip = - BrowserView::GetBrowserViewForBrowser(browser())->tabstrip(); TabRendererData new_tab_data = TabRendererData(); new_tab_data.title = u"Settings - Addresses and more"; new_tab_data.last_committed_url = GURL("chrome://settings/addresses"); - tab_strip->AddTabAt(1, new_tab_data, false); + tab_strip()->AddTabAt(1, new_tab_data, false); ShowUi("default"); - TabHoverCardBubbleView* hover_card = GetHoverCard(tab_strip); - Widget* widget = GetHoverCardWidget(hover_card); + Widget* widget = hover_card()->GetWidget(); EXPECT_TRUE(widget != nullptr); EXPECT_TRUE(widget->IsVisible()); - HoverMouseOverTabAt(tab_strip, 1); - EXPECT_EQ(GetHoverCardTitle(hover_card), u"Settings - Addresses and more"); - EXPECT_EQ(GetHoverCardDomain(hover_card), u"brave://settings"); + HoverMouseOverTabAt(1); + EXPECT_EQ(GetHoverCardTitle(), u"Settings - Addresses and more"); + EXPECT_EQ(GetHoverCardDomain(), u"brave://settings"); } diff --git a/chromium_src/chrome/browser/ui/webui/settings/import_data_handler.cc b/chromium_src/chrome/browser/ui/webui/settings/import_data_handler.cc index 3f05bc0f9bd4..aa7c24dd39f6 100644 --- a/chromium_src/chrome/browser/ui/webui/settings/import_data_handler.cc +++ b/chromium_src/chrome/browser/ui/webui/settings/import_data_handler.cc @@ -11,10 +11,10 @@ // NOTE: When we add new import feature, also consider to add it for importing // in welcome page. // See IMPORT_BROWSER_DATA_REQUESTED action in welcome_reducer.ts. -#define BRAVE_IMPORT_DATA \ - if (*types->FindBoolKey(kImportDialogExtensions)) \ - selected_items |= importer::EXTENSIONS; \ - if (*types->FindBoolKey(kImportDialogPayments)) \ +#define BRAVE_IMPORT_DATA \ + if (*types.FindBoolKey(kImportDialogExtensions)) \ + selected_items |= importer::EXTENSIONS; \ + if (*types.FindBoolKey(kImportDialogPayments)) \ selected_items |= importer::PAYMENTS; #define BRAVE_SEND_BROWSER_PROFILE_DATA \ diff --git a/chromium_src/chrome/common/chrome_constants.cc b/chromium_src/chrome/common/chrome_constants.cc index a4f83553fcef..f3a950ee3c73 100644 --- a/chromium_src/chrome/common/chrome_constants.cc +++ b/chromium_src/chrome/common/chrome_constants.cc @@ -79,6 +79,7 @@ const base::FilePath::CharType kFrameworkName[] = FPL(PRODUCT_STRING " Framework.framework"); const base::FilePath::CharType kFrameworkExecutableName[] = FPL(PRODUCT_STRING " Framework"); +const char kMacHelperSuffixAlerts[] = " (Alerts)"; #endif // OS_MAC #if defined(OS_WIN) @@ -142,6 +143,8 @@ const base::FilePath::CharType kSingletonSocketFilename[] = const base::FilePath::CharType kSupervisedUserSettingsFilename[] = FPL("Managed Mode Settings"); const base::FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak"); +const base::FilePath::CharType kTransportSecurityPersisterFilename[] = + FPL("TransportSecurity"); const base::FilePath::CharType kTrustTokenFilename[] = FPL("Trust Tokens"); const base::FilePath::CharType kVideoTutorialsStorageDirname[] = FPL("Video Tutorials"); diff --git a/chromium_src/chrome/install_static/brave_install_modes_unittest.cc b/chromium_src/chrome/install_static/brave_install_modes_unittest.cc index fde03307bf6a..5eee790f4f4a 100644 --- a/chromium_src/chrome/install_static/brave_install_modes_unittest.cc +++ b/chromium_src/chrome/install_static/brave_install_modes_unittest.cc @@ -12,6 +12,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using ::testing::AnyOf; using ::testing::Eq; using ::testing::Gt; using ::testing::Le; @@ -98,9 +99,10 @@ TEST(InstallModes, VerifyModes) { // UNSUPPORTED and BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION) which we set for // OFFICIAL_BUILD are mutually exclusive. #if defined(OFFICIAL_BUILD) - ASSERT_THAT(mode.channel_strategy, Ne(ChannelStrategy::UNSUPPORTED)); + ASSERT_THAT(mode.channel_strategy, + AnyOf(ChannelStrategy::FLOATING, ChannelStrategy::FIXED)); #else - ASSERT_THAT(mode.channel_strategy, Eq(ChannelStrategy::UNSUPPORTED)); + ASSERT_THAT(mode.channel_strategy, Eq(ChannelStrategy::UNSUPPORTED)); #endif } } diff --git a/chromium_src/chrome/install_static/brave_install_util_unittest.cc b/chromium_src/chrome/install_static/brave_install_util_unittest.cc index d8e6d778248a..42fbf4fecd37 100644 --- a/chromium_src/chrome/install_static/brave_install_util_unittest.cc +++ b/chromium_src/chrome/install_static/brave_install_util_unittest.cc @@ -25,22 +25,6 @@ using version_info::Channel; namespace install_static { -// Tests the MatchPattern function in the install_static library. -TEST(InstallStaticTest, MatchPattern) { - EXPECT_TRUE(MatchPattern(L"", L"")); - EXPECT_TRUE(MatchPattern(L"", L"*")); - EXPECT_FALSE(MatchPattern(L"", L"*a")); - EXPECT_FALSE(MatchPattern(L"", L"abc")); - EXPECT_TRUE(MatchPattern(L"Hello1234", L"He??o*1*")); - EXPECT_TRUE(MatchPattern(L"Foo", L"F*?")); - EXPECT_TRUE(MatchPattern(L"Foo", L"F*")); - EXPECT_FALSE(MatchPattern(L"Foo", L"F*b")); - EXPECT_TRUE(MatchPattern(L"abcd", L"*c*d")); - EXPECT_TRUE(MatchPattern(L"abcd", L"*?c*d")); - EXPECT_FALSE(MatchPattern(L"abcd", L"abcd*efgh")); - EXPECT_TRUE(MatchPattern(L"foobarabc", L"*bar*")); -} - // Tests the install_static::GetSwitchValueFromCommandLine function. TEST(InstallStaticTest, GetSwitchValueFromCommandLineTest) { // Simple case with one switch. diff --git a/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc b/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc index f17ed064711a..a68ce3200e16 100644 --- a/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc +++ b/chromium_src/chrome/install_static/brave_product_install_details_unittest.cc @@ -199,59 +199,6 @@ TEST_P(MakeProductDetailsTest, DefaultChannel) { EXPECT_THAT(details->channel(), StrEq(test_data().channel)); } -// Test that the channel name is properly parsed out of additional parameters. -TEST_P(MakeProductDetailsTest, AdditionalParametersChannels) { - const std::pair kApChannels[] = { - // stable - {L"", L""}, - {L"-full", L""}, - {L"x64-stable", L""}, - {L"x64-stable-full", L""}, - {L"baz-x64-stable", L""}, - {L"foo-1.1-beta", L""}, - {L"2.0-beta", L""}, - {L"bar-2.0-dev", L""}, - {L"1.0-dev", L""}, - {L"fuzzy", L""}, - {L"foo", L""}, - {L"-multi-chrome", L""}, // Legacy. - {L"x64-stable-multi-chrome", L""}, // Legacy. - {L"-stage:ensemble_patching-multi-chrome-full", L""}, // Legacy. - {L"-multi-chrome-full", L""}, // Legacy. - // beta - {L"1.1-beta", L"beta"}, - {L"1.1-beta-full", L"beta"}, - {L"x64-beta", L"beta"}, - {L"x64-beta-full", L"beta"}, - {L"1.1-bar", L"beta"}, - {L"1n1-foobar", L"beta"}, - {L"x64-Beta", L"beta"}, - {L"bar-x64-beta", L"beta"}, - // dev - {L"2.0-dev", L"dev"}, - {L"2.0-dev-full", L"dev"}, - {L"x64-dev", L"dev"}, - {L"x64-dev-full", L"dev"}, - {L"2.0-DEV", L"dev"}, - {L"2.0-dev-eloper", L"dev"}, - {L"2.0-doom", L"dev"}, - {L"250-doom", L"dev"}, - }; - - for (const auto& ap_and_channel : kApChannels) { - SetAp(ap_and_channel.first); - std::unique_ptr details( - MakeProductDetails(test_data().path)); - if (kInstallModes[test_data().index].channel_strategy == - ChannelStrategy::ADDITIONAL_PARAMETERS) { - EXPECT_THAT(details->channel(), StrEq(ap_and_channel.second)); - } else { - // "ap" is ignored for this mode. - EXPECT_THAT(details->channel(), StrEq(test_data().channel)); - } - } -} - // Test that the "ap" value is cached during initialization. TEST_P(MakeProductDetailsTest, UpdateAp) { // This test is only valid for brands that integrate with Google Update. diff --git a/chromium_src/chrome/install_static/chromium_install_modes.cc b/chromium_src/chrome/install_static/chromium_install_modes.cc index 01cd2e9913cd..df2b4f0c34a8 100644 --- a/chromium_src/chrome/install_static/chromium_install_modes.cc +++ b/chromium_src/chrome/install_static/chromium_install_modes.cc @@ -37,26 +37,27 @@ const InstallConstants kInstallModes[] = { L"", // Empty install_suffix for the primary install mode. L"", // No logo suffix for the primary install mode. L"{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}", - L"Brave", // A distinct base_app_name. - L"Brave", // A distinct base_app_id. - L"BraveHTML", // ProgID prefix. - L"Brave HTML Document", // ProgID description. + L"Brave", // A distinct base_app_name. + L"Brave", // A distinct base_app_id. + L"BraveHTML", // ProgID prefix. + L"Brave HTML Document", // ProgID description. L"{AFE6A462-C574-4B8A-AF43-4CC60DF4563B}", // Active Setup GUID. L"{B1C5AAC5-2B7C-4C9D-9E96-774C53151B20}", // CommandExecuteImpl CLSID. - { 0x6c9646d, - 0x2807, - 0x44c0, - { 0x97, 0xd2, 0x6d, 0xa0, 0xdb, 0x62, 0x3d, - 0xb4 } }, // Toast activator CLSID. - { 0x576b31af, - 0x6369, - 0x4b6b, - { 0x85, 0x60, 0xe4, 0xb2, 0x3, 0xa9, 0x7a, - 0x8b } }, // Elevator CLSID. - { 0xb7965c30, 0x7d58, 0x4d86, { - 0x9e, 0x18, 0x47, 0x94, 0x25, 0x64, 0x9, 0xee } }, + {0x6c9646d, + 0x2807, + 0x44c0, + {0x97, 0xd2, 0x6d, 0xa0, 0xdb, 0x62, 0x3d, + 0xb4}}, // Toast activator CLSID. + {0x576b31af, + 0x6369, + 0x4b6b, + {0x85, 0x60, 0xe4, 0xb2, 0x3, 0xa9, 0x7a, 0x8b}}, // Elevator CLSID. + {0xb7965c30, + 0x7d58, + 0x4d86, + {0x9e, 0x18, 0x47, 0x94, 0x25, 0x64, 0x9, 0xee}}, L"", // The empty string means "stable". - ChannelStrategy::ADDITIONAL_PARAMETERS, + ChannelStrategy::FLOATING, true, // Supports system-level installs. true, // Supports in-product set as default browser UX. true, // Supports retention experiments. @@ -73,30 +74,30 @@ const InstallConstants kInstallModes[] = { L"-Beta", // Install suffix. L"Beta", // Logo suffix. L"{103BD053-949B-43A8-9120-2E424887DE11}", // A distinct app GUID. - L"Brave Beta", // A distinct base_app_name. - L"BraveBeta", // A distinct base_app_id. - L"BraveBHTML", // ProgID prefix. - L"Brave Beta HTML Document", // ProgID description. + L"Brave Beta", // A distinct base_app_name. + L"BraveBeta", // A distinct base_app_id. + L"BraveBHTML", // ProgID prefix. + L"Brave Beta HTML Document", // ProgID description. L"{103BD053-949B-43A8-9120-2E424887DE11}", // Active Setup GUID. L"", // CommandExecuteImpl CLSID. - { 0x9560028d, - 0xcca, - 0x49f0, - { 0x8d, 0x47, 0xef, 0x22, 0xbb, 0xc4, 0xb, - 0xa7 } }, // Toast activator CLSID. - { 0x2313f1cd, - 0x41f3, - 0x4347, - { 0xbe, 0xc0, 0xd7, 0x22, 0xca, 0x41, 0x2c, - 0x75 } }, // Elevator CLSID. - { 0xd9d7b102, 0xfc8a, 0x4843, { - 0xac, 0x35, 0x1e, 0xbc, 0xc7, 0xed, 0x12, - 0x3d } }, - L"beta", // Forced channel name. + {0x9560028d, + 0xcca, + 0x49f0, + {0x8d, 0x47, 0xef, 0x22, 0xbb, 0xc4, 0xb, + 0xa7}}, // Toast activator CLSID. + {0x2313f1cd, + 0x41f3, + 0x4347, + {0xbe, 0xc0, 0xd7, 0x22, 0xca, 0x41, 0x2c, 0x75}}, // Elevator CLSID. + {0xd9d7b102, + 0xfc8a, + 0x4843, + {0xac, 0x35, 0x1e, 0xbc, 0xc7, 0xed, 0x12, 0x3d}}, + L"beta", // Forced channel name. ChannelStrategy::FIXED, - true, // Supports system-level installs. - true, // Supports in-product set as default browser UX. - true, // Supports retention experiments. + true, // Supports system-level installs. + true, // Supports in-product set as default browser UX. + true, // Supports retention experiments. icon_resources::kBetaApplicationIndex, // App icon resource index. IDR_X005_BETA, // App icon resource id. L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-" @@ -110,30 +111,30 @@ const InstallConstants kInstallModes[] = { L"-Dev", // Install suffix. L"Dev", // Logo suffix. L"{CB2150F2-595F-4633-891A-E39720CE0531}", // A distinct app GUID. - L"Brave Dev", // A distinct base_app_name. - L"BraveDev", // A distinct base_app_id. - L"BraveDHTML", // ProgID prefix. - L"Brave Dev HTML Document", // ProgID description. + L"Brave Dev", // A distinct base_app_name. + L"BraveDev", // A distinct base_app_id. + L"BraveDHTML", // ProgID prefix. + L"Brave Dev HTML Document", // ProgID description. L"{CB2150F2-595F-4633-891A-E39720CE0531}", // Active Setup GUID. L"", // CommandExecuteImpl CLSID. - { 0x20b22981, - 0xf63a, - 0x47a6, - { 0xa5, 0x47, 0x69, 0x1c, 0xc9, 0x4c, 0xae, - 0xe0 } }, // Toast activator CLSID. - { 0x9129ed6a, - 0x11d3, - 0x43b7, - { 0xb7, 0x18, 0x8f, 0x82, 0x61, 0x45, 0x97, - 0xa3 } }, // Elevator CLSID. - { 0x9cf6868c, 0x8c9f, 0x4220, - { 0x95, 0xbe, 0x13, 0x99, 0x9d, 0xd9, 0x9b, - 0x48 } }, - L"dev", // Forced channel name. + {0x20b22981, + 0xf63a, + 0x47a6, + {0xa5, 0x47, 0x69, 0x1c, 0xc9, 0x4c, 0xae, + 0xe0}}, // Toast activator CLSID. + {0x9129ed6a, + 0x11d3, + 0x43b7, + {0xb7, 0x18, 0x8f, 0x82, 0x61, 0x45, 0x97, 0xa3}}, // Elevator CLSID. + {0x9cf6868c, + 0x8c9f, + 0x4220, + {0x95, 0xbe, 0x13, 0x99, 0x9d, 0xd9, 0x9b, 0x48}}, + L"dev", // Forced channel name. ChannelStrategy::FIXED, - true, // Supports system-level installs. - true, // Supports in-product set as default browser UX. - true, // Supports retention experiments. + true, // Supports system-level installs. + true, // Supports in-product set as default browser UX. + true, // Supports retention experiments. icon_resources::kDevApplicationIndex, // App icon resource index. IDR_X004_DEV, // App icon resource id. L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-" @@ -147,30 +148,30 @@ const InstallConstants kInstallModes[] = { L"-Nightly", // Install suffix. L"Canary", // Logo suffix. L"{C6CB981E-DB30-4876-8639-109F8933582C}", // A distinct app GUID. - L"Brave Nightly", // A distinct base_app_name. + L"Brave Nightly", // A distinct base_app_name. L"BraveNightly", // A distinct base_app_id. - L"BraveSSHTM", // ProgID prefix. + L"BraveSSHTM", // ProgID prefix. L"Brave Nightly HTML Document", // ProgID description. L"{C6CB981E-DB30-4876-8639-109F8933582C}", // Active Setup GUID. L"{312ABB99-A176-4939-A39F-E8D34EA4D393}", // CommandExecuteImpl CLSID. - { 0xf2edbc59, - 0x7217, - 0x4da5, - { 0xa2, 0x59, 0x3, 0x2, 0xda, 0x6a, 0x0, - 0xe1 } }, // Toast activator CLSID. - { 0x1ce2f84f, - 0x70cb, - 0x4389, - { 0x87, 0xdb, 0xd0, 0x99, 0x48, 0x30, 0xbb, - 0x17 } }, // Elevator CLSID. - { 0x648b3c2b, 0xe53, 0x4085, - { 0xa9, 0x75, 0x11, 0x18, 0x1, 0x75, 0x8f, - 0xe7 } }, - L"nightly", // Forced channel name. + {0xf2edbc59, + 0x7217, + 0x4da5, + {0xa2, 0x59, 0x3, 0x2, 0xda, 0x6a, 0x0, + 0xe1}}, // Toast activator CLSID. + {0x1ce2f84f, + 0x70cb, + 0x4389, + {0x87, 0xdb, 0xd0, 0x99, 0x48, 0x30, 0xbb, 0x17}}, // Elevator CLSID. + {0x648b3c2b, + 0xe53, + 0x4085, + {0xa9, 0x75, 0x11, 0x18, 0x1, 0x75, 0x8f, 0xe7}}, + L"nightly", // Forced channel name. ChannelStrategy::FIXED, - true, // Support system-level installs. - true, // Support in-product set as default browser UX. - true, // Supports retention experiments. + true, // Support system-level installs. + true, // Support in-product set as default browser UX. + true, // Supports retention experiments. icon_resources::kSxSApplicationIndex, // App icon resource index. IDR_SXS, // App icon resource id. L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-" diff --git a/chromium_src/chrome/install_static/install_constants.h b/chromium_src/chrome/install_static/install_constants.h new file mode 100644 index 000000000000..d77f3a8bae9f --- /dev/null +++ b/chromium_src/chrome/install_static/install_constants.h @@ -0,0 +1,23 @@ +/* Copyright 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/. */ + +// Brand-specific types and constants for Google Chrome. + +#ifndef BRAVE_CHROMIUM_SRC_CHROME_INSTALL_STATIC_INSTALL_CONSTANTS_H_ +#define BRAVE_CHROMIUM_SRC_CHROME_INSTALL_STATIC_INSTALL_CONSTANTS_H_ + +#if defined(OFFICIAL_BUILD) +#include "chrome/install_static/buildflags.h" +#undef BUILDFLAG_INTERNAL_USE_GOOGLE_UPDATE_INTEGRATION +#define BUILDFLAG_INTERNAL_USE_GOOGLE_UPDATE_INTEGRATION() (1) +#endif + +#include "../../../../chrome/install_static/install_constants.h" + +#if defined(OFFICIAL_BUILD) +#undef BUILDFLAG_INTERNAL_USE_GOOGLE_UPDATE_INTEGRATION +#endif + +#endif // BRAVE_CHROMIUM_SRC_CHROME_INSTALL_STATIC_INSTALL_CONSTANTS_H_ diff --git a/chromium_src/chrome/installer/setup/install_worker.cc b/chromium_src/chrome/installer/setup/install_worker.cc index 590018eb923e..cdcc521508de 100644 --- a/chromium_src/chrome/installer/setup/install_worker.cc +++ b/chromium_src/chrome/installer/setup/install_worker.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "chrome/install_static/buildflags.h" - #if defined(OFFICIAL_BUILD) +#include "chrome/install_static/buildflags.h" +#include "chrome/install_static/install_constants.h" #undef BUILDFLAG_INTERNAL_USE_GOOGLE_UPDATE_INTEGRATION #define BUILDFLAG_INTERNAL_USE_GOOGLE_UPDATE_INTEGRATION() (1) #endif diff --git a/chromium_src/chrome/installer/setup/sources.gni b/chromium_src/chrome/installer/setup/sources.gni index 455a603a6298..4f9080c69b89 100644 --- a/chromium_src/chrome/installer/setup/sources.gni +++ b/chromium_src/chrome/installer/setup/sources.gni @@ -8,4 +8,12 @@ brave_chromium_src_chrome_installer_setup_deps = [] if (is_win) { brave_chromium_src_chrome_installer_setup_deps += [ "//brave/installer/util" ] + if (is_official_build) { + # These should be added to the lib target, but don't want to add another + # patch. + brave_chromium_src_chrome_installer_setup_sources += [ + "channel_override_work_item.cc", + "channel_override_work_item.h", + ] + } } diff --git a/chromium_src/components/network_session_configurator/browser/network_session_configurator.cc b/chromium_src/components/network_session_configurator/browser/network_session_configurator.cc index ea02afccdcef..9a69088a3157 100644 --- a/chromium_src/components/network_session_configurator/browser/network_session_configurator.cc +++ b/chromium_src/components/network_session_configurator/browser/network_session_configurator.cc @@ -14,7 +14,7 @@ namespace network_session_configurator { void ParseCommandLineAndFieldTrials(const base::CommandLine& command_line, bool is_quic_force_disabled, const std::string& quic_user_agent_id, - net::HttpNetworkSession::Params* params, + net::HttpNetworkSessionParams* params, net::QuicParams* quic_params) { ParseCommandLineAndFieldTrials_ChromiumImpl( command_line, diff --git a/chromium_src/components/os_crypt/keychain_password_mac.mm b/chromium_src/components/os_crypt/keychain_password_mac.mm index de421460b917..163debc2e6bd 100644 --- a/chromium_src/components/os_crypt/keychain_password_mac.mm +++ b/chromium_src/components/os_crypt/keychain_password_mac.mm @@ -5,26 +5,55 @@ #include "components/os_crypt/keychain_password_mac.h" -#include +#include #include "base/command_line.h" -#define BRAVE_KEYCHAIN_PASSWORD_GET_PASSWORD \ - std::unique_ptr service_name, account_name; \ - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); \ - if (command_line->HasSwitch("import-chrome")) { \ - service_name = std::make_unique("Chrome Safe Storage"); \ - account_name = std::make_unique("Chrome"); \ - } else if (command_line->HasSwitch("import-chromium") || \ - command_line->HasSwitch("import-brave")) { \ - service_name = std::make_unique("Chromium Safe Storage"); \ - account_name = std::make_unique("Chromium"); \ - } else { \ - service_name = std::make_unique( \ - ::KeychainPassword::service_name->c_str()); \ - account_name = std::make_unique( \ - ::KeychainPassword::account_name->c_str()); \ - } +namespace { + +const char kBraveDefaultServiceName[] = "Brave Safe Storage"; +const char kBraveDefaultAccountName[] = "Brave"; + +KeychainPassword::KeychainNameType& GetBraveServiceName(); +KeychainPassword::KeychainNameType& GetBraveAccountName(); +} + +#define BRAVE_GET_SERVICE_NAME return GetBraveServiceName(); +#define BRAVE_GET_ACCOUNT_NAME return GetBraveAccountName(); #include "../../../../components/os_crypt/keychain_password_mac.mm" -#undef BRAVE_KEYCHAIN_PASSWORD_GET_PASSWORD \ No newline at end of file +#undef BRAVE_GET_SERVICE_NAME +#undef BRAVE_GET_ACCOUNT_NAME + +namespace { + +std::pair GetServiceAndAccountName() { + std::string service_name, account_name; + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch("import-chrome")) { + service_name = std::string("Chrome Safe Storage"); + account_name = std::string("Chrome"); + } else if (command_line->HasSwitch("import-chromium") || + command_line->HasSwitch("import-brave")) { + service_name = std::string("Chromium Safe Storage"); + account_name = std::string("Chromium"); + } else { + service_name = std::string(kBraveDefaultServiceName); + account_name = std::string(kBraveDefaultAccountName); + } + return std::make_pair(service_name, account_name); +} + +KeychainPassword::KeychainNameType& GetBraveServiceName() { + static KeychainNameContainerType service_name( + GetServiceAndAccountName().first); + return *service_name; +} + +KeychainPassword::KeychainNameType& GetBraveAccountName() { + static KeychainNameContainerType account_name( + GetServiceAndAccountName().second); + return *account_name; +} + +} diff --git a/chromium_src/components/os_crypt/os_crypt_mac.mm b/chromium_src/components/os_crypt/os_crypt_mac.mm deleted file mode 100644 index 5e95177dddb1..000000000000 --- a/chromium_src/components/os_crypt/os_crypt_mac.mm +++ /dev/null @@ -1,14 +0,0 @@ -/* 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/os_crypt/keychain_password_mac.h" - -#define KeychainPassword \ - *KeychainPassword::service_name = "Brave Safe Storage"; \ - *KeychainPassword::account_name = "Brave"; \ - KeychainPassword - -#include "../../../../components/os_crypt/os_crypt_mac.mm" -#undef KeychainPassword \ No newline at end of file diff --git a/chromium_src/components/permissions/DEPS b/chromium_src/components/permissions/DEPS index 5f6aadd538d3..8fbd87c32448 100644 --- a/chromium_src/components/permissions/DEPS +++ b/chromium_src/components/permissions/DEPS @@ -2,6 +2,7 @@ include_rules = [ "+../../../../components/permissions", "+components/permissions", "+components/resources/android", + "+components/strings/grit/components_strings.h", "+components/vector_icons", "+third_party/widevine/cdm", "+ui/gfx", diff --git a/chromium_src/components/permissions/android/permission_dialog_delegate.cc b/chromium_src/components/permissions/android/permission_dialog_delegate.cc index d33bc31b2008..82b4a84d58d8 100644 --- a/chromium_src/components/permissions/android/permission_dialog_delegate.cc +++ b/chromium_src/components/permissions/android/permission_dialog_delegate.cc @@ -11,6 +11,7 @@ #include "brave/components/permissions/permission_lifetime_utils.h" #include "components/grit/brave_components_strings.h" #include "components/permissions/android/jni_headers/PermissionDialogController_jni.h" +#include "components/permissions/android/permission_prompt_android.h" #include "components/permissions/features.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chromium_src/components/permissions/permission_request.cc b/chromium_src/components/permissions/permission_request.cc index 20f71cbedea9..348720a77972 100644 --- a/chromium_src/components/permissions/permission_request.cc +++ b/chromium_src/components/permissions/permission_request.cc @@ -5,20 +5,90 @@ #include "components/permissions/permission_request.h" +#include + +#include "base/containers/contains.h" +#include "components/strings/grit/components_strings.h" +#include "third_party/widevine/cdm/buildflags.h" + #define PermissionRequest PermissionRequest_ChromiumImpl #define IsDuplicateOf IsDuplicateOf_ChromiumImpl + +// `kWidevine` handled by an override in `WidevinePermissionRequest` and the +// Brave Ethereum permission has its own permission request prompt. +#define BRAVE_ENUM_ITEMS_FOR_SWITCH \ + case RequestType::kBraveEthereum: \ + NOTREACHED(); \ + return std::u16string(); \ + case RequestType::kWidevine: \ + NOTREACHED(); \ + return std::u16string(); + +namespace { +#if defined(OS_ANDROID) +const unsigned int IDS_VR_INFOBAR_TEXT_OVERRIDE = IDS_VR_INFOBAR_TEXT; +#else +const unsigned int IDS_VR_PERMISSION_FRAGMENT_OVERRIDE = + IDS_VR_PERMISSION_FRAGMENT; +#endif +} // namespace + +#if defined(OS_ANDROID) +// For PermissionRequest::GetDialogMessageText +#undef IDS_VR_INFOBAR_TEXT +#define IDS_VR_INFOBAR_TEXT \ + IDS_VR_INFOBAR_TEXT_OVERRIDE; \ + break; \ + BRAVE_ENUM_ITEMS_FOR_SWITCH +#else +// For PermissionRequest::GetMessageTextFragment +#undef IDS_VR_PERMISSION_FRAGMENT +#define IDS_VR_PERMISSION_FRAGMENT \ + IDS_VR_PERMISSION_FRAGMENT_OVERRIDE; \ + break; \ + BRAVE_ENUM_ITEMS_FOR_SWITCH +#endif + #include "../../../../components/permissions/permission_request.cc" +#undef IDS_VR_INFOBAR_TEXT +#undef IDS_VR_PERMISSION_FRAGMENT #undef IsDuplicateOf #undef PermissionRequest namespace permissions { -PermissionRequest::PermissionRequest() = default; +PermissionRequest::PermissionRequest( + const GURL& requesting_origin, + RequestType request_type, + bool has_gesture, + PermissionDecidedCallback permission_decided_callback, + base::OnceClosure delete_callback) + : PermissionRequest_ChromiumImpl(requesting_origin, + request_type, + has_gesture, + std::move(permission_decided_callback), + std::move(delete_callback)) {} PermissionRequest::~PermissionRequest() = default; bool PermissionRequest::SupportsLifetime() const { - return false; + const RequestType kExcludedTypes[] = { + RequestType::kDiskQuota, + RequestType::kMultipleDownloads, +#if defined(OS_ANDROID) + RequestType::kProtectedMediaIdentifier, +#else + RequestType::kRegisterProtocolHandler, + RequestType::kSecurityAttestation, +#endif // defined(OS_ANDROID) +#if BUILDFLAG(ENABLE_WIDEVINE) + RequestType::kWidevine +#endif // BUILDFLAG(ENABLE_WIDEVINE) + }; + if (base::Contains(kExcludedTypes, request_type())) { + return false; + } + return true; } void PermissionRequest::SetLifetime(absl::optional lifetime) { diff --git a/chromium_src/components/permissions/permission_request.h b/chromium_src/components/permissions/permission_request.h index f764e3251aa9..cef2edc8107a 100644 --- a/chromium_src/components/permissions/permission_request.h +++ b/chromium_src/components/permissions/permission_request.h @@ -18,10 +18,18 @@ namespace permissions { class PermissionRequest : public PermissionRequest_ChromiumImpl { public: - PermissionRequest(); + PermissionRequest(const GURL& requesting_origin, + RequestType request_type, + bool has_gesture, + PermissionDecidedCallback permission_decided_callback, + base::OnceClosure delete_callback); + + PermissionRequest(const PermissionRequest&) = delete; + PermissionRequest& operator=(const PermissionRequest&) = delete; + ~PermissionRequest() override; - virtual bool SupportsLifetime() const; + bool SupportsLifetime() const; void SetLifetime(absl::optional lifetime); const absl::optional& GetLifetime() const; diff --git a/chromium_src/components/permissions/permission_request_impl.cc b/chromium_src/components/permissions/permission_request_impl.cc deleted file mode 100644 index ab81f57c145a..000000000000 --- a/chromium_src/components/permissions/permission_request_impl.cc +++ /dev/null @@ -1,18 +0,0 @@ -/* 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/permissions/permission_request_impl.h" - -#define PermissionRequestImpl PermissionRequestImpl_ChromiumImpl -#include "../../../../components/permissions/permission_request_impl.cc" -#undef PermissionRequestImpl - -namespace permissions { - -bool PermissionRequestImpl::SupportsLifetime() const { - return true; -} - -} // namespace permissions diff --git a/chromium_src/components/permissions/permission_request_impl.h b/chromium_src/components/permissions/permission_request_impl.h deleted file mode 100644 index 203ea326c747..000000000000 --- a/chromium_src/components/permissions/permission_request_impl.h +++ /dev/null @@ -1,26 +0,0 @@ -/* 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_PERMISSIONS_PERMISSION_REQUEST_IMPL_H_ -#define BRAVE_CHROMIUM_SRC_COMPONENTS_PERMISSIONS_PERMISSION_REQUEST_IMPL_H_ - -#define PermissionRequestImpl PermissionRequestImpl_ChromiumImpl -#include "../../../../components/permissions/permission_request_impl.h" -#undef PermissionRequestImpl - -namespace permissions { - -class PermissionRequestImpl : public PermissionRequestImpl_ChromiumImpl { - public: - using PermissionRequestImpl_ChromiumImpl::PermissionRequestImpl_ChromiumImpl; - - // Make it final to protect from accidental permission lifetime handling - // issues. - bool SupportsLifetime() const final; -}; - -} // namespace permissions - -#endif // BRAVE_CHROMIUM_SRC_COMPONENTS_PERMISSIONS_PERMISSION_REQUEST_IMPL_H_ diff --git a/chromium_src/components/permissions/permission_request_manager.cc b/chromium_src/components/permissions/permission_request_manager.cc index f6850951f3e6..49ef5cb8b654 100644 --- a/chromium_src/components/permissions/permission_request_manager.cc +++ b/chromium_src/components/permissions/permission_request_manager.cc @@ -20,11 +20,11 @@ bool PermissionRequestManager::ShouldGroupRequests(PermissionRequest* a, PermissionRequest* b) { std::string origin_a; std::string origin_b; - if (a->GetRequestType() == RequestType::kBraveEthereum && - b->GetRequestType() == RequestType::kBraveEthereum && - brave_wallet::ParseRequestingOriginFromSubRequest(a->GetOrigin(), + if (a->request_type() == RequestType::kBraveEthereum && + b->request_type() == RequestType::kBraveEthereum && + brave_wallet::ParseRequestingOriginFromSubRequest(a->requesting_origin(), &origin_a, nullptr) && - brave_wallet::ParseRequestingOriginFromSubRequest(b->GetOrigin(), + brave_wallet::ParseRequestingOriginFromSubRequest(b->requesting_origin(), &origin_b, nullptr) && origin_a == origin_b) { return true; diff --git a/chromium_src/components/services/storage/dom_storage/local_storage_impl.cc b/chromium_src/components/services/storage/dom_storage/local_storage_impl.cc index cd0764017053..4ea347337f32 100644 --- a/chromium_src/components/services/storage/dom_storage/local_storage_impl.cc +++ b/chromium_src/components/services/storage/dom_storage/local_storage_impl.cc @@ -38,13 +38,14 @@ void LocalStorageImpl::ShutDown(base::OnceClosure callback) { } void LocalStorageImpl::BindStorageArea( - const url::Origin& origin, + const blink::StorageKey& storage_key, mojo::PendingReceiver receiver) { - if (origin.opaque()) { - in_memory_local_storage_->BindStorageArea(*GetNonOpaqueOrigin(origin, true), - std::move(receiver)); + if (storage_key.origin().opaque()) { + in_memory_local_storage_->BindStorageArea( + *GetStorageKeyWithNonOpaqueOrigin(storage_key, true), + std::move(receiver)); } else { - local_storage_->BindStorageArea(origin, std::move(receiver)); + local_storage_->BindStorageArea(storage_key, std::move(receiver)); } } @@ -52,18 +53,20 @@ void LocalStorageImpl::GetUsage(GetUsageCallback callback) { local_storage_->GetUsage(std::move(callback)); } -void LocalStorageImpl::DeleteStorage(const url::Origin& origin, +void LocalStorageImpl::DeleteStorage(const blink::StorageKey& storage_key, DeleteStorageCallback callback) { - if (origin.opaque()) { - if (const auto* non_opaque_origin = GetNonOpaqueOrigin(origin, false)) { - in_memory_local_storage_->DeleteStorage(*non_opaque_origin, + const url::Origin& storage_key_origin = storage_key.origin(); + if (storage_key_origin.opaque()) { + if (const auto* non_opaque_origins_storage_key = + GetStorageKeyWithNonOpaqueOrigin(storage_key, false)) { + in_memory_local_storage_->DeleteStorage(*non_opaque_origins_storage_key, std::move(callback)); - non_opaque_origins_.erase(origin); + storage_keys_with_non_opaque_origin_.erase(storage_key_origin); } else { std::move(callback).Run(); } } else { - local_storage_->DeleteStorage(origin, std::move(callback)); + local_storage_->DeleteStorage(storage_key, std::move(callback)); } } @@ -88,26 +91,28 @@ void LocalStorageImpl::ForceKeepSessionState() { local_storage_->ForceKeepSessionState(); } -const url::Origin* LocalStorageImpl::GetNonOpaqueOrigin( - const url::Origin& origin, +const blink::StorageKey* LocalStorageImpl::GetStorageKeyWithNonOpaqueOrigin( + const blink::StorageKey& storage_key, bool create) { - DCHECK(origin.opaque()); - auto non_opaque_origin_it = non_opaque_origins_.find(origin); - if (non_opaque_origin_it != non_opaque_origins_.end()) { - return &non_opaque_origin_it->second; + const url::Origin& storage_key_origin = storage_key.origin(); + DCHECK(storage_key_origin.opaque()); + auto storage_keys_it = + storage_keys_with_non_opaque_origin_.find(storage_key_origin); + if (storage_keys_it != storage_keys_with_non_opaque_origin_.end()) { + return &storage_keys_it->second; } if (!create) { return nullptr; } const auto& origin_scheme_host_port = - origin.GetTupleOrPrecursorTupleIfOpaque(); - auto emplaced_pair = non_opaque_origins_.emplace( - origin, - url::Origin::CreateFromNormalizedTuple( - origin_scheme_host_port.scheme(), - base::ToLowerASCII(base::UnguessableToken::Create().ToString()), - origin_scheme_host_port.port())); + storage_key_origin.GetTupleOrPrecursorTupleIfOpaque(); + url::Origin non_opaque_origin = url::Origin::CreateFromNormalizedTuple( + origin_scheme_host_port.scheme(), + base::ToLowerASCII(base::UnguessableToken::Create().ToString()), + origin_scheme_host_port.port()); + auto emplaced_pair = storage_keys_with_non_opaque_origin_.emplace( + storage_key_origin, blink::StorageKey(non_opaque_origin)); return &emplaced_pair.first->second; } diff --git a/chromium_src/components/services/storage/dom_storage/local_storage_impl.h b/chromium_src/components/services/storage/dom_storage/local_storage_impl.h index 38b123afea12..a15ec75e406f 100644 --- a/chromium_src/components/services/storage/dom_storage/local_storage_impl.h +++ b/chromium_src/components/services/storage/dom_storage/local_storage_impl.h @@ -25,10 +25,10 @@ class LocalStorageImpl : public mojom::LocalStorageControl { // mojom::LocalStorageControl implementation: void BindStorageArea( - const url::Origin& origin, + const blink::StorageKey& storage_key, mojo::PendingReceiver receiver) override; void GetUsage(GetUsageCallback callback) override; - void DeleteStorage(const url::Origin& origin, + void DeleteStorage(const blink::StorageKey& storage_key, DeleteStorageCallback callback) override; void CleanUpStorage(CleanUpStorageCallback callback) override; void Flush(FlushCallback callback) override; @@ -38,16 +38,18 @@ class LocalStorageImpl : public mojom::LocalStorageControl { void ForceKeepSessionState() override; private: - const url::Origin* GetNonOpaqueOrigin(const url::Origin& origin, bool create); + const blink::StorageKey* GetStorageKeyWithNonOpaqueOrigin( + const blink::StorageKey& storage_key, + bool create); void ShutDownInMemoryStorage(base::OnceClosure callback); std::unique_ptr local_storage_; std::unique_ptr in_memory_local_storage_; mojo::Receiver control_receiver_{this}; - // LocalStorageImpl works only with non-opaque origins, that's why we use an - // opaque->non-opaque origin map. - std::map non_opaque_origins_; + // LocalStorageImpl works only with non-opaque origins, that's why we use a + // map of opaque origins to StorageKeys with non-opaque origins. + std::map storage_keys_with_non_opaque_origin_; base::WeakPtrFactory weak_ptr_factory_{this}; }; diff --git a/chromium_src/components/translate/core/browser/translate_manager_unittest.cc b/chromium_src/components/translate/core/browser/translate_manager_unittest.cc index a466b07005e3..27de087808c5 100644 --- a/chromium_src/components/translate/core/browser/translate_manager_unittest.cc +++ b/chromium_src/components/translate/core/browser/translate_manager_unittest.cc @@ -101,7 +101,7 @@ struct ProfilePrefRegistration { TranslatePrefs::RegisterProfilePrefs(prefs->registry()); // TODO(groby): Figure out RegisterProfilePrefs() should register this. prefs->registry()->RegisterBooleanPref( - prefs::kOfferTranslateEnabled, true, + translate::prefs::kOfferTranslateEnabled, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); } }; @@ -176,9 +176,9 @@ TEST_F(TranslateManagerTest, CanManuallyTranslate_WithoutAPIKey) { &mock_translate_ranker_, &mock_language_model_)); - prefs_.SetBoolean(prefs::kOfferTranslateEnabled, true); + prefs_.SetBoolean(translate::prefs::kOfferTranslateEnabled, true); ON_CALL(mock_translate_client_, IsTranslatableURL(GURL::EmptyGURL())) - .WillByDefault(Return(true)); + .WillByDefault(Return(true)); network_notifier_.SimulateOnline(); translate_manager_->GetLanguageState()->LanguageDetermined("de", true); @@ -198,9 +198,9 @@ TEST_F(TranslateManagerTest, CanManuallyTranslate_WithAPIKey) { &mock_translate_ranker_, &mock_language_model_)); - prefs_.SetBoolean(prefs::kOfferTranslateEnabled, true); + prefs_.SetBoolean(translate::prefs::kOfferTranslateEnabled, true); ON_CALL(mock_translate_client_, IsTranslatableURL(GURL::EmptyGURL())) - .WillByDefault(Return(true)); + .WillByDefault(Return(true)); network_notifier_.SimulateOnline(); translate_manager_->GetLanguageState()->LanguageDetermined("de", true); diff --git a/chromium_src/components/version_ui/version_handler_helper.cc b/chromium_src/components/version_ui/version_handler_helper.cc index 890dee4075a5..c83aaf3267eb 100644 --- a/chromium_src/components/version_ui/version_handler_helper.cc +++ b/chromium_src/components/version_ui/version_handler_helper.cc @@ -10,7 +10,7 @@ namespace version_ui { // Brave always shows full variations names instead of hashes. -std::unique_ptr GetVariationsList() { +base::Value GetVariationsList() { std::vector variations; base::FieldTrial::ActiveGroups active_groups; base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups); @@ -24,13 +24,11 @@ std::unique_ptr GetVariationsList() { variations.push_back(line); } - std::unique_ptr variations_list(new base::ListValue); - for (std::vector::const_iterator it = variations.begin(); - it != variations.end(); ++it) { - variations_list->AppendString(*it); - } + base::Value variations_list(base::Value::Type::LIST); + for (std::string& variation : variations) + variations_list.Append(std::move(variation)); - return std::move(variations_list); + return variations_list; } } // namespace version_ui diff --git a/chromium_src/content/browser/DEPS b/chromium_src/content/browser/DEPS index e1f56ac3f9c2..223d82e452eb 100644 --- a/chromium_src/content/browser/DEPS +++ b/chromium_src/content/browser/DEPS @@ -8,6 +8,7 @@ include_rules = [ "+content/public/browser", "+content/public/common", "+services/network/public/mojom/cookie_manager.mojom.h", + "+third_party/blink/public/common/storage_key", ] # Existing exceptions diff --git a/chromium_src/content/browser/tld_ephemeral_lifetime.cc b/chromium_src/content/browser/tld_ephemeral_lifetime.cc index 7ecc470860c7..546aa25a8876 100644 --- a/chromium_src/content/browser/tld_ephemeral_lifetime.cc +++ b/chromium_src/content/browser/tld_ephemeral_lifetime.cc @@ -10,6 +10,7 @@ #include "base/no_destructor.h" #include "content/browser/dom_storage/dom_storage_context_wrapper.h" #include "services/network/public/mojom/cookie_manager.mojom.h" +#include "third_party/blink/public/common/storage_key/storage_key.h" namespace content { @@ -50,7 +51,7 @@ TLDEphemeralLifetime::~TLDEphemeralLifetime() { for (const auto& opaque_origin : delegate_->TakeEphemeralStorageOpaqueOrigins(key_.second)) { storage_partition_->GetDOMStorageContext()->DeleteLocalStorage( - opaque_origin, base::DoNothing()); + blink::StorageKey(opaque_origin), base::DoNothing()); } if (!on_destroy_callbacks_.empty()) { diff --git a/chromium_src/ios/chrome/browser/DEPS b/chromium_src/ios/chrome/browser/DEPS index 06a5d80d29d5..9e70a967cbb7 100644 --- a/chromium_src/ios/chrome/browser/DEPS +++ b/chromium_src/ios/chrome/browser/DEPS @@ -2,6 +2,7 @@ include_rules = [ "+../../../../../../ios/chrome/browser/prefs", "+../../../../../../ios/chrome/browser/sync", "+ios/chrome/browser", + "+ios/public/provider/chrome/browser/app_distribution/app_distribution_api.h", "+components/component_updater", "+components/gcm_driver/gcm_driver.h", "+components/history/core/browser", diff --git a/chromium_src/ios/chrome/browser/application_context_impl.mm b/chromium_src/ios/chrome/browser/application_context_impl.mm index 01d562929dbf..b35e942b1615 100644 --- a/chromium_src/ios/chrome/browser/application_context_impl.mm +++ b/chromium_src/ios/chrome/browser/application_context_impl.mm @@ -36,7 +36,7 @@ #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.h" #include "ios/chrome/browser/chrome_paths.h" -#import "ios/chrome/browser/crash_report/breadcrumbs/application_breadcrumbs_logger.h" +#import "ios/chrome/browser/crash_report/breadcrumbs/application_breadcrumbs_logger_ios.h" #include "ios/chrome/browser/history/history_service_factory.h" #include "ios/chrome/browser/ios_chrome_io_thread.h" #include "ios/chrome/browser/policy/browser_policy_connector_ios.h" @@ -73,8 +73,7 @@ void BindNetworkChangeManagerReceiver( base::SequencedTaskRunner* local_state_task_runner, const base::CommandLine& command_line, const std::string& locale) - : local_state_task_runner_(local_state_task_runner), - was_last_shutdown_clean_(false) { + : local_state_task_runner_(local_state_task_runner) { DCHECK(!GetApplicationContext()); SetApplicationContext(this); @@ -134,9 +133,6 @@ void BindNetworkChangeManagerReceiver( void ApplicationContextImpl::OnAppEnterForeground() { DCHECK(thread_checker_.CalledOnValidThread()); - - PrefService* local_state = GetLocalState(); - local_state->SetBoolean(prefs::kLastSessionExitedCleanly, false); } void ApplicationContextImpl::OnAppEnterBackground() { @@ -155,16 +151,12 @@ void BindNetworkChangeManagerReceiver( if (browser_state_prefs) browser_state_prefs->CommitPendingWrite(); } - - PrefService* local_state = GetLocalState(); - local_state->SetBoolean(prefs::kLastSessionExitedCleanly, true); } bool ApplicationContextImpl::WasLastShutdownClean() { DCHECK(thread_checker_.CalledOnValidThread()); // Make sure the locale state is created as the file is initialized there. - ignore_result(GetLocalState()); - return was_last_shutdown_clean_; + return true; } PrefService* ApplicationContextImpl::GetLocalState() { @@ -341,12 +333,6 @@ void BindNetworkChangeManagerReceiver( std::max(std::min(net::kDefaultMaxSocketsPerProxyServer, 99), net::ClientSocketPoolManager::max_sockets_per_group( net::HttpNetworkSession::NORMAL_SOCKET_POOL))); - - // Register the shutdown state before anything changes it. - if (local_state_->HasPrefPath(prefs::kLastSessionExitedCleanly)) { - was_last_shutdown_clean_ = - local_state_->GetBoolean(prefs::kLastSessionExitedCleanly); - } } void ApplicationContextImpl::CreateGCMDriver() { diff --git a/chromium_src/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm b/chromium_src/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm index 9beb183b2dae..b03f0c9878c1 100644 --- a/chromium_src/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm +++ b/chromium_src/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm @@ -34,9 +34,9 @@ #include "components/version_info/version_info.h" #include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/chrome_paths.h" -#include "ios/chrome/browser/google/google_brand.h" #include "ios/chrome/browser/metrics/ios_chrome_stability_metrics_provider.h" #include "ios/chrome/common/channel_info.h" +#include "ios/public/provider/chrome/browser/app_distribution/app_distribution_api.h" #include "ios/web/public/thread/web_thread.h" #include "services/network/public/cpp/shared_url_loader_factory.h" @@ -117,7 +117,8 @@ void DeleteFileMetrics() { } bool IOSChromeMetricsServiceClient::GetBrand(std::string* brand_code) { - return ios::google_brand::GetBrand(brand_code); + brand_code->assign(ios::provider::GetBrandCode()); + return true; } metrics::SystemProfileProto::Channel @@ -157,10 +158,6 @@ void DeleteFileMetrics() { return metrics::GetUploadInterval(metrics::ShouldUseCellularUploadInterval()); } -void IOSChromeMetricsServiceClient::OnRendererProcessCrash() { - stability_metrics_provider_->LogRendererCrash(); -} - void IOSChromeMetricsServiceClient::WebStateDidStartLoading( web::WebState* web_state) { metrics_service_->OnApplicationNotIdle(); @@ -176,6 +173,8 @@ void DeleteFileMetrics() { } void IOSChromeMetricsServiceClient::RegisterMetricsServiceProviders() { + // error: private field 'stability_metrics_provider_' is not used + (void)stability_metrics_provider_; DeleteFileMetrics(); } diff --git a/chromium_src/net/cookies/brave_canonical_cookie_unittest.cc b/chromium_src/net/cookies/brave_canonical_cookie_unittest.cc index 3ad0426ff79d..3a80291272ce 100644 --- a/chromium_src/net/cookies/brave_canonical_cookie_unittest.cc +++ b/chromium_src/net/cookies/brave_canonical_cookie_unittest.cc @@ -36,17 +36,20 @@ TEST(BraveCanonicalCookieTest, SetMaxExpiration) { GURL url("https://www.example.com/test"); std::unique_ptr cookie(CanonicalCookie::Create( - url, max_expires_date_cookie, creation_time, absl::nullopt)); + url, max_expires_date_cookie, creation_time, + /*server_time=*/absl::nullopt, /*cookie_partition_key=*/absl::nullopt)); EXPECT_TRUE(cookie.get()); EXPECT_EQ(cookie->ExpiryDate(), creation_time + kMaxCookieExpiration); cookie = CanonicalCookie::Create(url, max_age_cookie, creation_time, - absl::nullopt); + /*server_time=*/absl::nullopt, + /*cookie_partition_key=*/absl::nullopt); EXPECT_TRUE(cookie.get()); EXPECT_EQ(cookie->ExpiryDate(), creation_time + kMaxCookieExpiration); cookie = CanonicalCookie::Create(url, max_expires_and_max_age_cookie, - creation_time, absl::nullopt); + creation_time, /*server_time=*/absl::nullopt, + /*cookie_partition_key=*/absl::nullopt); EXPECT_TRUE(cookie.get()); EXPECT_EQ(cookie->ExpiryDate(), creation_time + kMaxCookieExpiration); } @@ -55,7 +58,8 @@ TEST(BraveCanonicalCookieTest, AllowShorterThanMaxExpiration) { GURL url("https://www.example.com/test"); // Short-lived cookies get to keep their shorter expiration. std::unique_ptr cookie = CanonicalCookie::Create( - url, short_expiration_cookie, creation_time, absl::nullopt); + url, short_expiration_cookie, creation_time, + /*server_time=*/absl::nullopt, /*cookie_partition_key=*/absl::nullopt); EXPECT_TRUE(cookie.get()); EXPECT_EQ(cookie->ExpiryDate(), creation_time + TimeDelta::FromDays(2)); } @@ -64,8 +68,9 @@ TEST(BraveCanonicalCookieTest, SetHTTPOnlyMaxExpiration) { GURL url("https://www.example.com/test"); // HTTP cookies with 'httponly' work as expected. - std::unique_ptr cookie = - CanonicalCookie::Create(url, cookie_line5, creation_time, absl::nullopt); + std::unique_ptr cookie = CanonicalCookie::Create( + url, cookie_line5, creation_time, /*server_time=*/absl::nullopt, + /*cookie_partition_key=*/absl::nullopt); EXPECT_TRUE(cookie.get()); EXPECT_EQ(cookie->ExpiryDate(), creation_time + kMaxCookieExpiration); } @@ -76,7 +81,8 @@ TEST(BraveCanonicalCookieTest, NoExpirationCookie) { base::Time creation_time = base::Time::Now(); std::unique_ptr cookie(CanonicalCookie::Create( - url, no_expiration_cookie, creation_time, absl::nullopt)); + url, no_expiration_cookie, creation_time, /*server_time=*/absl::nullopt, + /*cookie_partition_key=*/absl::nullopt)); EXPECT_TRUE(cookie.get()); EXPECT_EQ(cookie->IsPersistent(), false); } diff --git a/chromium_src/services/network/restricted_cookie_manager.cc b/chromium_src/services/network/restricted_cookie_manager.cc index d47a24a93e54..e4bac4f5de66 100644 --- a/chromium_src/services/network/restricted_cookie_manager.cc +++ b/chromium_src/services/network/restricted_cookie_manager.cc @@ -37,7 +37,7 @@ net::CookieOptions RestrictedCookieManager::MakeOptionsForSet( const GURL& url, const net::SiteForCookies& site_for_cookies, const net::IsolationInfo& isolation_info, - const CookieSettings* cookie_settings, + const CookieSettings& cookie_settings, const net::CookieAccessDelegate* cookie_access_delegate) const { net::CookieOptions cookie_options = ::network::MakeOptionsForSet(role, url, site_for_cookies, isolation_info, @@ -52,7 +52,7 @@ net::CookieOptions RestrictedCookieManager::MakeOptionsForGet( const GURL& url, const net::SiteForCookies& site_for_cookies, const net::IsolationInfo& isolation_info, - const CookieSettings* cookie_settings, + const CookieSettings& cookie_settings, const net::CookieAccessDelegate* cookie_access_delegate) const { net::CookieOptions cookie_options = ::network::MakeOptionsForGet(role, url, site_for_cookies, isolation_info, diff --git a/chromium_src/services/network/restricted_cookie_manager.h b/chromium_src/services/network/restricted_cookie_manager.h index 1b1e5b44f8de..46cb246b9867 100644 --- a/chromium_src/services/network/restricted_cookie_manager.h +++ b/chromium_src/services/network/restricted_cookie_manager.h @@ -18,13 +18,13 @@ mojom::RestrictedCookieManagerRole role, const GURL& url, \ const net::SiteForCookies& site_for_cookies, \ const net::IsolationInfo& isolation_info, \ - const CookieSettings* cookie_settings, \ + const CookieSettings& cookie_settings, \ const net::CookieAccessDelegate* cookie_access_delegate) const; \ net::CookieOptions MakeOptionsForGet( \ mojom::RestrictedCookieManagerRole role, const GURL& url, \ const net::SiteForCookies& site_for_cookies, \ const net::IsolationInfo& isolation_info, \ - const CookieSettings* cookie_settings, \ + const CookieSettings& cookie_settings, \ const net::CookieAccessDelegate* cookie_access_delegate) const; \ void RemoveChangeListener diff --git a/chromium_src/third_party/blink/common/DEPS b/chromium_src/third_party/blink/common/DEPS index f5f9eace597f..6c19452e7371 100644 --- a/chromium_src/third_party/blink/common/DEPS +++ b/chromium_src/third_party/blink/common/DEPS @@ -1,6 +1,5 @@ include_rules = [ "+../../../../../../third_party/blink/common/client_hints", - "+../../../../../../third_party/blink/common/loader", "+third_party/blink/common", - "+third_party/blink/public/common", + "+third_party/blink/public/common/client_hints", ] diff --git a/chromium_src/third_party/blink/common/client_hints/enabled_client_hints.cc b/chromium_src/third_party/blink/common/client_hints/enabled_client_hints.cc new file mode 100644 index 000000000000..936840dc72f0 --- /dev/null +++ b/chromium_src/third_party/blink/common/client_hints/enabled_client_hints.cc @@ -0,0 +1,21 @@ +/* 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 "third_party/blink/public/common/client_hints/enabled_client_hints.h" + +#define SetIsEnabled SetIsEnabled_Unused + +#include "../../../../../../third_party/blink/common/client_hints/enabled_client_hints.cc" + +#undef SetIsEnabled + +namespace blink { + +void EnabledClientHints::SetIsEnabled(const WebClientHintsType type, + const bool should_send) { + enabled_types_[static_cast(type)] = false; +} + +} // namespace blink diff --git a/chromium_src/third_party/blink/public/DEPS b/chromium_src/third_party/blink/public/DEPS index 8cc8ac3f1046..85e77272d951 100644 --- a/chromium_src/third_party/blink/public/DEPS +++ b/chromium_src/third_party/blink/public/DEPS @@ -1,7 +1,5 @@ include_rules = [ - "+../../../../../../third_party/blink/common/client_hints", - "+../../../../../../third_party/blink/common/loader", + "+../../../../../../../third_party/blink/public/common/client_hints", "+../../../../../../third_party/blink/public/platform", - "+services/network/public/mojom", "+third_party/blink/public", ] diff --git a/chromium_src/third_party/blink/public/common/client_hints/enabled_client_hints.h b/chromium_src/third_party/blink/public/common/client_hints/enabled_client_hints.h new file mode 100644 index 000000000000..08f00b6f0790 --- /dev/null +++ b/chromium_src/third_party/blink/public/common/client_hints/enabled_client_hints.h @@ -0,0 +1,25 @@ +/* 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_THIRD_PARTY_BLINK_PUBLIC_COMMON_CLIENT_HINTS_ENABLED_CLIENT_HINTS_H_ +#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_PUBLIC_COMMON_CLIENT_HINTS_ENABLED_CLIENT_HINTS_H_ + +// We can't do a `#define SetIsEnabled SetIsEnabled_Unused` because there are +// two different signatures for that method, so we redefine IsEnabled() instead +// and make the most of that to squeeze those methods there instead. +// The above comment is not applicable right now because the upstream change +// adding the second signature has been temporarily reverted. Leaving the above +// comment here for when they reland. +#define IsEnabled \ + IsEnabled(network::mojom::WebClientHintsType type) const; \ + void SetIsEnabled_Unused(network::mojom::WebClientHintsType type, \ + bool should_send); \ + bool IsEnabled_Unused + +#include "../../../../../../../third_party/blink/public/common/client_hints/enabled_client_hints.h" + +#undef IsEnabled + +#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_PUBLIC_COMMON_CLIENT_HINTS_ENABLED_CLIENT_HINTS_H_ diff --git a/chromium_src/third_party/blink/public/platform/disable_client_hints_browsertest.cc b/chromium_src/third_party/blink/public/platform/disable_client_hints_browsertest.cc index f79f2600a2f0..80100e9d489b 100644 --- a/chromium_src/third_party/blink/public/platform/disable_client_hints_browsertest.cc +++ b/chromium_src/third_party/blink/public/platform/disable_client_hints_browsertest.cc @@ -19,6 +19,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "third_party/blink/public/common/client_hints/client_hints.h" +#include "third_party/blink/public/common/features.h" const char kClientHints[] = "/ch.html"; @@ -50,10 +51,10 @@ class ClientHintsBrowserTest : public InProcessBrowserTest, if (IsLangClientHintHeaderEnabled()) { // Test that even with Lang CH feature enabled, there is no header. scoped_feature_list_.InitAndEnableFeature( - features::kLangClientHintHeader); + blink::features::kLangClientHintHeader); } else { scoped_feature_list_.InitAndDisableFeature( - features::kLangClientHintHeader); + blink::features::kLangClientHintHeader); } InProcessBrowserTest::SetUp(); } @@ -90,8 +91,9 @@ class ClientHintsBrowserTest : public InProcessBrowserTest, }; IN_PROC_BROWSER_TEST_P(ClientHintsBrowserTest, ClientHintsDisabled) { - EXPECT_EQ(IsLangClientHintHeaderEnabled(), - base::FeatureList::IsEnabled(features::kLangClientHintHeader)); + EXPECT_EQ( + IsLangClientHintHeaderEnabled(), + base::FeatureList::IsEnabled(blink::features::kLangClientHintHeader)); ui_test_utils::NavigateToURL(browser(), client_hints_url()); EXPECT_EQ(0u, count_client_hints_headers_seen()); } diff --git a/chromium_src/third_party/blink/public/platform/web_client_hints_type.h b/chromium_src/third_party/blink/public/platform/web_client_hints_type.h deleted file mode 100644 index 331ea97f17d5..000000000000 --- a/chromium_src/third_party/blink/public/platform/web_client_hints_type.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (c) 2019 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_CLIENT_HINTS_TYPE_H_ -#define BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_CLIENT_HINTS_TYPE_H_ - -#include "services/network/public/mojom/web_client_hints_types.mojom-shared.h" - -namespace blink { - -// WebEnabledClientHints stores all the client hints along with whether the hint -// is enabled or not. -struct WebEnabledClientHints { - WebEnabledClientHints() = default; - - bool IsEnabled(network::mojom::WebClientHintsType type) const { - return false; - } - - void SetIsEnabled(network::mojom::WebClientHintsType type, bool should_send) { - enabled_types_[static_cast(type)] = false; - } - - bool enabled_types_[static_cast( - network::mojom::WebClientHintsType::kMaxValue) + - 1] = {}; -}; - -} // namespace blink - -#endif // BRAVE_CHROMIUM_SRC_THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_CLIENT_HINTS_TYPE_H_ diff --git a/chromium_src/third_party/blink/renderer/DEPS b/chromium_src/third_party/blink/renderer/DEPS index f0d9860efd0d..11b049a5a38b 100644 --- a/chromium_src/third_party/blink/renderer/DEPS +++ b/chromium_src/third_party/blink/renderer/DEPS @@ -17,6 +17,7 @@ include_rules = [ "+../../../../../../../third_party/blink/renderer/modules/webaudio", "+../../../../../../../third_party/blink/renderer/modules/webgl", "+../../../../../../../../third_party/blink/renderer/modules/canvas/canvas2d", + "+../../../../../../../third_party/blink/renderer/platform/exported", "+../../../../../../../third_party/blink/renderer/platform/graphics", "+mojo/public/cpp/bindings", "+services/network/public/mojom", diff --git a/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.h b/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.h index 3c72a42832d9..d3c00e029e33 100644 --- a/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.h +++ b/chromium_src/third_party/blink/renderer/core/execution_context/execution_context.h @@ -18,11 +18,8 @@ class WebContentSettingsClient; using blink::ExecutionContext; using blink::GarbageCollected; -using blink::HeapObjectHeader; using blink::MakeGarbageCollected; using blink::Supplement; -using blink::TraceDescriptor; -using blink::TraceTrait; namespace brave { diff --git a/chromium_src/third_party/blink/renderer/core/frame/navigator_device_memory.cc b/chromium_src/third_party/blink/renderer/core/frame/navigator_device_memory.cc index a2149346cef8..08ee065f13a7 100644 --- a/chromium_src/third_party/blink/renderer/core/frame/navigator_device_memory.cc +++ b/chromium_src/third_party/blink/renderer/core/frame/navigator_device_memory.cc @@ -24,8 +24,8 @@ float FarbleDeviceMemory(blink::ExecutionContext* context) { return true_value; std::vector valid_values = {0.25, 0.5, 1.0, 2.0, 4.0, 8.0}; - int min_farbled_index; - int max_farbled_index; + size_t min_farbled_index; + size_t max_farbled_index; if (settings->GetBraveFarblingLevel() == BraveFarblingLevel::MAXIMUM) { // If anti-fingerprinting is at maximum, select a pseudo-random valid value // based on domain + sesson key. @@ -37,7 +37,7 @@ float FarbleDeviceMemory(blink::ExecutionContext* context) { // which case just return that). auto true_it = std::find(valid_values.begin(), valid_values.end(), true_value); - int true_index; + size_t true_index; // Get index into |valid_values| of the true value. If it's not found, // assume the last index. (This should not happen, but it allows us to // fail closed instead of failing open.) diff --git a/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc b/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc index 00caab7ba084..f1b0531b39ae 100644 --- a/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc +++ b/chromium_src/third_party/blink/renderer/modules/plugins/dom_plugin_array.cc @@ -103,11 +103,14 @@ void FarblePlugins(DOMPluginArray* owner, BraveSessionCache::From(*(frame->DomWindow())) .GenerateRandomString("PLUGIN_1_DESCRIPTION", 32), 0, false); + Vector fake_plugin_extensions_1{ + BraveSessionCache::From(*(frame->DomWindow())) + .GenerateRandomString("PLUGIN_1_EXTENSION", 3)}; auto* fake_mime_info_1 = MakeGarbageCollected( "", BraveSessionCache::From(*(frame->DomWindow())) .GenerateRandomString("MIME_1_DESCRIPTION", 32), - *fake_plugin_info_1); + *fake_plugin_info_1, fake_plugin_extensions_1); fake_plugin_info_1->AddMimeType(fake_mime_info_1); auto* fake_dom_plugin_1 = MakeGarbageCollected( frame->DomWindow(), *fake_plugin_info_1); @@ -121,11 +124,14 @@ void FarblePlugins(DOMPluginArray* owner, BraveSessionCache::From(*(frame->DomWindow())) .GenerateRandomString("PLUGIN_2_DESCRIPTION", 31), 0, false); + Vector fake_plugin_extensions_2{ + BraveSessionCache::From(*(frame->DomWindow())) + .GenerateRandomString("PLUGIN_2_EXTENSION", 3)}; auto* fake_mime_info_2 = MakeGarbageCollected( "", BraveSessionCache::From(*(frame->DomWindow())) .GenerateRandomString("MIME_2_DESCRIPTION", 32), - *fake_plugin_info_2); + *fake_plugin_info_2, fake_plugin_extensions_2); fake_plugin_info_2->AddMimeType(fake_mime_info_2); auto* fake_dom_plugin_2 = MakeGarbageCollected( frame->DomWindow(), *fake_plugin_info_2); diff --git a/chromium_src/ui/views/controls/focus_ring.cc b/chromium_src/ui/views/controls/focus_ring.cc index ecd819570d75..684ccae6b427 100644 --- a/chromium_src/ui/views/controls/focus_ring.cc +++ b/chromium_src/ui/views/controls/focus_ring.cc @@ -20,6 +20,11 @@ // color, we use this micro-theme for the FocusRingView. namespace { +ui::NativeTheme::ColorId ColorIdForValidity(bool valid) { + return valid ? ui::NativeTheme::kColorId_FocusedBorderColor + : ui::NativeTheme::kColorId_AlertSeverityHigh; +} + class FocusRingTheme { public: SkColor GetSystemColor(int id) { diff --git a/common/BUILD.gn b/common/BUILD.gn index 96ad4575d3a4..1458f9dd312a 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -185,21 +185,6 @@ 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 deleted file mode 100644 index af3a43b2bd77..000000000000 --- a/common/brave_paths_unittest.cc +++ /dev/null @@ -1,16 +0,0 @@ -/* 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/common/importer/chrome_importer_utils.cc b/common/importer/chrome_importer_utils.cc index e7d9232ee055..75999d49fc88 100644 --- a/common/importer/chrome_importer_utils.cc +++ b/common/importer/chrome_importer_utils.cc @@ -147,7 +147,7 @@ std::vector GetImportableListFromChromeExtensionsList( DCHECK(extensions_list.is_dict()); std::vector extensions; - for (const auto& item : extensions_list.DictItems()) { + for (const auto item : extensions_list.DictItems()) { // Only import if type is extension, it's came from webstore and it's not // installed by default. if (item.second.FindBoolKey("was_installed_by_default").value_or(true)) diff --git a/common/resource_bundle_helper.cc b/common/resource_bundle_helper.cc index 51d22800b4bc..9131e1a8a15e 100644 --- a/common/resource_bundle_helper.cc +++ b/common/resource_bundle_helper.cc @@ -42,7 +42,8 @@ base::FilePath GetResourcesPakFilePath() { #endif // OS_ANDROID #if !defined(OS_ANDROID) -base::FilePath GetScaledResourcesPakFilePath(ui::ScaleFactor scale_factor) { +base::FilePath GetScaledResourcesPakFilePath( + ui::ResourceScaleFactor scale_factor) { DCHECK(scale_factor == ui::SCALE_FACTOR_100P || scale_factor == ui::SCALE_FACTOR_200P); diff --git a/components/api_request_helper/DEPS b/components/api_request_helper/DEPS index 72d005d3d663..186a324c350a 100644 --- a/components/api_request_helper/DEPS +++ b/components/api_request_helper/DEPS @@ -1,4 +1,5 @@ include_rules = [ "+net", "+services/network/public/cpp", + "+services/network/public/mojom", ] diff --git a/components/api_request_helper/api_request_helper.cc b/components/api_request_helper/api_request_helper.cc index 2d7a2d8b418f..a2475d6e5b63 100644 --- a/components/api_request_helper/api_request_helper.cc +++ b/components/api_request_helper/api_request_helper.cc @@ -11,6 +11,7 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/mojom/url_response_head.mojom.h" namespace api_request_helper { diff --git a/components/autofill_payments_strings.grdp b/components/autofill_payments_strings.grdp index 1d4709c22a0e..0e302a57dd79 100644 --- a/components/autofill_payments_strings.grdp +++ b/components/autofill_payments_strings.grdp @@ -498,6 +498,12 @@ View your virtual card number + + Click to copy + + + Copied + Virtual card diff --git a/components/binance/browser/binance_service.cc b/components/binance/browser/binance_service.cc index 55294bdc098c..b5cc4df31227 100644 --- a/components/binance/browser/binance_service.cc +++ b/components/binance/browser/binance_service.cc @@ -37,6 +37,7 @@ #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" +#include "services/network/public/mojom/url_response_head.mojom.h" namespace { diff --git a/components/brave_ads/browser/ads_service_impl.cc b/components/brave_ads/browser/ads_service_impl.cc index abb8595526c3..21ef4eb97fef 100644 --- a/components/brave_ads/browser/ads_service_impl.cc +++ b/components/brave_ads/browser/ads_service_impl.cc @@ -13,6 +13,7 @@ #include "base/bind.h" #include "base/command_line.h" #include "base/containers/flat_map.h" +#include "base/cxx17_backports.h" #include "base/debug/dump_without_crashing.h" #include "base/feature_list.h" #include "base/files/file_path.h" @@ -24,7 +25,6 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/metrics/field_trial_params.h" -#include "base/numerics/ranges.h" #include "base/path_service.h" #include "base/sequenced_task_runner.h" #include "base/strings/string_number_conversions.h" @@ -549,9 +549,9 @@ int64_t AdsServiceImpl::GetAdsPerHour() const { ads::kDefaultAdNotificationsPerHour); } - return base::ClampToRange( - ads_per_hour, static_cast(ads::kMinimumAdNotificationsPerHour), - static_cast(ads::kMaximumAdNotificationsPerHour)); + return base::clamp(ads_per_hour, + static_cast(ads::kMinimumAdNotificationsPerHour), + static_cast(ads::kMaximumAdNotificationsPerHour)); } bool AdsServiceImpl::ShouldAllowAdsSubdivisionTargeting() const { diff --git a/components/brave_referrals/browser/brave_referrals_service.cc b/components/brave_referrals/browser/brave_referrals_service.cc index 18da493a4592..5420bfe2dfce 100644 --- a/components/brave_referrals/browser/brave_referrals_service.cc +++ b/components/brave_referrals/browser/brave_referrals_service.cc @@ -43,6 +43,7 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #if defined(OS_ANDROID) #include "chrome/browser/android/service_tab_launcher.h" diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/browser/rewards_service_impl.cc index 39db30a72c69..ade7aac8a89e 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/browser/rewards_service_impl.cc @@ -79,6 +79,7 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image.h" #include "url/gurl.h" @@ -2831,7 +2832,7 @@ std::string RewardsServiceImpl::GetLegacyWallet() { auto* dict = profile_->GetPrefs()->GetDictionary(prefs::kExternalWallets); std::string json; - for (const auto& it : dict->DictItems()) { + for (auto it : dict->DictItems()) { base::JSONWriter::Write(std::move(it.second), &json); } diff --git a/components/brave_wallet/browser/BUILD.gn b/components/brave_wallet/browser/BUILD.gn index 46aefe06c7eb..03fc0edf8ce4 100644 --- a/components/brave_wallet/browser/BUILD.gn +++ b/components/brave_wallet/browser/BUILD.gn @@ -78,7 +78,6 @@ static_library("browser") { deps = [ "//base", - "//base/util/values:values_util", "//brave/components/api_request_helper", "//brave/components/brave_component_updater/browser", "//brave/components/brave_wallet/browser:ethereum_permission_utils", diff --git a/components/brave_wallet/browser/asset_ratio_response_parser.cc b/components/brave_wallet/browser/asset_ratio_response_parser.cc index 063bc59e8cc9..1e40a0f7786c 100644 --- a/components/brave_wallet/browser/asset_ratio_response_parser.cc +++ b/components/brave_wallet/browser/asset_ratio_response_parser.cc @@ -156,14 +156,15 @@ bool ParseAssetPriceHistory( const auto& date_value = *it; const auto& price_value = *(++it); - double date_dbl; - if (!date_value.GetAsDouble(&date_dbl)) { + // Check whether date_value is convertible to a double first. + if (!date_value.is_double() && !date_value.is_int()) return false; - } - double price; - if (!price_value.GetAsDouble(&price)) { + double date_dbl = date_value.GetDouble(); + + // Check whether price_value is convertible to a double first. + if (!price_value.is_double() && !price_value.is_int()) return false; - } + double price = price_value.GetDouble(); base::Time date = base::Time::FromJsTime(date_dbl); auto asset_time_price = brave_wallet::mojom::AssetTimePrice::New(); diff --git a/components/brave_wallet/browser/erc_token_list_parser.cc b/components/brave_wallet/browser/erc_token_list_parser.cc index 267559c20d89..1f03c0ce386a 100644 --- a/components/brave_wallet/browser/erc_token_list_parser.cc +++ b/components/brave_wallet/browser/erc_token_list_parser.cc @@ -69,7 +69,7 @@ bool ParseTokenList(const std::string& json, return false; } - for (const auto& erc_token_value_pair : response_dict->DictItems()) { + for (const auto erc_token_value_pair : response_dict->DictItems()) { auto erc_token = brave_wallet::mojom::ERCToken::New(); erc_token->contract_address = erc_token_value_pair.first; const base::DictionaryValue* erc_token_value; diff --git a/components/brave_wallet/browser/eth_tx_state_manager.cc b/components/brave_wallet/browser/eth_tx_state_manager.cc index 7ad5d3e8f637..c63a75c10382 100644 --- a/components/brave_wallet/browser/eth_tx_state_manager.cc +++ b/components/brave_wallet/browser/eth_tx_state_manager.cc @@ -8,8 +8,8 @@ #include #include "base/guid.h" +#include "base/json/values_util.h" #include "base/logging.h" -#include "base/util/values/values_util.h" #include "base/values.h" #include "brave/components/brave_wallet/browser/brave_wallet_utils.h" #include "brave/components/brave_wallet/browser/eip1559_transaction.h" @@ -65,9 +65,9 @@ base::Value EthTxStateManager::TxMetaToValue(const TxMeta& meta) { dict.SetIntKey("status", static_cast(meta.status)); dict.SetStringKey("from", meta.from.ToHex()); dict.SetStringKey("last_gas_price", Uint256ValueToHex(meta.last_gas_price)); - dict.SetKey("created_time", util::TimeToValue(meta.created_time)); - dict.SetKey("submitted_time", util::TimeToValue(meta.submitted_time)); - dict.SetKey("confirmed_time", util::TimeToValue(meta.confirmed_time)); + dict.SetKey("created_time", base::TimeToValue(meta.created_time)); + dict.SetKey("submitted_time", base::TimeToValue(meta.submitted_time)); + dict.SetKey("confirmed_time", base::TimeToValue(meta.confirmed_time)); dict.SetKey("tx_receipt", TransactionReceiptToValue(meta.tx_receipt)); dict.SetStringKey("tx_hash", meta.tx_hash); dict.SetKey("tx", meta.tx->ToValue()); @@ -136,7 +136,7 @@ std::unique_ptr EthTxStateManager::ValueToTxMeta( if (!created_time) return nullptr; absl::optional created_time_from_value = - util::ValueToTime(created_time); + base::ValueToTime(created_time); if (!created_time_from_value) return nullptr; meta->created_time = *created_time_from_value; @@ -145,7 +145,7 @@ std::unique_ptr EthTxStateManager::ValueToTxMeta( if (!submitted_time) return nullptr; absl::optional submitted_time_from_value = - util::ValueToTime(submitted_time); + base::ValueToTime(submitted_time); if (!submitted_time_from_value) return nullptr; meta->submitted_time = *submitted_time_from_value; @@ -154,7 +154,7 @@ std::unique_ptr EthTxStateManager::ValueToTxMeta( if (!confirmed_time) return nullptr; absl::optional confirmed_time_from_value = - util::ValueToTime(confirmed_time); + base::ValueToTime(confirmed_time); if (!confirmed_time_from_value) return nullptr; meta->confirmed_time = *confirmed_time_from_value; diff --git a/components/content_settings/core/browser/brave_content_settings_utils.cc b/components/content_settings/core/browser/brave_content_settings_utils.cc index ca18f3d5ce85..ef782382595b 100644 --- a/components/content_settings/core/browser/brave_content_settings_utils.cc +++ b/components/content_settings/core/browser/brave_content_settings_utils.cc @@ -121,10 +121,9 @@ std::string GetShieldsSettingUserPrefsPath(const std::string& name) { // timestamp exists. base::Time GetTimeStampFromDictionary(const base::DictionaryValue* dictionary, const char* key) { - std::string timestamp_str; - dictionary->GetStringWithoutPathExpansion(key, ×tamp_str); int64_t timestamp = 0; - base::StringToInt64(timestamp_str, ×tamp); + if (const std::string* timestamp_str = dictionary->FindStringKey(key)) + base::StringToInt64(*timestamp_str, ×tamp); base::Time last_modified = base::Time::FromDeltaSinceWindowsEpoch( base::TimeDelta::FromMicroseconds(timestamp)); return last_modified; diff --git a/components/content_settings/renderer/brave_content_settings_agent_impl_autoplay_browsertest.cc b/components/content_settings/renderer/brave_content_settings_agent_impl_autoplay_browsertest.cc index d3532a381d93..bb21e5aebe4b 100644 --- a/components/content_settings/renderer/brave_content_settings_agent_impl_autoplay_browsertest.cc +++ b/components/content_settings/renderer/brave_content_settings_agent_impl_autoplay_browsertest.cc @@ -36,7 +36,7 @@ class MockContentSettingsManagerImpl : public mojom::ContentSettingsManager { void AllowStorageAccess(int32_t render_frame_id, StorageType storage_type, const url::Origin& origin, - const GURL& site_for_cookies, + const ::net::SiteForCookies& site_for_cookies, const url::Origin& top_frame_origin, base::OnceCallback callback) override {} diff --git a/components/crypto_dot_com/browser/crypto_dot_com_service.cc b/components/crypto_dot_com/browser/crypto_dot_com_service.cc index d080193e25a3..3e0d3b1ea0fe 100644 --- a/components/crypto_dot_com/browser/crypto_dot_com_service.cc +++ b/components/crypto_dot_com/browser/crypto_dot_com_service.cc @@ -29,6 +29,7 @@ #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" +#include "services/network/public/mojom/url_response_head.mojom.h" namespace { diff --git a/components/ftx/browser/ftx_service.cc b/components/ftx/browser/ftx_service.cc index d8e4f3123a1f..519455587ee6 100644 --- a/components/ftx/browser/ftx_service.cc +++ b/components/ftx/browser/ftx_service.cc @@ -29,6 +29,7 @@ #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" +#include "services/network/public/mojom/url_response_head.mojom.h" namespace { diff --git a/components/gemini/browser/gemini_service.cc b/components/gemini/browser/gemini_service.cc index 0e00dafb0d19..60b39dfd9d86 100644 --- a/components/gemini/browser/gemini_service.cc +++ b/components/gemini/browser/gemini_service.cc @@ -36,6 +36,7 @@ #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" +#include "services/network/public/mojom/url_response_head.mojom.h" namespace { const char oauth_host[] = "exchange.gemini.com"; diff --git a/components/greaselion/browser/greaselion_download_service.cc b/components/greaselion/browser/greaselion_download_service.cc index d7002b9a527e..2b158174fd7b 100644 --- a/components/greaselion/browser/greaselion_download_service.cc +++ b/components/greaselion/browser/greaselion_download_service.cc @@ -92,7 +92,7 @@ void GreaselionRule::Parse(base::DictionaryValue* preconditions_value, const base::FilePath& messages_value, const base::FilePath& resource_dir) { if (preconditions_value) { - for (const auto& kv : preconditions_value->DictItems()) { + for (const auto kv : preconditions_value->DictItems()) { GreaselionPreconditionValue condition = ParsePrecondition(kv.second); if (kv.first == kRewards) { preconditions_.rewards_enabled = condition; diff --git a/components/history_clusters_strings.grdp b/components/history_clusters_strings.grdp index b1471958a2f5..fad557383e97 100644 --- a/components/history_clusters_strings.grdp +++ b/components/history_clusters_strings.grdp @@ -1,8 +1,6 @@ - + + - - Memories - diff --git a/components/ipfs/import/ipfs_import_worker_base.cc b/components/ipfs/import/ipfs_import_worker_base.cc index 8f68b20d8912..4e38f9f120c9 100644 --- a/components/ipfs/import/ipfs_import_worker_base.cc +++ b/components/ipfs/import/ipfs_import_worker_base.cc @@ -37,6 +37,7 @@ #include "net/http/http_status_code.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/blink/public/mojom/blob/serialized_blob.mojom.h" #include "url/gurl.h" diff --git a/components/ipfs/import/ipfs_link_import_worker.cc b/components/ipfs/import/ipfs_link_import_worker.cc index 67c385bb3ce0..94fc73b3f8d2 100644 --- a/components/ipfs/import/ipfs_link_import_worker.cc +++ b/components/ipfs/import/ipfs_link_import_worker.cc @@ -18,6 +18,7 @@ #include "net/http/http_status_code.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "url/gurl.h" namespace { diff --git a/components/ipfs/ipfs_service.cc b/components/ipfs/ipfs_service.cc index 1f838c76550c..83703d73c73b 100644 --- a/components/ipfs/ipfs_service.cc +++ b/components/ipfs/ipfs_service.cc @@ -40,6 +40,7 @@ #include "net/http/http_status_code.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_IPFS_LOCAL_NODE) diff --git a/components/ipfs/keys/ipns_keys_manager.cc b/components/ipfs/keys/ipns_keys_manager.cc index 2c1842892e7c..e3f5effce145 100644 --- a/components/ipfs/keys/ipns_keys_manager.cc +++ b/components/ipfs/keys/ipns_keys_manager.cc @@ -24,6 +24,7 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/mojom/url_response_head.mojom.h" #include "storage/browser/blob/blob_data_builder.h" #include "storage/browser/blob/blob_data_handle.h" diff --git a/components/management_strings.grdp b/components/management_strings.grdp index 6293365e2e8f..ef9384046f1c 100644 --- a/components/management_strings.grdp +++ b/components/management_strings.grdp @@ -46,12 +46,22 @@ - + + Your administrator can change your browser setup remotely. Activity on this device may also be managed outside of Brave. <a target="_blank" href="$1">Learn more</a> - - - This browser is not managed by a company or other organization. Activity on this device may be managed outside of Brave. <a target="_blank" href="$1">Learn more</a> - + + + This browser is not managed by a company or other organization. Activity on this device may be managed outside of Brave. <a target="_blank" href="$1">Learn more</a> + + + + + Your administrator can change your browser setup remotely. Activity on this device may also be managed outside of Brave. <a target="_blank" href="$1">Learn more</a> + + + This browser is not managed by a company or other organization. Activity on this device may be managed outside of Brave. <a target="_blank" href="$1">Learn more</a> + + diff --git a/components/omnibox_strings.grdp b/components/omnibox_strings.grdp index 079a6e6bb5f2..04c0f389d7bd 100644 --- a/components/omnibox_strings.grdp +++ b/components/omnibox_strings.grdp @@ -93,6 +93,19 @@ $112/31/2018 - $2Google Docs + + + + Accuracy Check + + + + + Accuracy check + + + + diff --git a/components/omnibox_strings_override.grdp b/components/omnibox_strings_override.grdp index 342550097c2f..7b78c9984f1c 100644 --- a/components/omnibox_strings_override.grdp +++ b/components/omnibox_strings_override.grdp @@ -13,6 +13,14 @@ + + + + + + + + Open Private window diff --git a/components/p3a/brave_p3a_log_store.h b/components/p3a/brave_p3a_log_store.h index 29e0ae62eaca..ddbcdc40c08f 100644 --- a/components/p3a/brave_p3a_log_store.h +++ b/components/p3a/brave_p3a_log_store.h @@ -39,8 +39,7 @@ class BraveP3ALogStore : public metrics::LogStore { BraveP3ALogStore(Delegate* delegate, PrefService* local_state); - // TODO(iefremov): Make parent destructor virtual? - virtual ~BraveP3ALogStore(); + ~BraveP3ALogStore() override; static void RegisterPrefs(PrefRegistrySimple* registry); diff --git a/components/p3a/brave_p3a_uploader.cc b/components/p3a/brave_p3a_uploader.cc index 1a6138f5d6ef..abd980f66b8c 100644 --- a/components/p3a/brave_p3a_uploader.cc +++ b/components/p3a/brave_p3a_uploader.cc @@ -12,6 +12,7 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/simple_url_loader.h" +#include "services/network/public/mojom/url_response_head.mojom.h" namespace brave { diff --git a/components/page_info_strings.grdp b/components/page_info_strings.grdp index 722a909b9dbe..f7d1f983c1ed 100644 --- a/components/page_info_strings.grdp +++ b/components/page_info_strings.grdp @@ -67,7 +67,7 @@ - Is this website accurate? + Take a moment to consider accuracy Learn more @@ -75,6 +75,18 @@ Ignore + + Don't show again + + + Who’s behind this information? + + + What evidence supports it? + + + What do other sources say? + @@ -88,6 +100,9 @@ The site's connection is secure unless Brave tells you otherwise. + + You have accessed content using an administrator-provided certificate. Data you provide to $1www.google.com can be intercepted by your administrator. + Attackers might be able to see the images you’re looking at on this site and trick you by modifying them. @@ -155,13 +170,6 @@ - - - - You have accessed content using an administrator-provided certificate. Data you provide to $1www.google.com can be intercepted by your administrator. - - - @@ -170,16 +178,9 @@ You have chosen to disable security warnings for this site. - - - Stop using an invalid certificate - - - - - Re-enable warnings - - + + Re-enable warnings + diff --git a/components/page_info_strings_override.grdp b/components/page_info_strings_override.grdp index 88c9cda831a2..a0b31297ad2b 100644 --- a/components/page_info_strings_override.grdp +++ b/components/page_info_strings_override.grdp @@ -9,16 +9,8 @@ - - - - - - - - diff --git a/components/payments_strings.grdp b/components/payments_strings.grdp index 8a8d0e0f6b8a..aae9441dbaa1 100644 --- a/components/payments_strings.grdp +++ b/components/payments_strings.grdp @@ -675,6 +675,17 @@ No thanks + + + %1$smerchant.com may need to take additional steps to verify your payment + + + + + $1merchant.com may need to take additional steps to verify your payment + + + @@ -695,5 +706,14 @@ Secure payment credential authentication sheet is closed + + Secure payment credential no matching credential sheet + + + Secure payment credential no matching credential sheet is opened + + + Secure payment credential no matching credential sheet is closed + diff --git a/components/payments_strings_override.grdp b/components/payments_strings_override.grdp index a8c1c6739300..0d44127ddf88 100644 --- a/components/payments_strings_override.grdp +++ b/components/payments_strings_override.grdp @@ -39,5 +39,10 @@ Sign-in data will be stored on this device after you exit Private mode. + + + + + diff --git a/components/pdf_strings.grdp b/components/pdf_strings.grdp index a51e04bd9671..5c5a1016fb90 100644 --- a/components/pdf_strings.grdp +++ b/components/pdf_strings.grdp @@ -98,6 +98,9 @@ landscape + + square + Varies diff --git a/components/permissions/contexts/brave_ethereum_permission_context.cc b/components/permissions/contexts/brave_ethereum_permission_context.cc index 6381f8e168d0..39ccc7cab88e 100644 --- a/components/permissions/contexts/brave_ethereum_permission_context.cc +++ b/components/permissions/contexts/brave_ethereum_permission_context.cc @@ -26,7 +26,7 @@ namespace { bool IsAccepted(PermissionRequest* request, const std::vector& accounts) { for (const auto& account : accounts) { - if (base::EndsWith(request->GetOrigin().host_piece(), account, + if (base::EndsWith(request->requesting_origin().host_piece(), account, base::CompareCase::INSENSITIVE_ASCII)) { return true; } diff --git a/components/permissions/permission_expirations.cc b/components/permissions/permission_expirations.cc index 07c9a16bd644..81b9bd1f2737 100644 --- a/components/permissions/permission_expirations.cc +++ b/components/permissions/permission_expirations.cc @@ -249,7 +249,7 @@ void PermissionExpirations::ReadExpirationsFromPrefs() { DCHECK(type_expirations_map_val->is_dict()); std::vector invalid_content_type_names; - for (const auto& type_expirations_val : + for (const auto type_expirations_val : type_expirations_map_val->DictItems()) { const std::string& content_type_name = type_expirations_val.first; const base::Value& key_expirations_map_val = type_expirations_val.second; @@ -263,8 +263,7 @@ void PermissionExpirations::ReadExpirationsFromPrefs() { continue; } KeyExpirationsMap key_expirations_map; - for (const auto& key_expirations_val : - key_expirations_map_val.DictItems()) { + for (const auto key_expirations_val : key_expirations_map_val.DictItems()) { const std::string& key_str = key_expirations_val.first; const base::Value& expiring_permissions_val = key_expirations_val.second; ExpiringPermissions expiring_permissions = diff --git a/components/permissions/permission_lifetime_manager.cc b/components/permissions/permission_lifetime_manager.cc index 247c9cc90e46..6b23d147adae 100644 --- a/components/permissions/permission_lifetime_manager.cc +++ b/components/permissions/permission_lifetime_manager.cc @@ -45,7 +45,7 @@ PermissionLifetimeManager::PermissionLifetimeManager( permission_origin_lifetime_monitor_( std::move(permission_origin_lifetime_monitor)), permission_expirations_(prefs_), - expiration_timer_(std::make_unique()) { + expiration_timer_(std::make_unique()) { DCHECK(host_content_settings_map_); // In incognito prefs_ is nullptr. @@ -187,7 +187,7 @@ void PermissionLifetimeManager::OnContentSettingChanged( void PermissionLifetimeManager::RestartExpirationTimerForTesting() { StopExpirationTimer(); // Recreate timer to acknowledge a new task runnner. - expiration_timer_ = std::make_unique(); + expiration_timer_ = std::make_unique(); UpdateExpirationTimer(); } diff --git a/components/permissions/permission_lifetime_manager.h b/components/permissions/permission_lifetime_manager.h index f3da4cb179cb..650c5adfa6c7 100644 --- a/components/permissions/permission_lifetime_manager.h +++ b/components/permissions/permission_lifetime_manager.h @@ -12,7 +12,7 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" -#include "base/util/timer/wall_clock_timer.h" +#include "base/timer/wall_clock_timer.h" #include "brave/components/permissions/permission_expirations.h" #include "brave/components/permissions/permission_origin_lifetime_monitor.h" #include "components/content_settings/core/browser/content_settings_observer.h" @@ -92,7 +92,7 @@ class PermissionLifetimeManager : public KeyedService, PermissionExpirations permission_expirations_; // WallClockTimer to reset permissions properly even if a machine was put in // a long sleep/wake cycle. Stored as pointer to recreate in tests. - std::unique_ptr expiration_timer_; + std::unique_ptr expiration_timer_; base::ScopedObservation host_content_settings_map_observation_{this}; diff --git a/components/permissions/sources.gni b/components/permissions/sources.gni index 15e22b8ccf6e..53ff11e9e10a 100644 --- a/components/permissions/sources.gni +++ b/components/permissions/sources.gni @@ -23,7 +23,6 @@ brave_components_permissions_sources = [ brave_components_permissions_deps = [ "//base", - "//base/util/timer", "//brave/components/brave_wallet/common/buildflags", "//brave/components/resources:strings_grit", "//components/content_settings/core/browser", diff --git a/components/permissions_strings.grdp b/components/permissions_strings.grdp index a6f746f74a33..12568c1bf607 100644 --- a/components/permissions_strings.grdp +++ b/components/permissions_strings.grdp @@ -64,8 +64,11 @@ $1html5rocks.com wants to use your camera and microphone + + $1https://backgroundfetch.com wants to download multiple files + - + Know your unique device identifier @@ -100,9 +103,6 @@ See text and images copied to the clipboard - - Use NFC devices - Use virtual reality devices and data @@ -126,6 +126,12 @@ This will otherwise be blocked by your privacy settings. This will allow the con Know when you're actively using this device + + Download multiple files + + + See the make and model of your Security Key + Allow diff --git a/components/policy_strings.grdp b/components/policy_strings.grdp index 86acdc2076fd..0419447a3901 100644 --- a/components/policy_strings.grdp +++ b/components/policy_strings.grdp @@ -649,6 +649,18 @@ Additional details: Printing this content is blocked by administrator policy + + Confidential file + + + This document is confidential and printing is not advised by your administrator. + + + Continue + + + Cancel + Screen capture paused diff --git a/components/search_engines/brave_prepopulated_engines.cc b/components/search_engines/brave_prepopulated_engines.cc index 83a4049cea97..1ca7863e7510 100644 --- a/components/search_engines/brave_prepopulated_engines.cc +++ b/components/search_engines/brave_prepopulated_engines.cc @@ -56,6 +56,7 @@ PrepopulatedEngine ModifyEngineParams(const PrepopulatedEngine& engine, engine.alternate_urls, engine.alternate_urls_size, engine.type, + engine.preconnect_to_search_url, id > 0 ? id : engine.id}; } @@ -79,6 +80,7 @@ const PrepopulatedEngine duckduckgo = { NULL, 0, SEARCH_ENGINE_DUCKDUCKGO, + NULL, PREPOPULATED_ENGINE_ID_DUCKDUCKGO, }; @@ -117,6 +119,7 @@ const PrepopulatedEngine duckduckgo_lite = { NULL, 0, SEARCH_ENGINE_DUCKDUCKGO, + NULL, PREPOPULATED_ENGINE_ID_DUCKDUCKGO_LITE, }; #endif @@ -153,6 +156,7 @@ const PrepopulatedEngine qwant = { NULL, 0, SEARCH_ENGINE_QWANT, + NULL, PREPOPULATED_ENGINE_ID_QWANT, }; @@ -176,6 +180,7 @@ const PrepopulatedEngine startpage = { NULL, 0, SEARCH_ENGINE_OTHER, + NULL, PREPOPULATED_ENGINE_ID_STARTPAGE, }; @@ -217,6 +222,7 @@ const PrepopulatedEngine brave_search = { NULL, 0, SEARCH_ENGINE_OTHER, + NULL, PREPOPULATED_ENGINE_ID_BRAVE, }; diff --git a/components/security_interstitials_strings.grdp b/components/security_interstitials_strings.grdp index 4cf7d8d8919c..6e55078ff09c 100644 --- a/components/security_interstitials_strings.grdp +++ b/components/security_interstitials_strings.grdp @@ -536,7 +536,7 @@ The connection to $1example.com is not secure - You are seeing this warning because this site does not support HTTPS. + You are seeing this warning because this site does not support HTTPS. <a href="#" id="learn-more-link">Learn more</a> Go back diff --git a/components/sync/driver/brave_sync_service_impl.cc b/components/sync/driver/brave_sync_service_impl.cc index 012adf01e0c7..f2ed09217a12 100644 --- a/components/sync/driver/brave_sync_service_impl.cc +++ b/components/sync/driver/brave_sync_service_impl.cc @@ -41,7 +41,7 @@ BraveSyncServiceImpl::~BraveSyncServiceImpl() { void BraveSyncServiceImpl::Initialize() { SyncServiceImpl::Initialize(); if (!brave_sync_prefs_.IsSyncV1Migrated()) { - StopAndClearImpl(); + StopAndClear(); brave_sync_prefs_.SetSyncV1Migrated(true); } } diff --git a/ios/browser/brave_web_client.h b/ios/browser/brave_web_client.h index a1b0afde65ad..7862eeb62e15 100644 --- a/ios/browser/brave_web_client.h +++ b/ios/browser/brave_web_client.h @@ -27,7 +27,7 @@ class BraveWebClient : public web::WebClient { std::string GetUserAgent(web::UserAgentType type) const override; base::StringPiece GetDataResource( int resource_id, - ui::ScaleFactor scale_factor) const override; + ui::ResourceScaleFactor scale_factor) const override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override; private: diff --git a/ios/browser/brave_web_client.mm b/ios/browser/brave_web_client.mm index 506656fb4337..1e08918514de 100644 --- a/ios/browser/brave_web_client.mm +++ b/ios/browser/brave_web_client.mm @@ -36,7 +36,7 @@ base::StringPiece BraveWebClient::GetDataResource( int resource_id, - ui::ScaleFactor scale_factor) const { + ui::ResourceScaleFactor scale_factor) const { return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( resource_id, scale_factor); } diff --git a/ios/browser/providers/BUILD.gn b/ios/browser/providers/BUILD.gn index 4aa7c7783c74..7a24d3aa6299 100644 --- a/ios/browser/providers/BUILD.gn +++ b/ios/browser/providers/BUILD.gn @@ -12,7 +12,13 @@ group("brave_providers") { "//ios/chrome/browser/providers:chromium_provider_factory", # The individual API implementations. + "//ios/chrome/browser/providers/app_distribution:chromium_app_distribution", + "//ios/chrome/browser/providers/branded_images:chromium_branded_images", + "//ios/chrome/browser/providers/lens:chromium_lens", "//ios/chrome/browser/providers/modals:chromium_modals", + "//ios/chrome/browser/providers/risk_data:chromium_risk_data", + "//ios/chrome/browser/providers/signin:chromium_signin_error", + "//ios/chrome/browser/providers/signin:chromium_signin_resources", "//ios/chrome/browser/providers/text_zoom:chromium_text_zoom", # The provider API needs to provide MaterialDesignComponent API (as the diff --git a/patches/base-BUILD.gn.patch b/patches/base-BUILD.gn.patch index e157e930ccae..03709847701e 100644 --- a/patches/base-BUILD.gn.patch +++ b/patches/base-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/base/BUILD.gn b/base/BUILD.gn -index 1c989c7e922168fdd8ff40ce821c6c5af20ee1e1..cb6652b218b82dfba511795dd8e657f5da178ab5 100644 +index bafc85477602d8829665e5e780ef57f15a1d7cf6..6d396eebae43f960ea5e22f10ee35059324924f3 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -3960,6 +3960,7 @@ if (is_android) { +@@ -3987,6 +3987,7 @@ if (is_android) { "android/java/src/org/chromium/base/task/TaskTraits.java", "android/java/src/org/chromium/base/task/TaskTraitsExtensionDescriptor.java", ] diff --git a/patches/base-threading-thread_restrictions.h.patch b/patches/base-threading-thread_restrictions.h.patch index d0b6cf042858..084685ac58cd 100644 --- a/patches/base-threading-thread_restrictions.h.patch +++ b/patches/base-threading-thread_restrictions.h.patch @@ -1,8 +1,8 @@ diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h -index 5d28e0a1eceff66747e8472c7c0744d2f62194c3..0204b07cc1d9b46a7911036721ca8db5291ac6e9 100644 +index 088e966c9948d55fbb22daf4acd21072b220920d..86f6bbbd4c209ae911fab9e3a4f03f5ed9329a8b 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h -@@ -468,6 +468,7 @@ INLINE_IF_DCHECK_IS_OFF void DisallowBaseSyncPrimitives() +@@ -478,6 +478,7 @@ INLINE_IF_DCHECK_IS_OFF void DisallowBaseSyncPrimitives() EMPTY_BODY_IF_DCHECK_IS_OFF; class BASE_EXPORT ScopedAllowBaseSyncPrimitives { diff --git a/patches/build-config-android-BUILD.gn.patch b/patches/build-config-android-BUILD.gn.patch index baf5bd0f1126..acf7580610ae 100644 --- a/patches/build-config-android-BUILD.gn.patch +++ b/patches/build-config-android-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn -index 8eed45e80903f0289ea8759f1c18d62c044150a7..bbdd23a638ec32aab64d564089629b6b0a2a6cc6 100644 +index 3803fd4f18e616f2daf01f16ead09b5774d1ba0f..e06ee2ea069adc060e0892e17586d18fb4043d1c 100644 --- a/build/config/android/BUILD.gn +++ b/build/config/android/BUILD.gn @@ -50,6 +50,7 @@ config("compiler") { diff --git a/patches/build-config-android-config.gni.patch b/patches/build-config-android-config.gni.patch index 7841569f367e..a0d084f9f1f9 100644 --- a/patches/build-config-android-config.gni.patch +++ b/patches/build-config-android-config.gni.patch @@ -1,5 +1,5 @@ diff --git a/build/config/android/config.gni b/build/config/android/config.gni -index 898d9e82f74bfd0986694da66bbc13db72aab1f9..6915e913794115ebb6eec4f9066031e00d984a41 100644 +index e7540e8be1e015b6902b333b3d4c2d157ef62733..a9ae163577d11eb0aede1cea9a171567b48c3605 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni @@ -3,6 +3,7 @@ diff --git a/patches/build-config-android-rules.gni.patch b/patches/build-config-android-rules.gni.patch index 7412630446e0..fb43d6514918 100644 --- a/patches/build-config-android-rules.gni.patch +++ b/patches/build-config-android-rules.gni.patch @@ -1,5 +1,5 @@ diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni -index e6101b07a190d161b97cb936283e4f7580540a0e..33e8bb32120462ad181ab3de4709feabba76787c 100644 +index 1099c49fbff99028319f7ad2a66b717701d27e0f..07e9b140abd90596ff7c00f96f3e1d6b4e760506 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni @@ -476,6 +476,7 @@ if (enable_java_templates) { diff --git a/patches/build-config-compiler-BUILD.gn.patch b/patches/build-config-compiler-BUILD.gn.patch index b9fae66a08c2..31fc58d78942 100644 --- a/patches/build-config-compiler-BUILD.gn.patch +++ b/patches/build-config-compiler-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 13ed917c812811c1011351734df0844583936ade..46544f2bb37a76d24b58f554eb9f44ba73f287f1 100644 +index d7073ad38f0bfa55524691e701d7b25fef2f5116..b031841c169c0dc17274afccf3aa6bac29326b2d 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1729,6 +1729,7 @@ config("chromium_code") { +@@ -1737,6 +1737,7 @@ config("chromium_code") { cflags += [ "-Wextra-semi" ] } } diff --git a/patches/build-util-android_chrome_version.py.patch b/patches/build-util-android_chrome_version.py.patch index bf841c5e961f..e33f39da1e57 100644 --- a/patches/build-util-android_chrome_version.py.patch +++ b/patches/build-util-android_chrome_version.py.patch @@ -1,8 +1,8 @@ diff --git a/build/util/android_chrome_version.py b/build/util/android_chrome_version.py -index c06bb38b74b7f8c4e02186d7056ee4a05a2dae04..fcfaecf1f64a198a7a4e6e1e239a4f63e2767f98 100644 +index 5ec9e48d15e56116a4e9f8bdc202b1d30a5acc81..d7420843084accd5c04447f2485084a63e57f464 100644 --- a/build/util/android_chrome_version.py +++ b/build/util/android_chrome_version.py -@@ -191,7 +191,7 @@ def GenerateVersionCodes(version_values, arch, is_next_build): +@@ -194,7 +194,7 @@ def GenerateVersionCodes(version_values, arch, is_next_build): """ base_version_code = int( diff --git a/patches/chrome-BUILD.gn.patch b/patches/chrome-BUILD.gn.patch index a929c9856e8b..d3e6133ef835 100644 --- a/patches/chrome-BUILD.gn.patch +++ b/patches/chrome-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9fdd60ad5 100644 +index c25d483469dbc2580f12340daefb85f085b4e127..d9ac59a39c9bade1f6eecd396c4da33fd7d121c0 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -163,6 +163,7 @@ if (!is_android && !is_mac) { +@@ -164,6 +164,7 @@ if (!is_android && !is_mac) { "common/crash_keys.cc", "common/crash_keys.h", ] @@ -10,7 +10,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 deps += [ ":chrome_dll", -@@ -440,11 +441,12 @@ if (is_win) { +@@ -436,11 +437,12 @@ if (is_win) { args += [ "--keystone=0" ] } } @@ -24,7 +24,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 extra_substitutions = [ "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", "CHROMIUM_SHORT_NAME=$chrome_product_short_name", -@@ -462,6 +464,7 @@ if (is_win) { +@@ -458,6 +460,7 @@ if (is_win) { "//chrome/common:buildflags", "//chrome/common:version_header", ] @@ -32,7 +32,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 if (enable_stripping) { # At link time, preserve the global symbols specified in the .exports -@@ -534,7 +537,7 @@ if (is_win) { +@@ -530,7 +533,7 @@ if (is_win) { args = [ "-b", @@ -41,7 +41,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 "-v", chrome_version_full, "-g", -@@ -608,6 +611,7 @@ if (is_win) { +@@ -604,6 +607,7 @@ if (is_win) { # this dependency directly copies the file into the framework's # resources directory. public_deps += [ ":chrome_framework_widevine_signature" ] @@ -49,7 +49,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 } } -@@ -640,9 +644,11 @@ if (is_win) { +@@ -636,9 +640,11 @@ if (is_win) { "--scm=0", ] } @@ -61,7 +61,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 if (is_chrome_branded) { # These entitlements are bound to the official Google Chrome signing # certificate and will not necessarily work in any other build. -@@ -669,6 +675,7 @@ if (is_win) { +@@ -665,6 +671,7 @@ if (is_win) { info_plist_target = ":chrome_helper_plist" } @@ -69,7 +69,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 extra_substitutions = [ "CHROMIUM_BUNDLE_ID=$chrome_mac_bundle_id", "CHROMIUM_SHORT_NAME=$chrome_product_short_name", -@@ -1142,6 +1149,7 @@ if (is_win) { +@@ -1137,6 +1144,7 @@ if (is_win) { if (is_chrome_branded) { bundle_deps += [ ":preinstalled_apps" ] } @@ -77,7 +77,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 ldflags = [ "-compatibility_version", -@@ -1325,6 +1333,7 @@ if (is_win) { +@@ -1316,6 +1324,7 @@ if (is_win) { group("browser_dependencies") { public_deps = [ @@ -85,7 +85,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 "//build:branding_buildflags", "//build:chromeos_buildflags", "//chrome/browser", -@@ -1429,12 +1438,13 @@ group("child_dependencies") { +@@ -1424,12 +1433,13 @@ group("child_dependencies") { # this is OK because all of content is linked into one library. "//content/browser", ] @@ -100,7 +100,7 @@ index a512d736c1d603680cc0e5bfb42afbd70a799f9a..1870a96f1f4b00bb68c86962715fbad9 output = "$target_gen_dir/chrome_exe_version.rc" } -@@ -1488,6 +1498,7 @@ group("resources") { +@@ -1483,6 +1493,7 @@ group("resources") { "//chrome/browser:resources", "//chrome/common:resources", "//chrome/renderer:resources", diff --git a/patches/chrome-VERSION.patch b/patches/chrome-VERSION.patch index 4cbc17769cc8..57d069a94b6b 100644 --- a/patches/chrome-VERSION.patch +++ b/patches/chrome-VERSION.patch @@ -1,12 +1,12 @@ diff --git a/chrome/VERSION b/chrome/VERSION -index 98bc79fa509033bf263e89080f45a37495763486..6d23d3c5c2c10178d84e905fd0154445aa576488 100644 +index 3e5542ce16d8f64de418b76927eec2276ed2b00a..cb72876c01c78447d24c932f17b0bb3b4482a05e 100644 --- a/chrome/VERSION +++ b/chrome/VERSION @@ -1,4 +1,4 @@ - MAJOR=93 + MAJOR=94 -MINOR=0 --BUILD=4577 --PATCH=82 +-BUILD=4606 +-PATCH=50 +MINOR=1 +BUILD=30 +PATCH=74 diff --git a/patches/chrome-android-BUILD.gn.patch b/patches/chrome-android-BUILD.gn.patch index 389871d173d9..782003b693e4 100644 --- a/patches/chrome-android-BUILD.gn.patch +++ b/patches/chrome-android-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn -index de36df8da9fd556fcff5468fc68c710f8a7d0ccf..2a85be54845aad6e286019bff881fb175d1091d3 100644 +index dd4823f8558180d92cd2ab165130f64918b85a68..91cae183db61c4b1812b5cfc0af17eede25452cb 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn -@@ -247,6 +247,7 @@ android_resources("chrome_app_java_resources") { +@@ -252,6 +252,7 @@ android_resources("chrome_app_java_resources") { "//third_party/androidx:androidx_preference_preference_java", "//third_party/androidx:androidx_recyclerview_recyclerview_java", ] @@ -10,7 +10,7 @@ index de36df8da9fd556fcff5468fc68c710f8a7d0ccf..2a85be54845aad6e286019bff881fb17 } if (enable_vr) { -@@ -595,6 +596,7 @@ android_library("chrome_java") { +@@ -603,6 +604,7 @@ android_library("chrome_java") { deps += feed_deps deps += web_feed_deps @@ -18,7 +18,7 @@ index de36df8da9fd556fcff5468fc68c710f8a7d0ccf..2a85be54845aad6e286019bff881fb17 srcjar_deps = [ ":autofill_verification_status_generated_enum", -@@ -626,6 +628,7 @@ android_library("chrome_java") { +@@ -634,6 +636,7 @@ android_library("chrome_java") { "//components/offline_pages/core:offline_page_model_enums_java", "//net:effective_connection_type_java", ] @@ -26,7 +26,7 @@ index de36df8da9fd556fcff5468fc68c710f8a7d0ccf..2a85be54845aad6e286019bff881fb17 # From java_sources.gni. sources = chrome_java_sources + [ app_hooks_impl ] -@@ -746,6 +749,7 @@ java_group("chrome_all_java") { +@@ -754,6 +757,7 @@ java_group("chrome_all_java") { "//chrome/android/features/tab_ui:module_desc_java", ] } @@ -34,7 +34,7 @@ index de36df8da9fd556fcff5468fc68c710f8a7d0ccf..2a85be54845aad6e286019bff881fb17 } # This is a list of all base module jni headers. New features should add their -@@ -788,6 +792,7 @@ group("jni_headers") { +@@ -797,6 +801,7 @@ group("jni_headers") { "//components/ukm/android:jni_headers", "//components/webauthn/android:jni_headers", ] @@ -42,7 +42,7 @@ index de36df8da9fd556fcff5468fc68c710f8a7d0ccf..2a85be54845aad6e286019bff881fb17 } action_with_pydeps("chrome_android_java_google_api_keys_srcjar") { -@@ -2058,6 +2063,7 @@ if (current_toolchain == default_toolchain) { +@@ -2078,6 +2083,7 @@ if (current_toolchain == default_toolchain) { ":${_variant}_locale_pak_assets", ":${_variant}_paks", ] @@ -50,7 +50,7 @@ index de36df8da9fd556fcff5468fc68c710f8a7d0ccf..2a85be54845aad6e286019bff881fb17 if (_is_monochrome) { deps += [ "//android_webview:locale_pak_assets" ] if (webview_includes_weblayer && !_is_bundle_module) { -@@ -2451,6 +2457,7 @@ android_library("base_module_java") { +@@ -2474,6 +2480,7 @@ android_library("base_module_java") { "//components/payments/content/android:service_java", "//third_party/androidx:androidx_browser_browser_java", ] diff --git a/patches/chrome-android-chrome_java_sources.gni.patch b/patches/chrome-android-chrome_java_sources.gni.patch index 03a6ba144d8d..e5b819fd5327 100644 --- a/patches/chrome-android-chrome_java_sources.gni.patch +++ b/patches/chrome-android-chrome_java_sources.gni.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni -index a03f50e5f129a6aa7b581bf5cb1438708cb5ea14..a7172f3ea211fd55ec121d8f4b4ec881f0fdc509 100644 +index dd58dafd72a5f57758951dbe091ad8e980ccf1b1..c8e4f43839c5c2c972bdbc70fa8bb995e057aa05 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni -@@ -1258,3 +1258,4 @@ chrome_java_sources = [ +@@ -1266,3 +1266,4 @@ chrome_java_sources = [ "java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorActivity.java", "java/src/org/chromium/chrome/browser/webshare/ShareServiceImplementationFactory.java", ] diff --git a/patches/chrome-android-expectations-lint-suppressions.xml.patch b/patches/chrome-android-expectations-lint-suppressions.xml.patch index 609b80631288..cf8bb551413d 100644 --- a/patches/chrome-android-expectations-lint-suppressions.xml.patch +++ b/patches/chrome-android-expectations-lint-suppressions.xml.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/expectations/lint-suppressions.xml b/chrome/android/expectations/lint-suppressions.xml -index 57d9b134dbe5be0cac2369c335533d11f81405d5..79b806032507b9039789642eefc619f8c5e74aee 100644 +index b6d0d195ca192093dc6801855fe031efe4d8ff7d..5d65177959a039b20ffe27fc5b50dac15dd9430b 100644 --- a/chrome/android/expectations/lint-suppressions.xml +++ b/chrome/android/expectations/lint-suppressions.xml -@@ -122,6 +122,7 @@ https://chromium.googlesource.com/chromium/src/+/main/build/android/docs/lint.md +@@ -121,6 +121,7 @@ https://chromium.googlesource.com/chromium/src/+/main/build/android/docs/lint.md @@ -10,7 +10,7 @@ index 57d9b134dbe5be0cac2369c335533d11f81405d5..79b806032507b9039789642eefc619f8 -@@ -277,4 +278,5 @@ https://chromium.googlesource.com/chromium/src/+/main/build/android/docs/lint.md +@@ -294,4 +295,5 @@ https://chromium.googlesource.com/chromium/src/+/main/build/android/docs/lint.md diff --git a/patches/chrome-android-java-AndroidManifest.xml.patch b/patches/chrome-android-java-AndroidManifest.xml.patch index 19f97516aa80..80698dd8d775 100644 --- a/patches/chrome-android-java-AndroidManifest.xml.patch +++ b/patches/chrome-android-java-AndroidManifest.xml.patch @@ -1,10 +1,10 @@ diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml -index 563055a2311f4ac4888eb18b21bf90b2f1d0358e..5d2ec4d4cd6aeeeb4af390f8d96d2821d76ad311 100644 +index 934324202e0577e9c925363fbec67a91bb3deb42..40b8aa57d0896f54f087c33a2e9503117e99bfc9 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml -@@ -56,7 +56,9 @@ by a child template that "extends" this file. - - {% endif %} +@@ -59,7 +59,9 @@ by a child template that "extends" this file. + + @@ -65,7 +65,7 @@ index 563055a2311f4ac4888eb18b21bf90b2f1d0358e..5d2ec4d4cd6aeeeb4af390f8d96d2821 {% block extra_application_definitions %} {% endblock %} {% endmacro %} -@@ -1268,6 +1282,7 @@ by a child template that "extends" this file. +@@ -1290,6 +1304,7 @@ by a child template that "extends" this file. diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch index 27ee4a2f029c..a341bf9969c5 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeTabbedActivity.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -index b6b3f484b140bb91f0141ef1e63b5c6632a2e716..1dc892599c371576dcab5e6e5a16fbd283f2f56b 100644 +index 5aa0e513bef79ee77130e4d46662b9d6403abe72..0ab3eeb3582ec6b7cf9e140b45f1078e9938a5e1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java -@@ -2282,6 +2282,7 @@ public class ChromeTabbedActivity extends ChromeActivity +@@ -387,7 +387,7 @@ public abstract class ChromeActivity private boolean mLastPictureInPictureModeForTesting; protected ChromeActivity() { diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-document-ChromeLauncherActivity.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-document-ChromeLauncherActivity.java.patch index d11ed514a6b9..d2c6b0340d00 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-document-ChromeLauncherActivity.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-document-ChromeLauncherActivity.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java -index 62a752d560e6b2f32842b6cb6729adada5578e31..bf36828c345156247e0b27d62cfac0767697db0d 100644 +index ffb14d32b1615c06324b1b47afc483f02c791798..b6a1a5b95b7ef4fb3aecc501377d2517320ea56b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java -@@ -16,7 +16,7 @@ import org.chromium.chrome.browser.vr.VrModuleProvider; +@@ -19,7 +19,7 @@ import org.chromium.chrome.browser.vr.VrModuleProvider; * Dispatches incoming intents to the appropriate activity based on the current configuration and * Intent fired. */ diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-ntp-NewTabPageLayout.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-ntp-NewTabPageLayout.java.patch index 92db18a1def1..398a2a707230 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-ntp-NewTabPageLayout.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-ntp-NewTabPageLayout.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java -index 531d2931e21fc5dea43fb04ca63e72f41d94d16b..35e1185b79477c03cbd1e72e1a6d7a4df1607ea8 100644 +index e200672c7e69e375935041efa389ff551e7365f6..0ccd32f484d73c9fa5bc1eca7417e2a338bbb0cf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java -@@ -253,6 +253,7 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer +@@ -255,6 +255,7 @@ public class NewTabPageLayout extends LinearLayout implements TileGroup.Observer /* observer = */ this, offlinePageBridge); int maxRows = 2; diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch index ba8102f7edb2..af505050c460 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-privacy-settings-PrivacySettings.java.patch @@ -1,8 +1,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java -index 8f178e7b56924ddc7ee6026c39ab67b49b6e3153..0e4a6c54924ce674c804f22ee0947761797e630d 100644 +index 69bcd7e5e38574b6e1edba96cbfc61f2552b72bd..2c28f017de2911511d152b05117d34842bd9535c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java -@@ -45,7 +45,7 @@ import org.chromium.ui.text.SpanApplier; +@@ -46,7 +46,7 @@ import org.chromium.ui.text.SpanApplier; * Fragment to keep track of the all the privacy related preferences. */ public class PrivacySettings @@ -10,8 +10,8 @@ index 8f178e7b56924ddc7ee6026c39ab67b49b6e3153..0e4a6c54924ce674c804f22ee0947761 + extends org.chromium.chrome.browser.settings.BravePreferenceFragment implements Preference.OnPreferenceChangeListener { private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment"; private static final String PREF_NETWORK_PREDICTIONS = "preload_pages"; - private static final String PREF_SECURE_DNS = "secure_dns"; -@@ -229,6 +229,7 @@ public class PrivacySettings + private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode"; +@@ -246,6 +246,7 @@ public class PrivacySettings @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.clear(); @@ -19,7 +19,7 @@ index 8f178e7b56924ddc7ee6026c39ab67b49b6e3153..0e4a6c54924ce674c804f22ee0947761 MenuItem help = menu.add(Menu.NONE, R.id.menu_id_targeted_help, Menu.NONE, R.string.menu_help); help.setIcon(VectorDrawableCompat.create( -@@ -243,6 +244,6 @@ public class PrivacySettings +@@ -260,6 +261,6 @@ public class PrivacySettings null); return true; } diff --git a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch index 9b70f6378520..baf20af5ec8c 100644 --- a/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch +++ b/patches/chrome-android-java-src-org-chromium-chrome-browser-sync-settings-ManageSyncSettings.java.patch @@ -1,5 +1,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java -index 849a0b9df353f4ea79949b229d6e4670fdb72f24..7101e09371cdb4a181a56acd17d2275805374a5a 100644 +index aceb920b21367a090c2128b80bd4f935ce3b6226..84f057c881994fc691429726ac6a21f7660bd83d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/ManageSyncSettings.java @@ -25,7 +25,7 @@ import androidx.appcompat.app.AppCompatActivity; diff --git a/patches/chrome-app-BUILD.gn.patch b/patches/chrome-app-BUILD.gn.patch index a0e57de49b5e..dc8931825071 100644 --- a/patches/chrome-app-BUILD.gn.patch +++ b/patches/chrome-app-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn -index 3b9bf4585f5db5541e3bfe60aca4b021188c70af..94304a41becd67dafbec184fee8df7e610e86182 100644 +index 84b98d0874b7b6f71fcfe96dfcc65759b31b8cb9..cab53ee9f8d8327f09e67a88a76c16f5616a2bb8 100644 --- a/chrome/app/BUILD.gn +++ b/chrome/app/BUILD.gn -@@ -72,6 +72,8 @@ grit("generated_resources") { +@@ -89,6 +89,8 @@ grit("generated_resources") { if (is_android) { outputs += android_generated_java_resources } @@ -11,7 +11,7 @@ index 3b9bf4585f5db5541e3bfe60aca4b021188c70af..94304a41becd67dafbec184fee8df7e6 } if (is_android) { -@@ -94,7 +96,7 @@ grit("google_chrome_strings") { +@@ -111,7 +113,7 @@ grit("google_chrome_strings") { } grit("chromium_strings") { diff --git a/patches/chrome-browser-BUILD.gn.patch b/patches/chrome-browser-BUILD.gn.patch index b41eaed0c7b0..962eea3fbe01 100644 --- a/patches/chrome-browser-BUILD.gn.patch +++ b/patches/chrome-browser-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 0d81f08e66b1e20f0420b257ac80ca83ca96c23b..314944a94fad4e9e5fddc7c7b1451523cf7e4a4f 100644 +index 913813f344ca1c6301710ed983c80a358fa68443..f8fdd7beeb2cbc809ebf7e6477a0d6b881b47411 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -2470,6 +2470,7 @@ static_library("browser") { +@@ -2486,6 +2486,7 @@ static_library("browser") { "performance_monitor/metric_evaluator_helper_posix.h", ] } diff --git a/patches/chrome-browser-about_flags.cc.patch b/patches/chrome-browser-about_flags.cc.patch index 88bc65034e90..7d864cf6902a 100644 --- a/patches/chrome-browser-about_flags.cc.patch +++ b/patches/chrome-browser-about_flags.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc -index 2224b7d7693893a137ab2fbcbf2eac6aed89a409..ec1866be53067d88f38fa29a6f07449809912b9a 100644 +index e50714dc9f4f87fa315bd1757ba8f96ca8017bbd..f6c57fead42b8afe1bb49441378028c5ce1e496f 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc -@@ -314,14 +314,14 @@ const FeatureEntry::Choice kTouchTextSelectionStrategyChoices[] = { +@@ -313,14 +313,14 @@ const FeatureEntry::Choice kTouchTextSelectionStrategyChoices[] = { const FeatureEntry::Choice kTraceUploadURL[] = { {flags_ui::kGenericExperimentChoiceDisabled, "", ""}, {flag_descriptions::kTraceUploadUrlChoiceOther, switches::kTraceUploadURL, @@ -21,7 +21,7 @@ index 2224b7d7693893a137ab2fbcbf2eac6aed89a409..ec1866be53067d88f38fa29a6f074498 const FeatureEntry::Choice kLiteVideoDefaultDownlinkBandwidthKbps[] = { {flags_ui::kGenericExperimentChoiceDefault, "", ""}, -@@ -7636,6 +7636,7 @@ const FeatureEntry kFeatureEntries[] = { +@@ -7539,6 +7539,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-browsing_data-chrome_browsing_data_remover_delegate.h.patch b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.h.patch index 48ba59d5ec9a..96642ea66b96 100644 --- a/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.h.patch +++ b/patches/chrome-browser-browsing_data-chrome_browsing_data_remover_delegate.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h -index 324f9fd1f3b0a14c992bc330ef2a599bf1d3a526..c1ae28a2e42e62de3e61e0946ad8f605077702c9 100644 +index 513a64cc3f34e4b9a88fe6fb1776fc2d60d1819e..e2e30875bd1b7e7aea88172b6fded4700c42865a 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h @@ -82,6 +82,7 @@ class ChromeBrowsingDataRemoverDelegate @@ -10,12 +10,12 @@ index 324f9fd1f3b0a14c992bc330ef2a599bf1d3a526..c1ae28a2e42e62de3e61e0946ad8f605 private: using WebRtcEventLogManager = webrtc_event_logging::WebRtcEventLogManager; -@@ -129,7 +130,8 @@ class ChromeBrowsingDataRemoverDelegate - kAccountPasswordsSynced = 38, +@@ -130,7 +131,8 @@ class ChromeBrowsingDataRemoverDelegate kAccountCompromisedCredentials = 39, kFaviconCacheExpiration = 40, -- kMaxValue = kFaviconCacheExpiration, -+ kIPFSCache = 41, + kSecurePaymentConfirmationInstruments = 41, +- kMaxValue = kSecurePaymentConfirmationInstruments, ++ kIPFSCache = 42, + kMaxValue = kIPFSCache, }; diff --git a/patches/chrome-browser-chrome_content_browser_client.h.patch b/patches/chrome-browser-chrome_content_browser_client.h.patch index 71139d978d6b..710d9e1b324c 100644 --- a/patches/chrome-browser-chrome_content_browser_client.h.patch +++ b/patches/chrome-browser-chrome_content_browser_client.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h -index 99716396fdf40638283e8eb4cff8cb7bfcbf6fde..1347bf7e5041a17a8f25c3c85d2ca9ba9c1287e0 100644 +index 06a82640d7e95e9d78887aba3747b4c95ee94691..4734952c67fed5b6dad63eaa8100d16db49aabc7 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h -@@ -753,6 +753,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -756,6 +756,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { } private: diff --git a/patches/chrome-browser-extensions-BUILD.gn.patch b/patches/chrome-browser-extensions-BUILD.gn.patch index f3c82a8062b9..c1f936074060 100644 --- a/patches/chrome-browser-extensions-BUILD.gn.patch +++ b/patches/chrome-browser-extensions-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn -index 936bc38c36ecd54dfef64f670d1a7a9fa1237a1f..8ff9e07c1b8a27c2324e582dadcf4681a8ce0b15 100644 +index 3c3358ae9fad3a705be7daa2c1ac495a5f7987c3..0629e70156a054c41d4b0e838c97619075eb3ad4 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn -@@ -1311,6 +1311,7 @@ static_library("extensions") { +@@ -1313,6 +1313,7 @@ static_library("extensions") { } else { sources += [ "api/braille_display_private/braille_controller_stub.cc" ] } diff --git a/patches/chrome-browser-extensions-extension_service.h.patch b/patches/chrome-browser-extensions-extension_service.h.patch index e732b826d187..c868679881d2 100644 --- a/patches/chrome-browser-extensions-extension_service.h.patch +++ b/patches/chrome-browser-extensions-extension_service.h.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h -index 376fb4111ba8e46da83480775304d1218ab8f9c4..4a8abed1c22bd4a84165654626fc0ddb97076b1c 100644 +index aa2beca595cab77452532edfa930a1d9012900fa..48cb7a070c11614472ba297aea7e410f1d8b5c0a 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -457,6 +457,7 @@ class ExtensionService : public ExtensionServiceInterface, diff --git a/patches/chrome-browser-extensions-extension_tab_util.cc.patch b/patches/chrome-browser-extensions-extension_tab_util.cc.patch index b90b9c0c0ba7..2dbff580de4a 100644 --- a/patches/chrome-browser-extensions-extension_tab_util.cc.patch +++ b/patches/chrome-browser-extensions-extension_tab_util.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc -index 1d3c4d4171e0cc6828ff857e37e68c3dcdeceb61..82b80dd901a05a3b91af87f620f9c97e55060fa6 100644 +index cd5670f4eadf4a3f7314e84a1ac6ad914a11550a..6a871f9421c0a4fdf36a2a80a44cdec81b973cd3 100644 --- a/chrome/browser/extensions/extension_tab_util.cc +++ b/chrome/browser/extensions/extension_tab_util.cc @@ -794,6 +794,7 @@ bool ExtensionTabUtil::IsKillURL(const GURL& url) { diff --git a/patches/chrome-browser-external_protocol-external_protocol_handler.cc.patch b/patches/chrome-browser-external_protocol-external_protocol_handler.cc.patch index ef9c2aba6ad1..c61c7b4ca623 100644 --- a/patches/chrome-browser-external_protocol-external_protocol_handler.cc.patch +++ b/patches/chrome-browser-external_protocol-external_protocol_handler.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc -index cc9106acff5044cfda3913313f64ad9e1a2b1daa..68fdaf4f538dc43ff0e685bc3c04937d92ebdf2b 100644 +index 34eaaaeeed5d1cf18459bc5b95d5573d435f107d..af9bc7ebe056618d5335bb9a00291e4a143a6a86 100644 --- a/chrome/browser/external_protocol/external_protocol_handler.cc +++ b/chrome/browser/external_protocol/external_protocol_handler.cc -@@ -310,7 +310,7 @@ ExternalProtocolHandler::BlockState ExternalProtocolHandler::GetBlockState( +@@ -314,7 +314,7 @@ ExternalProtocolHandler::BlockState ExternalProtocolHandler::GetBlockState( // Always allow the hard-coded allowed schemes. for (size_t i = 0; i < base::size(kAllowedSchemes); ++i) { if (kAllowedSchemes[i] == scheme) 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 ed8535c9ada6..54c7b90f31a0 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 625418531e0af97078f06dded92b89eb229af955..c7af0c80026f79c7e54c6e85ebcaa50ad4199105 100644 +index 19cf18901df225e273de05ed4f54e9ac66395966..2989831cca393150732beffebc4935cb2c77f1c4 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[] = { +@@ -349,6 +349,7 @@ const base::Feature* const kFeaturesExposedToJava[] = { }; const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) { diff --git a/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch b/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch index d71ad5a5a1bf..f73da1e60280 100644 --- a/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch +++ b/patches/chrome-browser-media-webrtc-webrtc_event_log_uploader.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -index dd743c600f4493f9fc233ce45b64bc1bb25a023f..e3706faac46fa0517a331c463104f8082d77bde8 100644 +index 6c7da79172e3fe2980318aff55188f4ab5f0a7d9..493e1a0a91033cf1363fe2eefdcc0ac851ca782a 100644 --- a/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc +++ b/chrome/browser/media/webrtc/webrtc_event_log_uploader.cc -@@ -276,6 +276,7 @@ bool WebRtcEventLogUploaderImpl::PrepareUploadData(std::string* upload_data) { +@@ -278,6 +278,7 @@ bool WebRtcEventLogUploaderImpl::PrepareUploadData(std::string* upload_data) { } void WebRtcEventLogUploaderImpl::StartUpload(const std::string& upload_data) { diff --git a/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch b/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch index 90d0fddb18c3..89c6737c7a7b 100644 --- a/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch +++ b/patches/chrome-browser-media-webrtc-webrtc_log_uploader.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/media/webrtc/webrtc_log_uploader.cc b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -index 9544cfb3f4ab3a9babc49923c9a7bd3624ab88ad..4dfbc16b3ce775b051304a7652aa48f5668b0377 100644 +index aff1c0a9a6a9c1f40d04d53ba7fe3b59e51faef3..d442574c0041ce6cc53f424b3153e2536447fb3b 100644 --- a/chrome/browser/media/webrtc/webrtc_log_uploader.cc +++ b/chrome/browser/media/webrtc/webrtc_log_uploader.cc -@@ -445,6 +445,7 @@ std::string WebRtcLogUploader::CompressLog(WebRtcLogBuffer* buffer) { +@@ -447,6 +447,7 @@ std::string WebRtcLogUploader::CompressLog(WebRtcLogBuffer* buffer) { void WebRtcLogUploader::UploadCompressedLog( WebRtcLogUploader::UploadDoneData upload_done_data, std::unique_ptr post_data) { diff --git a/patches/chrome-browser-net-stub_resolver_config_reader.cc.patch b/patches/chrome-browser-net-stub_resolver_config_reader.cc.patch index 94561f9ce467..80073c48cb58 100644 --- a/patches/chrome-browser-net-stub_resolver_config_reader.cc.patch +++ b/patches/chrome-browser-net-stub_resolver_config_reader.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/net/stub_resolver_config_reader.cc b/chrome/browser/net/stub_resolver_config_reader.cc -index dfe652970e4e5d5b37e73bb1d840650d5e62a98a..c2c179b2cd1713e22061806bec7cd94dc0ab860a 100644 +index fa75cd46897d9b47d183b0d8b84c30dceb4196e8..9870ef7b94cbc7ad74e9a5a5503381cbd180a18c 100644 --- a/chrome/browser/net/stub_resolver_config_reader.cc +++ b/chrome/browser/net/stub_resolver_config_reader.cc -@@ -359,6 +359,7 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration( +@@ -366,6 +366,7 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration( std::string doh_templates = local_state_->GetString(prefs::kDnsOverHttpsTemplates); diff --git a/patches/chrome-browser-net-system_network_context_manager.cc.patch b/patches/chrome-browser-net-system_network_context_manager.cc.patch index 7c0458393d41..1177d662954c 100644 --- a/patches/chrome-browser-net-system_network_context_manager.cc.patch +++ b/patches/chrome-browser-net-system_network_context_manager.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc -index b2b299583b97ed2d352e6f643805a04aaee12695..39df60466154a90583d410123afa5cfbeb5d7da1 100644 +index f483a6b0cbc8005203109b35ff0a45a4de275c60..4105cd79a0eee9c82b6d6c79e68a453a2c0d1dac 100644 --- a/chrome/browser/net/system_network_context_manager.cc +++ b/chrome/browser/net/system_network_context_manager.cc -@@ -224,7 +224,7 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem +@@ -236,7 +236,7 @@ class SystemNetworkContextManager::URLLoaderFactoryForSystem if (!manager_) return; manager_->GetURLLoaderFactory()->CreateLoaderAndStart( diff --git a/patches/chrome-browser-notifications-BUILD.gn.patch b/patches/chrome-browser-notifications-BUILD.gn.patch index 37d37708db36..639e19761575 100644 --- a/patches/chrome-browser-notifications-BUILD.gn.patch +++ b/patches/chrome-browser-notifications-BUILD.gn.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/notifications/BUILD.gn b/chrome/browser/notifications/BUILD.gn -index c2547a721e342a70d007946b5b0b0b3669040af1..473301c92e944fbe16aba5e997e9d1fe0c5c2331 100644 +index 132dc6ef0333d73c307659818cac9bfce9935a60..f04ff2375ba7991de9abe2746fc483e3f4ac8466 100644 --- a/chrome/browser/notifications/BUILD.gn +++ b/chrome/browser/notifications/BUILD.gn @@ -79,6 +79,7 @@ if (is_android) { diff --git a/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch b/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch index cae03ec220d9..cf352454cab0 100644 --- a/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch +++ b/patches/chrome-browser-notifications-notification_display_service_impl.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/notifications/notification_display_service_impl.cc b/chrome/browser/notifications/notification_display_service_impl.cc -index d45145fc4cbf41d7bed267445c1e9c891c6f50ae..481647979c8b6e4634a9f854ccd7e246d2cf2676 100644 +index d5a4235f89141fe57e6b721ff9dd19ee95221334..bce13d6dc6c9874f6e352d6e5bf5841c93891d3b 100644 --- a/chrome/browser/notifications/notification_display_service_impl.cc +++ b/chrome/browser/notifications/notification_display_service_impl.cc @@ -115,6 +115,7 @@ NotificationDisplayServiceImpl::NotificationDisplayServiceImpl(Profile* profile) diff --git a/patches/chrome-browser-notifications-notification_platform_bridge_mac.mm.patch b/patches/chrome-browser-notifications-notification_platform_bridge_mac.mm.patch deleted file mode 100644 index d660caf2cb35..000000000000 --- a/patches/chrome-browser-notifications-notification_platform_bridge_mac.mm.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm -index 7b48e6b403b996140be0e0bd2fc8993aa669d6d3..ec934a6367953df5e62a0e64b25753e3b606046f 100644 ---- a/chrome/browser/notifications/notification_platform_bridge_mac.mm -+++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm -@@ -186,6 +186,7 @@ void NotificationPlatformBridgeMac::Display( - } else { - NSUserNotification* toast = [builder buildUserNotification]; - [notification_center_ deliverNotification:toast]; -+ BRAVE_DISPLAY_ - } - } - diff --git a/patches/chrome-browser-notifications-notification_platform_bridge_mac_utils.mm.patch b/patches/chrome-browser-notifications-notification_platform_bridge_mac_utils.mm.patch deleted file mode 100644 index 35205019a998..000000000000 --- a/patches/chrome-browser-notifications-notification_platform_bridge_mac_utils.mm.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/chrome/browser/notifications/notification_platform_bridge_mac_utils.mm b/chrome/browser/notifications/notification_platform_bridge_mac_utils.mm -index 2d50db66e64d02ef80bcd85bcb69d1f12a1c8eb8..483272a4500b8689821d3e0d0f47afc1802dcb04 100644 ---- a/chrome/browser/notifications/notification_platform_bridge_mac_utils.mm -+++ b/chrome/browser/notifications/notification_platform_bridge_mac_utils.mm -@@ -60,6 +60,7 @@ void DoProcessMacNotificationResponse( - // call this method directly as SysInfo::OperatingSystemVersionNumbers might be - // an expensive call. Instead use SupportsAlerts which caches this value. - bool MacOSSupportsXPCAlertsImpl() { -+ BRAVE_SUPPORTSALERTSIMPL_ - int32_t major, minor, bugfix; - base::SysInfo::OperatingSystemVersionNumbers(&major, &minor, &bugfix); - // Allow alerts on all versions except 10.15.0, 10.15.1 & 10.15.2. diff --git a/patches/chrome-browser-prefs-browser_prefs.cc.patch b/patches/chrome-browser-prefs-browser_prefs.cc.patch index 51e92b54ba94..45e1d9f4cfda 100644 --- a/patches/chrome-browser-prefs-browser_prefs.cc.patch +++ b/patches/chrome-browser-prefs-browser_prefs.cc.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc -index 73a940e67d22e03667e97a98c097d98bbe01b11a..0e5780561d7e2a45fd76a6d8953971551204777d 100644 +index 8cdb9027574ef553a3b9c37859423ddc60310525..3e5a85300e0675ced82f75ec2d122254342f6159 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc -@@ -1043,6 +1043,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1056,6 +1056,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) { #if defined(TOOLKIT_VIEWS) RegisterBrowserViewLocalPrefs(registry); #endif @@ -10,7 +10,7 @@ index 73a940e67d22e03667e97a98c097d98bbe01b11a..0e5780561d7e2a45fd76a6d895397155 // This is intentionally last. RegisterLocalStatePrefsForMigration(registry); -@@ -1339,6 +1340,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1359,6 +1360,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, #endif RegisterProfilePrefsForMigration(registry); diff --git a/patches/chrome-browser-profiles-profile.cc.patch b/patches/chrome-browser-profiles-profile.cc.patch index cfbd6bf43131..f16643c7c1d2 100644 --- a/patches/chrome-browser-profiles-profile.cc.patch +++ b/patches/chrome-browser-profiles-profile.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc -index 01f72891d3035232282e6ceeee48f99c9e350292..85ade8b8381aa2acf3b0b47b457beba4d23f45e0 100644 +index 403c59f81857a9d7fe640d55dcef0558194ca046..f9597e7f52dae3f0b5d7333423314b7d4bad7f07 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc @@ -100,6 +100,7 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { diff --git a/patches/chrome-browser-profiles-profile_impl.cc.patch b/patches/chrome-browser-profiles-profile_impl.cc.patch index ec2cbdd3ee05..4ab82ffa8689 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 9a6b9dd9fe3c9791333b5954db7c805708520409..00990a60de163dc12f7e29957225f47b0076f521 100644 +index 3a757e266d7f3bcde5a381b37ecc8f7b0161bf28..6d77545cd626d1b33290bbd85e4d1cfd46327a62 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc -@@ -374,7 +374,7 @@ std::unique_ptr Profile::CreateProfile(const base::FilePath& path, +@@ -380,7 +380,7 @@ std::unique_ptr Profile::CreateProfile(const base::FilePath& path, NOTREACHED(); } diff --git a/patches/chrome-browser-profiles-profile_impl.h.patch b/patches/chrome-browser-profiles-profile_impl.h.patch index 40a92b1e417c..fd6cc8d29bcb 100644 --- a/patches/chrome-browser-profiles-profile_impl.h.patch +++ b/patches/chrome-browser-profiles-profile_impl.h.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h -index 0320557cde17a187f366a265c2d7568488aea692..40fa7e3217d406be3dc293d8310430c471b2ae7f 100644 +index 7f0357c05704c1ebb90d64a4b74fa5839efd5cac..07b9ec1db7e1c821e33f58753ad73cde41d6312f 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h -@@ -169,6 +169,7 @@ class ProfileImpl : public Profile { +@@ -167,6 +167,7 @@ class ProfileImpl : public Profile { void OnLogin() override; void InitChromeOSPreferences() override; #endif // BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/patches/chrome-browser-profiles-renderer_updater.cc.patch b/patches/chrome-browser-profiles-renderer_updater.cc.patch index f35741307082..cf79481ecee5 100644 --- a/patches/chrome-browser-profiles-renderer_updater.cc.patch +++ b/patches/chrome-browser-profiles-renderer_updater.cc.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/profiles/renderer_updater.cc b/chrome/browser/profiles/renderer_updater.cc -index c8771e1d5072b68b255725b72cdef4a05fc501a1..0f737c813a7d211ac4dd289b42a8ab98712e9f10 100644 +index 0757d75a24b28bf3cbc20234ae23742a78318993..3dad32e466ec8ae92b257b172797c10039e62384 100644 --- a/chrome/browser/profiles/renderer_updater.cc +++ b/chrome/browser/profiles/renderer_updater.cc @@ -54,6 +54,7 @@ void GetGuestViewDefaultContentSettingRules( 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 bddf17c86a3a..76b17c4ae4f5 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 f709ee1009830dda862a171da637ae7b43520c76..a719398dc73f99c6787a1ea670475761ebd20103 100644 +index 5d5704536562b329098da2ce3a2b115f6703e49b..452b0c77f72efb920e0cbdbbe65cc63f1191c3be 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -1788,6 +1788,7 @@ void RenderViewContextMenu::AppendSearchProvider() { +@@ -1834,6 +1834,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 fe522ab1b7d6..af451f3e02fe 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 3e75832061fd2d07c624a81118a8aafbb2c6aa80..3eabff7369b4576a041608f80350604d36a7d29d 100644 +index fbcde566b8c9015ab98ecf4704ec0f126f7d15dd..761e8c3fedc32c0d636f6b30ea9c290c7c7060de 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.h +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -130,6 +130,7 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, +@@ -131,6 +131,7 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, // Returns true if keyboard lock is active and requires the user to press and // hold escape to exit exclusive access mode. bool IsPressAndHoldEscRequiredToExitFullscreen() const; diff --git a/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch b/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch index bcb33e455645..356f7a6c8833 100644 --- a/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch +++ b/patches/chrome-browser-resources-bookmarks-bookmarks.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/bookmarks/bookmarks.html b/chrome/browser/resources/bookmarks/bookmarks.html -index fbaec388ddf82ae379e3abf66b5f4bb6069ead7b..5ff892de2f6074b1a24a099b5a3fecc186ca8593 100644 +index 251e3cb3f0f88067b7d6557dc3128c59dab6e3cb..e1f87a889cf4d4610f9538a6ef2deaf17dec8976 100644 --- a/chrome/browser/resources/bookmarks/bookmarks.html +++ b/chrome/browser/resources/bookmarks/bookmarks.html -@@ -29,6 +29,7 @@ +@@ -30,6 +30,7 @@ height: var(--md-toolbar-height); } diff --git a/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch b/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch index 29bd21163e53..11ae3da86613 100644 --- a/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch +++ b/patches/chrome-browser-resources-bookmarks-command_manager.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/bookmarks/command_manager.ts b/chrome/browser/resources/bookmarks/command_manager.ts -index 52737b6cd6a7d7abeac7d852be61c07f369de4ce..9034d20174bbdb2741a58494fcb3f6adcddce879 100644 +index f31b09b3cffe7dc52ce8e15793b0532af7ee96ae..daa36d60a53354859149d51976dc4549f8f71bcd 100644 --- a/chrome/browser/resources/bookmarks/command_manager.ts +++ b/chrome/browser/resources/bookmarks/command_manager.ts @@ -437,7 +437,7 @@ export class BookmarksCommandManagerElement extends diff --git a/patches/chrome-browser-resources-downloads-downloads.html.patch b/patches/chrome-browser-resources-downloads-downloads.html.patch index 06db2f6d5f55..38f64ca8e674 100644 --- a/patches/chrome-browser-resources-downloads-downloads.html.patch +++ b/patches/chrome-browser-resources-downloads-downloads.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/downloads/downloads.html b/chrome/browser/resources/downloads/downloads.html -index a5bb15763aa3820bd3b0a72ec8234c0ba6567b68..0d6b3a42780a9a8bd82d03c33fdab978d051af2c 100644 +index e46eff0dab0be1614b4376fce59b8c0beef46142..4d7430498f052eb9d5c76e1e4010360d1a6ae735 100644 --- a/chrome/browser/resources/downloads/downloads.html +++ b/chrome/browser/resources/downloads/downloads.html -@@ -6,6 +6,7 @@ +@@ -7,6 +7,7 @@ $i18n{title} diff --git a/patches/chrome-browser-resources-extensions-extensions.html.patch b/patches/chrome-browser-resources-extensions-extensions.html.patch index 0b5afce2754c..0e891c492b39 100644 --- a/patches/chrome-browser-resources-extensions-extensions.html.patch +++ b/patches/chrome-browser-resources-extensions-extensions.html.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/extensions/extensions.html b/chrome/browser/resources/extensions/extensions.html -index 3aa5c713503cdab793fff44c2d9a924cda3c168a..1d4b693b323fd68233decb43a5d6be5e56267c99 100644 +index ecc17a85b6ecba98c1bfeb97a88d739289d016c9..ee88b081e49a75bba9a34571ca12659d8ce656bf 100644 --- a/chrome/browser/resources/extensions/extensions.html +++ b/chrome/browser/resources/extensions/extensions.html @@ -54,6 +54,7 @@ diff --git a/patches/chrome-browser-resources-extensions-extensions.ts.patch b/patches/chrome-browser-resources-extensions-extensions.ts.patch index 6058778c3cde..d9b70b231867 100644 --- a/patches/chrome-browser-resources-extensions-extensions.ts.patch +++ b/patches/chrome-browser-resources-extensions-extensions.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/extensions/extensions.ts b/chrome/browser/resources/extensions/extensions.ts -index 5836804c9e488bb23869d05881bd55cd7ccd9f52..928974d8d5dc367276527ae521b26fc3bb7cb226 100644 +index 378090e6f4816577f578ac418c5b449e68240ee3..40ae9e27676a5b67b0cf5fcf7f07dffab875ce6b 100644 --- a/chrome/browser/resources/extensions/extensions.ts +++ b/chrome/browser/resources/extensions/extensions.ts @@ -2,6 +2,7 @@ @@ -9,4 +9,4 @@ index 5836804c9e488bb23869d05881bd55cd7ccd9f52..928974d8d5dc367276527ae521b26fc3 +import './brave_overrides/index.js'; import './manager.js'; - export {getToastManager} from 'chrome://resources/cr_elements/cr_toast/cr_toast_manager.m.js'; + export {getToastManager} from 'chrome://resources/cr_elements/cr_toast/cr_toast_manager.js'; diff --git a/patches/chrome-browser-resources-extensions-item_list.ts.patch b/patches/chrome-browser-resources-extensions-item_list.ts.patch index 0eee722f1cad..4974fe06a195 100644 --- a/patches/chrome-browser-resources-extensions-item_list.ts.patch +++ b/patches/chrome-browser-resources-extensions-item_list.ts.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/extensions/item_list.ts b/chrome/browser/resources/extensions/item_list.ts -index a53863f2fac0087cc257503d68ad706c2e3390dc..780e95cca8ccb8c95beb6ee9e9269c67c1a98bc8 100644 +index c54886a9cad14748c0fa8e05ce223c524bb4ce44..49454b0749fba2c557acf71f810381a9ba022815 100644 --- a/chrome/browser/resources/extensions/item_list.ts +++ b/chrome/browser/resources/extensions/item_list.ts @@ -12,6 +12,7 @@ import {IronA11yAnnouncer} from 'chrome://resources/polymer/v3_0/iron-a11y-annou diff --git a/patches/chrome-browser-resources-history-history.html.patch b/patches/chrome-browser-resources-history-history.html.patch index 04c0a56b23c9..0e79d3e34b21 100644 --- a/patches/chrome-browser-resources-history-history.html.patch +++ b/patches/chrome-browser-resources-history-history.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/history/history.html b/chrome/browser/resources/history/history.html -index f89232013d3efc189400143cbcc2cf7badbe4a66..70293038b432ab4579eed6a0daa28dde324afe14 100644 +index 1d2d7cba4d8d60c945345eae172301d30e1ba38c..0249e8415a6cbadc44f7552f863e633572c2b389 100644 --- a/chrome/browser/resources/history/history.html +++ b/chrome/browser/resources/history/history.html -@@ -79,6 +79,7 @@ +@@ -80,6 +80,7 @@ justify-content: center; } diff --git a/patches/chrome-browser-resources-history-history_item.html.patch b/patches/chrome-browser-resources-history-history_item.html.patch index 1f8b50f3aaf8..7f6f9eb6799a 100644 --- a/patches/chrome-browser-resources-history-history_item.html.patch +++ b/patches/chrome-browser-resources-history-history_item.html.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/history/history_item.html b/chrome/browser/resources/history/history_item.html -index ff9a505a2840ae1029f910e1f7dd080e124e99ae..034d5088670f96f361091e1adc8f8dce69d42efe 100644 +index 2aadeb66294248baaf707868c0fb4d73d68fee9f..c48ff0b835b4d772618b9525f64572b4d3048c79 100644 --- a/chrome/browser/resources/history/history_item.html +++ b/chrome/browser/resources/history/history_item.html @@ -1,4 +1,4 @@ diff --git a/patches/chrome-browser-resources-history-history_item.ts.patch b/patches/chrome-browser-resources-history-history_item.ts.patch index 82c6b83b3285..6f46539ff22c 100644 --- a/patches/chrome-browser-resources-history-history_item.ts.patch +++ b/patches/chrome-browser-resources-history-history_item.ts.patch @@ -1,10 +1,10 @@ diff --git a/chrome/browser/resources/history/history_item.ts b/chrome/browser/resources/history/history_item.ts -index bcec056bb5aa6e48c8edb540a1c9177753a135d6..1748c3f1cca60a1d9d0c9202f2da5235a0c94c43 100644 +index 9e5d67100f882fe7a47e5fce3c1b2f65e09a76c0..3c4335331e898e76f0f6c6dd42a6858b6ee5f0b3 100644 --- a/chrome/browser/resources/history/history_item.ts +++ b/chrome/browser/resources/history/history_item.ts @@ -9,6 +9,7 @@ import 'chrome://resources/cr_elements/cr_icons_css.m.js'; import 'chrome://resources/cr_elements/shared_vars_css.m.js'; - import 'chrome://resources/js/icon.m.js'; + import 'chrome://resources/js/icon.js'; import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; +import 'chrome://brave-resources/page_specific/history/brave_history_item.m.js' diff --git a/patches/chrome-browser-resources-settings-BUILD.gn.patch b/patches/chrome-browser-resources-settings-BUILD.gn.patch index 2f9e6ea572cb..0eaa589808e7 100644 --- a/patches/chrome-browser-resources-settings-BUILD.gn.patch +++ b/patches/chrome-browser-resources-settings-BUILD.gn.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resources/settings/BUILD.gn -index 15e163f0a7e5aaf341b81cab53d43be04452344b..c10677f6b4e2cd2bf6c267c23f1d79972eadd4a9 100644 +index bad0412e514359f2d16e3ada97e6764fd47cfe79..20ed910811a994093b68b1675725fb2697ee9506 100644 --- a/chrome/browser/resources/settings/BUILD.gn +++ b/chrome/browser/resources/settings/BUILD.gn -@@ -55,6 +55,7 @@ if (optimize_webui) { +@@ -53,6 +53,7 @@ if (optimize_webui) { "chrome://resources/mojo/mojo/public/js/bindings.js", "chrome://resources/mojo/skia/public/mojom/skcolor.mojom-webui.js", ] @@ -10,9 +10,9 @@ index 15e163f0a7e5aaf341b81cab53d43be04452344b..c10677f6b4e2cd2bf6c267c23f1d7997 } } -@@ -104,6 +105,7 @@ generate_grd("build_grd") { - "$target_gen_dir/$preprocess_gen_manifest", - ] +@@ -97,6 +98,7 @@ generate_grd("build_grd") { + deps += [ ":build_ts" ] + manifest_files = [ "$target_gen_dir/tsconfig.manifest" ] } + deps += [ "//brave/browser/resources/settings:resources" ] } diff --git a/patches/chrome-browser-resources-settings-about_page-about_page.js.patch b/patches/chrome-browser-resources-settings-about_page-about_page.js.patch index 431f8087c7c5..34bb16f47a6a 100644 --- a/patches/chrome-browser-resources-settings-about_page-about_page.js.patch +++ b/patches/chrome-browser-resources-settings-about_page-about_page.js.patch @@ -1,18 +1,18 @@ diff --git a/chrome/browser/resources/settings/about_page/about_page.js b/chrome/browser/resources/settings/about_page/about_page.js -index 14e8d1b3fc83229f54ee10d7bb15e2f278e94e69..23beadf6cf8cf751a487b308e1dcb599aeab4af5 100644 +index ad7ce9c1fbccecc591ffe920fefab524ed7e46d6..871d0db73b7be457670ad2eae5ddabc375ac7977 100644 --- a/chrome/browser/resources/settings/about_page/about_page.js +++ b/chrome/browser/resources/settings/about_page/about_page.js -@@ -229,7 +229,14 @@ export class SettingsAboutPageElement extends SettingsAboutPageElementBase { +@@ -215,7 +215,14 @@ export class SettingsAboutPageElement extends SettingsAboutPageElementBase { /** @private */ onRelaunchTap_() { + // + // Sparkle framework's relaunch api is used. -+ this.lifetimeBrowserProxy_.relaunchOnMac(); ++ LifetimeBrowserProxyImpl.getInstance().relaunchOnMac(); + // + + // - this.lifetimeBrowserProxy_.relaunch(); + LifetimeBrowserProxyImpl.getInstance().relaunch(); + // } diff --git a/patches/chrome-browser-resources-settings-lifetime_browser_proxy.js.patch b/patches/chrome-browser-resources-settings-lifetime_browser_proxy.js.patch deleted file mode 100644 index 742a0eae9875..000000000000 --- a/patches/chrome-browser-resources-settings-lifetime_browser_proxy.js.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/chrome/browser/resources/settings/lifetime_browser_proxy.js b/chrome/browser/resources/settings/lifetime_browser_proxy.js -index 995719c65672c1d577133c981ed570a6dab95882..b3fb0426ebe1c23a8d837529508562f4a81cb969 100644 ---- a/chrome/browser/resources/settings/lifetime_browser_proxy.js -+++ b/chrome/browser/resources/settings/lifetime_browser_proxy.js -@@ -14,6 +14,13 @@ import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; - // Triggers a browser relaunch. - relaunch() {} - -+ // -+ // Use separate api for relaunch after update on Mac. -+ // Chromium's relaunch api isn't compatible with sparkle framework. -+ // So, sparkle framework's relaunch api is used on Mac. -+ relaunchOnMac() {} -+ // -+ - // - // First signs out current user and then performs a restart. - signOutAndRestart() {} -@@ -40,6 +47,13 @@ import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; - chrome.send('relaunch'); - } - -+ // -+ /** @override */ -+ relaunchOnMac() { -+ chrome.send('relaunchOnMac'); -+ } -+ // -+ - // - /** @override */ - signOutAndRestart() { diff --git a/patches/chrome-browser-resources-settings-lifetime_browser_proxy.ts.patch b/patches/chrome-browser-resources-settings-lifetime_browser_proxy.ts.patch new file mode 100644 index 000000000000..623087be098b --- /dev/null +++ b/patches/chrome-browser-resources-settings-lifetime_browser_proxy.ts.patch @@ -0,0 +1,32 @@ +diff --git a/chrome/browser/resources/settings/lifetime_browser_proxy.ts b/chrome/browser/resources/settings/lifetime_browser_proxy.ts +index 88d9caa34016bcf9d87a908303e77bb89df48b81..a2827a32a3885c05da3722ce99328e1033fe9461 100644 +--- a/chrome/browser/resources/settings/lifetime_browser_proxy.ts ++++ b/chrome/browser/resources/settings/lifetime_browser_proxy.ts +@@ -9,6 +9,13 @@ export interface LifetimeBrowserProxy { + // Triggers a browser relaunch. + relaunch(): void; + ++ // ++ // Use separate api for relaunch after update on Mac. ++ // Chromium's relaunch api isn't compatible with sparkle framework. ++ // So, sparkle framework's relaunch api is used on Mac. ++ relaunchOnMac(): void; ++ // ++ + // + // First signs out current user and then performs a restart. + signOutAndRestart(): void; +@@ -30,6 +37,13 @@ export class LifetimeBrowserProxyImpl implements LifetimeBrowserProxy { + chrome.send('relaunch'); + } + ++ // ++ /** @override */ ++ relaunchOnMac() { ++ chrome.send('relaunchOnMac'); ++ } ++ // ++ + // + signOutAndRestart() { + chrome.send('signOutAndRestart'); diff --git a/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch b/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch index 442627403ad0..c92321b02490 100644 --- a/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch +++ b/patches/chrome-browser-resources-settings-people_page-sync_controls.js.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings/people_page/sync_controls.js b/chrome/browser/resources/settings/people_page/sync_controls.js -index b7f0e2c3c6c4fc26e25870bd5708f0eb16d7569f..7aaf03dc9916ce3af1581bd109f29824c0ea850b 100644 +index f9bc9cf75ace2d533478321e6cb067dd4a96846f..b1b03878812444f0949a759089d023ad6f947a7b 100644 --- a/chrome/browser/resources/settings/people_page/sync_controls.js +++ b/chrome/browser/resources/settings/people_page/sync_controls.js @@ -124,7 +124,7 @@ class SettingsSyncControlsElement extends SettingsSyncControlsElementBase { @@ -11,7 +11,7 @@ index b7f0e2c3c6c4fc26e25870bd5708f0eb16d7569f..7aaf03dc9916ce3af1581bd109f29824 this.browserProxy_.didNavigateToSyncPage(); } } -@@ -257,6 +257,7 @@ class SettingsSyncControlsElement extends SettingsSyncControlsElementBase { +@@ -268,6 +268,7 @@ class SettingsSyncControlsElement extends SettingsSyncControlsElementBase { * @private */ syncControlsHidden_() { diff --git a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch index c9ef9bd888bb..6952bae742db 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-personalization_options.js.patch @@ -1,5 +1,5 @@ diff --git a/chrome/browser/resources/settings/privacy_page/personalization_options.js b/chrome/browser/resources/settings/privacy_page/personalization_options.js -index 5a8630b3a7c10fce3b0f69a74c54e1c2a8a79f12..d031c337bd1c58a9bf7e49f0735c14d3d88afe1c 100644 +index 385bd9f2b4ad253d35c9c84acc0790435f3be11e..c9b8ac78b0abdfa1207c4c584e215840aef4c3d4 100644 --- a/chrome/browser/resources/settings/privacy_page/personalization_options.js +++ b/chrome/browser/resources/settings/privacy_page/personalization_options.js @@ -69,7 +69,7 @@ export class SettingsPersonalizationOptionsElement extends diff --git a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch index 1ffec017e1c5..c65cd6880cd0 100644 --- a/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch +++ b/patches/chrome-browser-resources-settings-privacy_page-privacy_page.html.patch @@ -1,8 +1,8 @@ diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html -index 07c8a1c383f4dbd94b89663394a2dbc69491e435..8e42b4766ef4896fbc09be4752fb760f4ea86925 100644 +index 56a342be7add7a2227d9f66c0eb2d2e9d19337d6..80ac5a517f8a1b1d0fc3fe1f1d3cdccd8281dea4 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html -@@ -29,6 +29,7 @@ +@@ -35,6 +35,7 @@

@@ -10,7 +10,7 @@ index 07c8a1c383f4dbd94b89663394a2dbc69491e435..8e42b4766ef4896fbc09be4752fb760f @@ -18,7 +18,7 @@ index 07c8a1c383f4dbd94b89663394a2dbc69491e435..8e42b4766ef4896fbc09be4752fb760f @@ -26,7 +26,7 @@ index 07c8a1c383f4dbd94b89663394a2dbc69491e435..8e42b4766ef4896fbc09be4752fb760f