Skip to content

Commit

Permalink
[Android] Updates for omnibox icons
Browse files Browse the repository at this point in the history
Updated omnibox icons as part of this issue `Android :: Update "lock" icon to "tune" icon in address bar` brave/brave-browser#32380

Chromium change:
brave/chromium@13c5957

Add Chrome2023 refresh Secure icon on Android
The Chrome2023 refresh changes are specific to desktop, but the lock
icon replacement is meant to launch on Android too. This adds it
reusing the kUpdatedConnectionSecurityIndicators flag, which previously
controlled the chevron experiment. This CL also removes the chevron
icon.

Bug: 1468591
  • Loading branch information
samartnik committed Aug 23, 2023
1 parent 889eaa0 commit 31c6143
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2023 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 https://mozilla.org/MPL/2.0/.
-->
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<org.chromium.chrome.browser.omnibox.status.StatusIconView
android:id="@+id/location_bar_status_icon_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:visibility="visible"
android:focusable="false">

<FrameLayout
android:id="@+id/location_bar_status_icon_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent">

<!--The background need to be on top of the icon to make sure draw background first, otherwise the background will cover the icon.-->
<View
android:id="@+id/location_bar_status_icon_bg"
android:layout_width="@dimen/location_bar_status_icon_bg_size"
android:layout_height="@dimen/location_bar_status_icon_bg_size"
android:layout_gravity="center"
android:visibility="invisible"
android:background="@drawable/status_icon_background"/>

<org.chromium.ui.widget.ChromeImageView
android:id="@+id/location_bar_status_icon"
style="@style/OmniboxIcon"
android:layout_gravity="center"
android:src="@android:color/transparent"
android:visibility="visible"
android:layout_width="@dimen/brave_omnibox_icon_size"
android:layout_height="@dimen/brave_omnibox_icon_size"
android:scaleType="fitXY"
android:focusable="false"
tools:ignore="ContentDescription" />

</FrameLayout>

<Space android:id="@+id/location_bar_status_icon_holding_space"
android:layout_width="@dimen/location_bar_status_icon_holding_space_size"
android:layout_height="match_parent"
android:visibility="gone"
android:focusable="false" />

</org.chromium.chrome.browser.omnibox.status.StatusIconView>
</merge>
1 change: 1 addition & 0 deletions browser/ui/android/omnibox/java/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
<dimen name="omnibox_brave_search_banner_height">150dp</dimen>
<dimen name="omnibox_brave_search_banner_text_desc_right_margin">30dp</dimen>
<dimen name="omnibox_brave_search_banner_text_desc_top_margin">4dp</dimen>
<dimen name="brave_omnibox_icon_size">20dp</dimen>
</resources>
8 changes: 7 additions & 1 deletion build/commands/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ const util = {
const androidDownloadInternalResDest = path.join(config.srcDir, 'chrome', 'browser', 'download', 'internal', 'android', 'java', 'res')
const androidFeaturesTabUiResSource = path.join(config.braveCoreDir, 'android', 'features', 'tab_ui', 'java', 'res')
const androidFeaturesTabUiDest = path.join(config.srcDir, 'chrome', 'android', 'features', 'tab_ui', 'java', 'res')
const androidComponentsOmniboxResSource = path.join(config.braveCoreDir, 'components', 'omnibox', 'browser', 'android', 'java', 'res')
const androidComponentsOmniboxResDest = path.join(config.srcDir, 'components', 'omnibox', 'browser', 'android', 'java', 'res')
const androidBrowserUiOmniboxResSource = path.join(config.braveCoreDir, 'browser', 'ui', 'android', 'omnibox', 'java', 'brave_res')
const androidBrowserUiOmniboxResDest = path.join(config.srcDir, 'chrome', 'browser', 'ui', 'android', 'omnibox', 'java', 'res')

// Mapping for copying Brave's Android resource into chromium folder.
const copyAndroidResourceMapping = {
Expand All @@ -405,7 +409,9 @@ const util = {
[androidComponentsStylesResSource]: [androidComponentsStylesResDest],
[androidSafeBrowsingResSource]: [androidSafeBrowsingResDest],
[androidDownloadInternalResSource]: [androidDownloadInternalResDest],
[androidFeaturesTabUiResSource]: [androidFeaturesTabUiDest]
[androidFeaturesTabUiResSource]: [androidFeaturesTabUiDest],
[androidComponentsOmniboxResSource]: [androidComponentsOmniboxResDest],
[androidBrowserUiOmniboxResSource]: [androidBrowserUiOmniboxResDest]
}

console.log('copy Android app icons and app resources')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2023 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 https://mozilla.org/MPL/2.0/.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="14dp"
android:height="14dp"
android:viewportWidth="14"
android:viewportHeight="14">
<path
android:pathData="M1.75,4.315C1.75,5.568 2.764,6.582 4.017,6.582C5.049,6.582 5.956,5.884 6.213,4.882L6.236,4.793H10.58C10.842,4.793 11.057,4.578 11.057,4.315C11.057,4.053 10.842,3.838 10.58,3.838H6.236L6.213,3.749C5.956,2.746 5.049,2.048 4.017,2.048C2.764,2.048 1.75,3.063 1.75,4.315ZM2.705,4.315C2.705,3.594 3.295,3.003 4.017,3.003C4.739,3.003 5.33,3.594 5.33,4.315C5.33,5.037 4.739,5.628 4.017,5.628C3.295,5.628 2.705,5.037 2.705,4.315ZM7.787,10.252C8.044,11.254 8.951,11.952 9.983,11.952C11.236,11.952 12.25,10.938 12.25,9.685C12.25,8.432 11.236,7.418 9.983,7.418C8.951,7.418 8.044,8.116 7.787,9.118L7.764,9.207H3.42C3.158,9.207 2.943,9.422 2.943,9.685C2.943,9.947 3.158,10.162 3.42,10.162H7.764L7.787,10.252ZM8.67,9.685C8.67,8.963 9.261,8.372 9.983,8.372C10.705,8.372 11.295,8.963 11.295,9.685C11.295,10.407 10.705,10.997 9.983,10.997C9.261,10.997 8.67,10.407 8.67,9.685Z"
android:fillColor="#687485"
android:fillType="evenOdd"/>
</vector>

0 comments on commit 31c6143

Please sign in to comment.