Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrade from Chromium 93 to Chromium 94. #9558

Merged
merged 124 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
96e9aa2
Updated patches from Chromium 93.0.4557.63 to Chromium 94.0.4583.0.
mariospr Aug 13, 2021
7c173b1
Conflict-resolved patches from Chromium 93.0.4557.63 to Chromium 94.0…
mariospr Aug 13, 2021
474354c
ProfilePicker migrated to TypeScript.
mkarolin Jul 22, 2021
89b28bc
[MacOS] Notifications no longer use XPC service.
mkarolin Jul 22, 2021
7ac07ce
Updated strings for Chromium 94.0.4583.0.
mkarolin Jul 22, 2021
2d63f71
web_applications/components/BUILD.gn was merged into web_applications.
mkarolin Jul 22, 2021
415bed1
fieldtrial_testing_like_official_build GN flag was renamed.
mkarolin Jul 22, 2021
d29abac
PermissionRequestImpl was deleted.
mkarolin Jul 22, 2021
fd000ea
HttpNetworkSession::Params moved out of class scope.
mkarolin Jul 22, 2021
4921cbf
IWYU: url_response_head.mojom.h
mkarolin Jul 22, 2021
204de80
sql::Statement::ColumnBlob() now returns base::span.
mkarolin Jul 22, 2021
b0f3a3f
TabHoverCardBubbleView uses internal FadeLabel class.
mkarolin Jul 22, 2021
9caffb7
ListValue::GetInteger was removed.
mkarolin Jul 22, 2021
05c6b57
Value->DictItems in range-based for loops shouldn't bind to reference.
mkarolin Jul 22, 2021
30728fe
IWYU: base/metrics/histogram_macros.h
mkarolin Jul 23, 2021
6998070
Browser::deprecated_is_app was removed.
mkarolin Jul 23, 2021
951a62b
sql::Database::ExecuteAndReturnErrorCode became private.
mkarolin Jul 23, 2021
92eb6dd
install_static::ChannelStrategy values are now conditional on branding.
mkarolin Jul 23, 2021
cd83f50
Modernize TabHoverCardBubbleViewBrowserTest browser tests
mariospr Jul 26, 2021
c63c0c7
Convert double-quoted SQL string literals to single-quoted.
mariospr Jul 26, 2021
cc60d2a
[Android] Explicitly added header for PermissionPromptAndroid
samartnik Jul 27, 2021
5e6d231
[Android] Changes to privacy policy in settings page
samartnik Jul 27, 2021
9686dfa
Updated patches from Chromium 94.0.4583.0 to Chromium 94.0.4589.2.
mariospr Jul 28, 2021
82b313c
Conflict-resolved patches from Chromium 94.0.4583.0 to Chromium 94.0.…
mariospr Jul 28, 2021
2441ed3
[MacOS] Fixup Brave ad notifications
mariospr Jul 28, 2021
6dc899e
Adapt to //base/util/timer -> //base/timer refactoring.
mariospr Jul 28, 2021
b375955
Adapt to //base/util/values -> //base/json refactoring.
mariospr Jul 28, 2021
1eb4122
Adapt caller to use SyncServiceImpl::StopAndClear()
mariospr Jul 28, 2021
c8cfbcf
Updated strings for Chromium 94.0.4589.2.
mariospr Jul 28, 2021
c6219d4
Migrate usage of base::ClampToRange() to base::clamp()
mariospr Jul 28, 2021
562f648
Migrate usages of ui::ScaleFactor to ui::ResourceScaleFactor
mariospr Jul 28, 2021
c8a3400
Migrate to BrowserList::{begin,end}_browsers_ordered_by_activation
mariospr Jul 28, 2021
d114843
Migrate references to prefs::kOfferTranslateEnabled
mariospr Jul 28, 2021
fa222da
IWYU: mojo/public/cpp/bindings/receiver.h
mariospr Jul 28, 2021
5de37da
Fix build due to missing include for network::ResourceRequest upstream
mariospr Jul 28, 2021
2782e0a
Fix crash loading brave://version after upgrade to 94.0.4589.2
mariospr Jul 28, 2021
afd3471
Fix crashing BraveTranslateBubbleViewTest unit tests
mariospr Jul 29, 2021
b15bb2d
[Android] Fix for Android 12 as a target
samartnik Jul 29, 2021
08d6e7a
[Android] Added resource for the Dino Widget
samartnik Jul 29, 2021
f2fdd50
Fix the browser tests falling through to global NativeTheme
aseren Jul 29, 2021
0a9d4c8
[Android] Fixes for tests
samartnik Jul 30, 2021
b0f7044
Updated patches from Chromium 94.0.4589.2 to Chromium 94.0.4590.5.
mariospr Jul 30, 2021
8b81b4e
Conflict-resolved patches from Chromium 94.0.4589.2 to Chromium 94.0.…
mariospr Jul 30, 2021
eb52718
Updated strings for Chromium 94.0.4590.5.
mariospr Jul 30, 2021
c5875f8
Adapt to updated constructor for TabMenuModel
mariospr Aug 2, 2021
43ddeb4
IWYU: base/time/time.h
mkarolin Aug 2, 2021
b0638d9
ChannelStrategy::ADDITIONAL_PARAMETERS -> FLOATING.
mkarolin Aug 2, 2021
0d5249e
Adapt to the relocation of features::kLangClientHintHeader to Blink
mariospr Aug 2, 2021
d72b8db
[Android] Fixes for resources and lint
samartnik Aug 3, 2021
1863efc
Updated patches from Chromium 94.0.4590.5 to Chromium 94.0.4595.3
mariospr Aug 4, 2021
747fb32
Conflict-resolved patches from Chromium 94.0.4590.5 to Chromium 94.0.…
mariospr Aug 4, 2021
26ca19b
Adapt to relocation of histogram_suffixes_list.xml
mariospr Aug 4, 2021
0e115c1
Add missing parameter to PrepopulatedEngine's constructor
mariospr Aug 4, 2021
34c1650
Update strings for Chromium 94.0.4595.3.
mariospr Aug 4, 2021
35e0c1b
Adapt to removal of DictionaryValue::GetStringWithoutPathExpansion()
mariospr Aug 4, 2021
1b6ddf9
Migrate our storage::LocalStorageImpl override to using StorageKey
mariospr Aug 4, 2021
c097cd2
Add missing parameter to PrepopulatedEngine's constructor II
samartnik Aug 4, 2021
e7fa7f9
[Android] Changes for triggerUrlFocusAnimation
samartnik Aug 4, 2021
88ef47d
Add missing //ui/aura:test_support dep in brave_browser_tests target
mariospr Aug 9, 2021
e827690
Fix wrong ifndef guards in Braveledger database migraions
mariospr Aug 9, 2021
5f43e5e
Updated patches from Chromium 94.0.4595.3 to Chromium 94.0.4603.0
mariospr Aug 12, 2021
24e2697
Conflict-resolved patches from Chromium 94.0.4595.3 to Chromium 94.0.…
mariospr Aug 12, 2021
e60593d
Update strings to Chromium 94.0.4603.0
mariospr Aug 12, 2021
0d92f2b
Adapt patch to //c/b/r/settings/lifetime_browser_proxy.{js => ts} mig…
mariospr Aug 12, 2021
3df36d1
Adapt patch to //c/b/r/settings/settings.{js => ts} migration
mariospr Aug 12, 2021
1953271
Migrate away from Value::GetAsDouble() and use GetDouble() instead
mariospr Aug 12, 2021
a31194c
State that ~BraveP3ALogStore() overrides metrics::LogStore::~LogStore
mariospr Aug 12, 2021
2171fe1
Pass the right object to DOMStorageContextWrapper::DeleteLocalStorage()
mariospr Aug 12, 2021
7122f76
IWYU: chrome/services/qrcode_generator/public/mojom/qrcode_generator.…
mariospr Aug 12, 2021
904206d
Adapt to removal of only parameter in View::RemoveAllChildViews()
mariospr Aug 12, 2021
08d9a5f
Supply the cookie_partition_key argument to CanonicalCookie::Create()
mariospr Aug 12, 2021
b4802ea
Adapt to change in content_settings.mojom.AllowStorageAccess signature
mariospr Aug 12, 2021
7208615
Use a randomly-generated extension when creating a fake MimeClassInfo
mariospr Aug 12, 2021
a3129e0
Disable the kNavigatorPluginsFixed feature to use Brave's farbling code
mariospr Aug 16, 2021
8d368ac
[Android] Fix for browser tests
samartnik Aug 12, 2021
0b57ee4
[Android] Changes for toolbar color retrieval
samartnik Aug 13, 2021
d328693
Win installer no longer uses ap channel override
mkarolin Aug 18, 2021
d3df99d
[Android] Fixes for unit tests
samartnik Aug 18, 2021
3e66eba
Updated patches from Chromium 94.0.4603.0 to Chromium 94.0.4606.12.
mariospr Aug 20, 2021
524e77a
Conflict-resolved patches from Chromium 94.0.4603.0 to Chromium 94.0.…
mariospr Aug 20, 2021
659d247
Adapt to addition of EnforceRange decorator to getImageData() methods
mariospr Aug 18, 2021
7e0154f
Update strings to Chromium 94.0.4606.12.
mariospr Aug 20, 2021
0b6ef38
Adapt to pointer parameter migrated into a reference
mariospr Aug 18, 2021
24d6fc0
Recover the ColorIdForValidity() utility method for our override
mariospr Aug 18, 2021
4059a4f
Remove include to a no longer existing file
mariospr Aug 18, 2021
70e48d8
Remove unused references to Blink data types
mariospr Aug 18, 2021
87ba3e9
Fix precision lost upon unsigned_long -> int conversion
mariospr Aug 18, 2021
ca93397
Pass new skip_tab_checking parameter to ShowIfNotOffTheRecordProfile()
mariospr Aug 18, 2021
038f699
Adapt to rename of CanBlocklistSite() -> CanAddSiteToNeverPromptList()
mariospr Aug 18, 2021
5a800ac
Add kTransportSecurityPersisterFilename to our chromium_src override
mariospr Aug 18, 2021
59407e2
[Android] Removed SignInAllowedObserver
samartnik Aug 24, 2021
8839165
Conflict-resolved patches from Chromium 94.0.4606.12 to Chromium 94.0…
mkarolin Aug 25, 2021
237abfa
Updated patches from Chromium 94.0.4606.12 to Chromium 94.0.4606.20.
mkarolin Aug 25, 2021
01f77f7
Updated strings for Chromium 94.0.4606.20.
mkarolin Aug 26, 2021
f9781ed
[Android] Added DEP for unit tests
samartnik Aug 27, 2021
4461a52
[MacOS] Adapt to KeychainPassword changes.
mkarolin Aug 30, 2021
3f7d045
[iOS] ApplicationBreadcrumbsLogger was migrated to a component.
mkarolin Aug 31, 2021
e32cc20
[iOS] Clean exit implementation was merged with CleanExitBeacon
mkarolin Aug 31, 2021
e87c6bc
[iOS] Pick up upstream change to IOSChromeMetricsServiceClient::GetBr…
mkarolin Aug 31, 2021
6ff9147
[iOS] IOSChromeMetricsServiceClient::OnRendererProcessCrash was removed.
mkarolin Aug 31, 2021
2f3a03a
[iOS] Get around private field is not used compilation error.
mkarolin Aug 31, 2021
4d0576f
[iOS] Workaround an upstream bug with credential provider extension.
mkarolin Aug 31, 2021
99301ce
Updated chrome/common/chrome_constants.cc override.
mkarolin Aug 31, 2021
9591d0b
Formatting fixes.
mkarolin Sep 1, 2021
dcae460
Update python version to 3 for tools/android/generate_breakpad_symbol…
AlexeyBarabash Sep 1, 2021
e509b80
[MacOS][Signing] Revert overwriting Alerts helper app id.
mkarolin Sep 1, 2021
faa7a90
Conflict-resolved patches from Chromium 94.0.4606.20 to Chromium 94.0…
mkarolin Sep 1, 2021
f6a0cc5
Updated patches from Chromium 94.0.4606.20 to Chromium 94.0.4606.31.
mkarolin Sep 1, 2021
46ee3b7
Updated strings for Chromium 94.0.4606.31.
mkarolin Sep 1, 2021
b3e9251
Adapt to the relocation of features::kLangClientHintHeader to Blink II.
mkarolin Sep 1, 2021
e1ad7ee
Remove dependency on no longer existing target //base/util/timer:timer
mariospr Sep 2, 2021
96848fb
Remove stray include on base/util/values/values_util.h
mariospr Sep 2, 2021
efef70c
Migrate includes for //base/util/values to //base/json
mariospr Sep 2, 2021
d82620a
[Android] New c-tor signature for FeedSurfaceCoordinator
samartnik Sep 2, 2021
de53439
Shifted Brave resource ids higher.
mkarolin Sep 2, 2021
d58b76c
Fixes settings import error.
mkarolin Sep 2, 2021
1fee742
Fixes relocation of Privacy section in Settings.
mkarolin Sep 3, 2021
9c64c33
[iOS] Updated brave_providers target to be in sync with chromium_prov…
mkarolin Sep 8, 2021
ddabe67
Conflict-resolved patches from Chromium 94.0.4606.31 to Chromium 94.0…
mkarolin Sep 8, 2021
f153ced
Updated patches from Chromium 94.0.4606.31 to Chromium 94.0.4606.41.
mkarolin Sep 8, 2021
a7783f0
Updated strings for Chromium 94.0.4606.41.
mkarolin Sep 8, 2021
2101f7f
Revert "Merge pull request #9849 from brave/cr93_first_run_regression"
mkarolin Sep 9, 2021
111a264
[Android] Fixed unit tests for BravePrivacySettings
samartnik Sep 12, 2021
0f28b12
Settings rollup uses tsc folder now.
mkarolin Sep 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 23 additions & 1 deletion android/browsertests_apk/AndroidManifest.xml.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down Expand Up @@ -109,6 +110,27 @@
</intent-filter>
</receiver>

<receiver android:name="org.chromium.chrome.browser.quickactionsearchwidget.QuickActionSearchWidgetProvider$QuickActionSearchWidgetProviderSmall"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
</receiver>

<receiver android:name="org.chromium.chrome.browser.quickactionsearchwidget.QuickActionSearchWidgetProvider$QuickActionSearchWidgetProviderMedium"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
</receiver>

<receiver android:name="org.chromium.chrome.browser.quickactionsearchwidget.QuickActionSearchWidgetProvider$QuickActionSearchWidgetProviderDino"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
</receiver>

<service android:name="org.chromium.components.background_task_scheduler.BackgroundTaskJobService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ScrollView;

Expand Down Expand Up @@ -51,13 +52,14 @@ public BraveFeedSurfaceCoordinator(Activity activity, SnackbarManager snackbarMa
PrivacyPreferencesManagerImpl privacyPreferencesManager,
@NonNull Supplier<Toolbar> 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
Expand Down
3 changes: 2 additions & 1 deletion android/java/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@

<activity
android:name="org.chromium.chrome.browser.widget.crypto.binance.BinanceActivity"
android:theme="@style/Theme.Chromium.Activity.Fullscreen">
android:theme="@style/Theme.Chromium.Activity.Fullscreen"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
Expand Down
4 changes: 4 additions & 0 deletions android/java/apk_for_test.flags
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,7 @@
-keep class org.chromium.chrome.browser.toolbar.menu_button.BraveMenuButtonCoordinator {
public <init>(...);
}

-keep class org.chromium.chrome.browser.theme.ThemeUtils {
*** getTextBoxColorForToolbarBackgroundInNonNativePage(...);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -88,6 +89,7 @@ public void insertTopSite(TopSite topSite) {
}
}

@SuppressLint("Range")
public List<TopSiteTable> getAllTopSites() {
List<TopSiteTable> topSites = new ArrayList<>();

Expand Down Expand Up @@ -168,6 +170,7 @@ private boolean isAdsTrackerAlreadyAdded(BraveStatsTable braveStat) {
return count > 0;
}

@SuppressLint("Range")
public List<BraveStatsTable> getAllStats() {
List<BraveStatsTable> braveStats = new ArrayList<>();

Expand Down Expand Up @@ -198,6 +201,7 @@ public List<BraveStatsTable> getAllStats() {
return braveStats;
}

@SuppressLint("Range")
public List<BraveStatsTable> getAllStatsWithDate(String thresholdTime, String currentTime) {
List<BraveStatsTable> braveStats = new ArrayList<>();
// Select All Query
Expand Down Expand Up @@ -229,6 +233,7 @@ public List<BraveStatsTable> getAllStatsWithDate(String thresholdTime, String cu
return braveStats;
}

@SuppressLint("Range")
public List<Pair<String, Integer>> getStatsWithDate(String thresholdTime, String currentTime) {
List<Pair<String, Integer>> braveStats = new ArrayList<>();

Expand All @@ -254,6 +259,7 @@ public List<Pair<String, Integer>> getStatsWithDate(String thresholdTime, String
return braveStats;
}

@SuppressLint("Range")
public List<Pair<String, Integer>> getSitesWithDate(String thresholdTime, String currentTime) {
List<Pair<String, Integer>> braveStats = new ArrayList<>();
// Select All Query
Expand Down Expand Up @@ -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 "
Expand All @@ -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 "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ void setIncognitoCookieControlsToggleEnforcement(@CookieControlsEnforcement int
*/
void setIncognitoCookieControlsIconOnclickListener(OnClickListener listener) {}

void setIncognitoNewTabHeader(String newTabPageHeader) {}

@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -45,7 +45,7 @@ class BottomToolbarNewTabButton extends ChromeImageButton
public BottomToolbarNewTabButton(Context context, AttributeSet attrs) {
super(context, attrs);

mResources = context.getResources();
mContext = context;
}

@Override
Expand Down Expand Up @@ -105,7 +105,7 @@ private void updateBackground() {
return;
}
mBackground.setColorFilter(
ThemeUtils.getTextBoxColorForToolbarBackgroundInNonNativePage(mResources,
ThemeUtils.getTextBoxColorForToolbarBackgroundInNonNativePage(mContext,
mThemeColorProvider.getThemeColor(),
mThemeColorProvider.useLight()
&& mIncognitoStateProvider.isIncognitoSelected()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions android/java/res/xml/legal_information_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
android:title="@string/google_terms_of_service_title"
app:url="@string/brave_terms_of_service_url" />
<org.chromium.chrome.browser.about_settings.HyperlinkPreference
android:key="privacy_notice"
android:title="@string/privacy_notice_title"
android:key="privacy_policy"
android:title="@string/privacy_policy_title"
app:url="@string/brave_privacy_notice_url" />
<Preference
android:fragment="org.chromium.chrome.browser.settings.BraveLicensePreferences"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.support.test.filters.SmallTest;
import android.view.View;
import android.view.ViewGroup;

import androidx.appcompat.app.AppCompatActivity;
import androidx.test.filters.SmallTest;

import org.junit.Assert;
import org.junit.Test;
Expand Down Expand Up @@ -71,8 +71,8 @@
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
import org.chromium.components.browser_ui.widget.scrim.ScrimCoordinator;
import org.chromium.components.embedder_support.browser_context.BrowserContextHandle;
import org.chromium.components.permissions.PermissionDialogController;
import org.chromium.content_public.browser.BrowserContextHandle;
import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.modaldialog.ModalDialogManager;
import org.chromium.ui.modelutil.PropertyModel;
Expand Down Expand Up @@ -195,6 +195,7 @@ public void testClassesExist() throws Exception {
"org/chromium/chrome/browser/toolbar/menu_button/MenuButtonCoordinator"));
Assert.assertTrue(classExists(
"org/chromium/chrome/browser/toolbar/menu_button/BraveMenuButtonCoordinator"));
Assert.assertTrue(classExists("org/chromium/chrome/browser/theme/ThemeUtils"));
}

@Test
Expand Down Expand Up @@ -293,6 +294,8 @@ public void testMethodsExist() throws Exception {
Assert.assertTrue(
methodExists("org/chromium/chrome/browser/feed/BraveFeedSurfaceCoordinator",
"isReliabilityLoggingEnabled", false, null));
Assert.assertTrue(methodExists("org/chromium/chrome/browser/theme/ThemeUtils",
"getTextBoxColorForToolbarBackgroundInNonNativePage", false, null));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import static org.junit.Assert.assertEquals;

import android.os.Bundle;
import android.support.test.filters.SmallTest;

import androidx.test.filters.SmallTest;

import org.junit.Before;
import org.junit.Rule;
Expand Down
Loading