Commit 0414e22f authored by Hazem Ashmawy's avatar Hazem Ashmawy Committed by Commit Bot

AW: Add a GN build flag to show a launcher icon for dev ui

* Add a GN argument to whether show a launcher icon to open WebView
  developer UI main. This gn argument is off by default.
* The shown icon will be another icon in addition to any icons added by
  WebView providers.
* A launcher activity is defined as an activity-alias that links to
  developer UI main activity.
* The manifest file where this activity-alias is defined is merged into
  WebView manifest only if the flag is true.

Bug: 989831
Test: Manually inspect the new added launcher icon after installing system_webview_apk, monochrome_apk, trichrome with gn arg 'webview_devui_show_icon=true`
Change-Id: I9e5b808f5e1f9491d2ed813ccf342207a7642b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863929
Commit-Queue: Hazem Ashmawy <hazems@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Auto-Submit: Hazem Ashmawy <hazems@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711391}
parent 768a8481
......@@ -106,6 +106,10 @@ android_resources("icon_resources") {
android_resources("devui_resources") {
resource_dirs = [ "java/res_devui" ]
custom_package = "org.chromium.android_webview.devui"
if (webview_devui_show_icon) {
android_manifest = "java/DeveloperUiLauncherManifest.xml"
}
}
jinja_template("system_webview_manifest") {
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2019 The Chromium Authors. All rights reserved. Use of this
source code is governed by a BSD-style license that can be found in the
LICENSE file.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.chromium.android_webview.devui">
<!--suppress HardcodedText -->
<application>
<activity-alias android:name="org.chromium.android_webview.devui.LauncherActivity"
android:targetActivity="org.chromium.android_webview.devui.MainActivity"
android:label="WebView DevTools"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
</application>
</manifest>
......@@ -2,6 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
# Show a launcher icon to open WebView developer UI, off by default.
webview_devui_show_icon = false
}
system_webview_android_manifest =
"$root_gen_dir/android_webview/system_webview_apk/AndroidManifest.xml"
trichrome_webview_android_manifest =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment