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

android chromium-130 changes #86

Merged
merged 6 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public BraveNtpAdapter(Activity activity, OnBraveNtpListener onBraveNtpListener,
mIsNewsLoading = isNewsLoading;
mRecyclerViewHeight = recyclerViewHeight;
mIsTopSitesEnabled = isTopSitesEnabled;
mIsBraveStatsEnabled = isBraveStatsEnabled;
mIsBraveStatsEnabled = false;
mIsDisplayNewsFeed = false;
mIsDisplayNewsOptin = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected void onFinishInflate() {

mVpnCta = findViewById(R.id.tv_try_vpn);
if (BraveVpnUtils.isVpnFeatureSupported(getContext())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we just added a false in this If block then then else block would have hidden this as well? and the number of changes would become minimum which reduces the chances of conflicts later on

&& !BraveVpnNativeWorker.getInstance().isPurchasedUser()) {
&& !BraveVpnNativeWorker.getInstance().isPurchasedUser() || false) {
mVpnCta.setOnClickListener(
v -> {
if (!InternetConnection.isNetworkAvailable(getContext())) {
Expand Down
2 changes: 1 addition & 1 deletion android/java/org/chromium/chrome/browser/ntp/NtpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void setDisplayTopSites(boolean shouldDisplayTopSites) {

public static boolean shouldDisplayBraveStats() {
return ChromeSharedPreferences.getInstance()
.readBoolean(BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS, true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing true to false here would also set this preference as false and thus would return false? and we wouldn't need to comment the whole line. minimizing changes done in existing brave code is important because it will help speed up syncing with latest brave branch in future

Copy link
Collaborator Author

@Nikhil7174 Nikhil7174 Nov 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here func will first check what value does BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS returns if it returns true then func will return true, if false then func will return false and if the value does not exists then it will return true by default. So a possibility of returning true will still remain even if default value is set to false.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this default preference is not set anywhere else then it is being set from here. If we make this false by default then it'll return false the first time and since we have hidden all other options to change this preference therefore preference will never change to true

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

.readBoolean(BackgroundImagesPreferences.PREF_SHOW_BRAVE_STATS, false);
}

public static void setDisplayBraveStats(boolean shouldDisplayBraveStats) {
Expand Down
1 change: 0 additions & 1 deletion android/java/res/layout/brave_shields_tooltip_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
android:layout_marginTop="14dp"
android:padding="16dp"
android:drawablePadding="10dp"
app:drawableStartCompat="@drawable/ic_brave_36"
android:text="@string/shield_tooltip_desc"
android:textSize="14sp"
android:textColor="@color/onboarding_welcome_text_color"
Expand Down
16 changes: 10 additions & 6 deletions android/java/res/layout/new_tab_page_incognito.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<!-- Keep the ID below as it's been tested in Chromium code by IncognitoNewTabPageStation. -->
<ImageView
android:visibility="gone"
android:id="@+id/new_tab_incognito_icon"
android:layout_width="@dimen/new_tab_page_incognito_logo_size"
android:layout_height="@dimen/new_tab_page_incognito_logo_size"
Expand All @@ -64,14 +65,13 @@
android:layout_height="wrap_content"
android:text="@string/brave_new_tab_private_header"
android:textColor="@color/brave_white"
android:layout_marginStart="14dp"
android:layout_marginBottom="64dp"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/tv_first_title"
app:layout_constraintStart_toEndOf="@+id/new_tab_incognito_icon"
app:layout_constraintEnd_toEndOf="@id/guideline_end"
/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
android:layout_marginBottom="24dp"
/>

<ImageView
android:id="@+id/iv_first_icon"
Expand Down Expand Up @@ -161,6 +161,7 @@
/>

<ImageView
android:visibility="invisible"
android:id="@+id/iv_third_icon"
app:layout_constraintHorizontal_chainStyle="packed"
android:layout_width="@dimen/new_tab_page_incognito_icon_size"
Expand All @@ -174,6 +175,7 @@
/>

<TextView
android:visibility="invisible"
android:id="@+id/tv_third_title"
style="@style/DefaultSemibold"
app:layout_constraintWidth_max="460dp"
Expand All @@ -189,6 +191,7 @@
/>

<TextView
android:visibility="invisible"
android:id="@+id/tv_third_description"
style="@style/DefaultRegular"
android:layout_width="0dp"
Expand All @@ -203,6 +206,7 @@
/>

<TextView
android:visibility="invisible"
android:id="@+id/tv_try_vpn"
style="@style/DefaultSemibold"
android:layout_width="0dp"
Expand Down
180 changes: 68 additions & 112 deletions browser/ui/android/strings/android_brave_strings.grd

Large diffs are not rendered by default.

313 changes: 162 additions & 151 deletions browser/ui/android/strings/android_chrome_strings.grd

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions third_party/npm_react-pdf/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) React Training 2016-2018

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion third_party/npm_react-pdf/README.chromium
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: react-dropzone
Name: react-pdf
URL: https://github.com/wojtekmaj/react-pdf
License: MIT
License File: /brave/node_modules/react-pdf/license
Loading