-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gbb-cct] PageInsights module skeleton
This CL introduces a new module under chrome/browser/ui/android/page_insights and the UI skeleton based on bottom sheet. Its entry for now is via a new item in 3-dot menu. Bug: b/282739536 Change-Id: I145a2ae4e596799d567c90c3e4107b41e4eb2641 Low-Coverage-Reason: Main changes are covered with tests. RootUiCoordinator contains a simple invocation of the new module. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4557624 Reviewed-by: Kevin Grosu <kgrosu@google.com> Reviewed-by: Matthew Jones <mdjones@chromium.org> Reviewed-by: Theresa Sullivan <twellington@chromium.org> Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org> Reviewed-by: Michael Thiessen <mthiesse@chromium.org> Cr-Commit-Position: refs/heads/main@{#1150510}
- Loading branch information
Showing
25 changed files
with
924 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
chrome/android/java/res/layout/page_insights_hub_container.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2023 The Chromium Authors | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. | ||
--> | ||
<FrameLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:clipChildren="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Copyright 2023 The Chromium Authors | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//build/config/android/config.gni") | ||
import("//build/config/android/rules.gni") | ||
|
||
android_library("java") { | ||
sources = [ | ||
"java/src/org/chromium/chrome/browser/page_insights/PageInsightsCoordinator.java", | ||
"java/src/org/chromium/chrome/browser/page_insights/PageInsightsMediator.java", | ||
"java/src/org/chromium/chrome/browser/page_insights/PageInsightsSheetContent.java", | ||
] | ||
|
||
deps = [ | ||
":java_resources", | ||
"//base:base_java", | ||
"//chrome/browser/browser_controls/android:java", | ||
"//chrome/browser/tab:java", | ||
"//components/browser_ui/bottomsheet/android:java", | ||
"//components/browser_ui/bottomsheet/android:manager_java", | ||
"//components/browser_ui/widget/android:java", | ||
"//third_party/androidx:androidx_annotation_annotation_java", | ||
"//ui/android:ui_no_recycler_view_java", | ||
"//url:gurl_java", | ||
] | ||
resources_package = "org.chromium.chrome.browser.page_insights" | ||
} | ||
|
||
android_resources("java_resources") { | ||
sources = [ | ||
"java/res/drawable/page_insights_icon.xml", | ||
"java/res/layout/page_insights_sheet_toolbar.xml", | ||
] | ||
deps = [ | ||
"//chrome/browser/ui/android/strings:ui_strings_grd", | ||
"//components/browser_ui/bottomsheet/android:java_resources", | ||
"//components/browser_ui/widget/android:java_resources", | ||
] | ||
} | ||
|
||
android_library("unit_device_javatests") { | ||
testonly = true | ||
resources_package = "org.chromium.chrome.browser.page_insights" | ||
|
||
sources = [ | ||
"java/src/org/chromium/chrome/browser/page_insights/PageInsightsCoordinatorTest.java", | ||
"java/src/org/chromium/chrome/browser/page_insights/PageInsightsSheetContentTest.java", | ||
] | ||
deps = [ | ||
":java", | ||
":java_resources", | ||
"//base:base_java", | ||
"//base:base_java_test_support", | ||
"//chrome/android:chrome_java", | ||
"//chrome/browser/browser_controls/android:java", | ||
"//chrome/browser/flags:java", | ||
"//chrome/browser/tab:java", | ||
"//chrome/test/android:chrome_java_integration_test_support", | ||
"//components/browser_ui/bottomsheet/android:factory_java", | ||
"//components/browser_ui/bottomsheet/android:java", | ||
"//components/browser_ui/bottomsheet/android:manager_java", | ||
"//components/browser_ui/bottomsheet/android/test:java", | ||
"//components/browser_ui/widget/android:java", | ||
"//content/public/test/android:content_java_test_support", | ||
"//third_party/androidx:androidx_test_runner_java", | ||
"//third_party/junit:junit", | ||
"//third_party/mockito:mockito_java", | ||
"//ui/android:ui_java_test_support", | ||
"//ui/android:ui_utils_java", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
include_rules = [ | ||
"+chrome/browser/browser_controls/android", | ||
"+chrome/browser/tab", | ||
"+chrome/browser/tabmodel", | ||
"+components/browser_ui/bottomsheet/android", | ||
"+components/browser_ui/widget/android", | ||
"+components/embedder_support/android", | ||
"+content/public/android", | ||
"+ui/android", | ||
"+url/android", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
monorail { | ||
component: "UI>Browser>Mobile>CustomTabs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
jinsukkim@chromium.org | ||
kgrosu@google.com |
33 changes: 33 additions & 0 deletions
33
chrome/browser/ui/android/page_insights/java/res/drawable/page_insights_icon.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2023 The Chromium Authors | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. | ||
--> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M12.8909 10.99H11.2559V17.065H12.8909V10.99Z" | ||
android:fillColor="#4285F4"/> | ||
<path | ||
android:pathData="M12.0009 9.2299C12.2609 9.2299 12.4759 9.1449 12.6559 8.9749C12.8309 8.8049 12.9209 8.5899 12.9209 8.3399C12.9209 8.0699 12.8309 7.8449 12.6559 7.6649C12.4809 7.4849 12.2609 7.3999 12.0009 7.3999C11.7359 7.3999 11.5159 7.4899 11.3459 7.6649C11.1709 7.8449 11.0859 8.0649 11.0859 8.3349C11.0859 8.5899 11.1759 8.8049 11.3509 8.9749C11.5209 9.1399 11.7409 9.2299 12.0009 9.2299Z" | ||
android:fillColor="#4285F4"/> | ||
<path | ||
android:pathData="M18.3491 10.6749C18.3491 9.22992 17.8441 8.00492 16.8391 6.99992C15.8341 5.99492 14.6041 5.48992 13.1641 5.48992C14.6091 5.48992 15.8341 4.98492 16.8391 3.97992C17.8441 2.97492 18.3491 1.74492 18.3491 0.294922C18.3491 1.74492 18.8541 2.96992 19.8591 3.97992C20.8641 4.98492 22.0941 5.48992 23.5441 5.48992C22.0941 5.48992 20.8691 5.99492 19.8591 6.99992C18.8541 8.00492 18.3491 9.22992 18.3491 10.6749Z" | ||
android:fillColor="#4285F4"/> | ||
<path | ||
android:pathData="M6.0107 5.99007C7.6607 4.35007 9.6557 3.53007 11.9957 3.53007C12.7557 3.53007 13.4807 3.61507 14.1657 3.78507L15.5007 2.43007C14.4007 2.02507 13.2407 1.82007 12.0107 1.82007C10.6007 1.82007 9.2807 2.08507 8.0507 2.62007C6.8157 3.15507 5.7357 3.88007 4.8157 4.79507C4.1957 5.41007 3.6657 6.11007 3.2207 6.87007L4.6707 7.71507C5.0307 7.10507 5.4707 6.52507 6.0107 5.99007Z" | ||
android:fillColor="#EA4335"/> | ||
<path | ||
android:pathData="M21.3703 15.945C21.9053 14.71 22.1703 13.39 22.1703 11.985C22.1703 10.755 21.9653 9.58999 21.5603 8.48999L20.2103 9.83999C20.3753 10.515 20.4603 11.23 20.4603 11.98C20.4603 13.575 20.0753 15.005 19.3203 16.275L20.7703 17.12C20.9853 16.745 21.1953 16.355 21.3703 15.945Z" | ||
android:fillColor="#4285F4"/> | ||
<path | ||
android:pathData="M17.9955 17.9799C16.3505 19.63 14.3555 20.455 12.0105 20.455C9.66055 20.455 7.66055 19.63 6.01055 17.9799C5.45555 17.4249 5.00555 16.83 4.64055 16.2L3.18555 17.03C3.63555 17.82 4.17555 18.5349 4.81555 19.1749C5.74055 20.0999 6.81555 20.825 8.05055 21.36C9.28555 21.89 10.6005 22.16 12.0105 22.16C13.4155 22.16 14.7355 21.8899 15.9755 21.3549C17.2105 20.82 18.2855 20.09 19.2055 19.17C19.8155 18.555 20.3355 17.865 20.7755 17.115L19.3255 16.27C18.9605 16.88 18.5255 17.4499 17.9955 17.9799Z" | ||
android:fillColor="#34A853"/> | ||
<path | ||
android:pathData="M3.53422 11.9951C3.53422 10.4051 3.91922 8.98012 4.66422 7.71512L3.21422 6.87012C2.99922 7.24012 2.79922 7.61512 2.62422 8.02012C2.09422 9.25512 1.82422 10.5751 1.82422 11.9801C1.82422 13.3851 2.08922 14.7101 2.62422 15.9401C2.78922 16.3201 2.97922 16.6801 3.17922 17.0301L4.63422 16.2001C3.90922 14.9501 3.53422 13.5501 3.53422 11.9951Z" | ||
android:fillColor="#FBBC04"/> | ||
</vector> |
63 changes: 63 additions & 0 deletions
63
chrome/browser/ui/android/page_insights/java/res/layout/page_insights_sheet_toolbar.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright 2023 The Chromium Authors | ||
Use of this source code is governed by a BSD-style license that can be | ||
found in the LICENSE file. | ||
--> | ||
|
||
<!-- A toolbar layout designed for page insight bottom-sheet --> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="@dimen/sheet_tab_toolbar_height" | ||
android:orientation="vertical"> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="4dp" /> | ||
|
||
<RelativeLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="62dp" | ||
android:paddingStart="12dp" | ||
android:paddingEnd="12dp" | ||
android:orientation="horizontal"> | ||
|
||
<ImageView | ||
android:id="@+id/drag_handlebar" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_centerHorizontal="true" | ||
android:importantForAccessibility="no" | ||
android:src="@drawable/drag_handlebar" /> | ||
|
||
<LinearLayout | ||
android:id="@+id/buttons" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="center" | ||
android:layout_marginTop="12dp" | ||
android:layout_marginBottom="8dp" | ||
android:importantForAccessibility="no" | ||
android:orientation="horizontal" > | ||
|
||
<org.chromium.ui.widget.ChromeImageView | ||
android:layout_width="0dp" | ||
android:layout_weight="1" | ||
android:layout_height="match_parent" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="8dp" | ||
android:paddingStart="8dp" | ||
android:paddingEnd="8dp" | ||
android:src="@drawable/page_insights_icon" | ||
android:contentDescription="@string/close"/> | ||
</LinearLayout> | ||
|
||
</RelativeLayout> | ||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="4dp" /> | ||
</LinearLayout> |
Oops, something went wrong.