Commit 19e2555c authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

[Android] Create external_intents component, populating it with switch

This CL creates //components/external_intents, initially populating it
with the previously //chrome-level switch that is used to disable the
launching of external intents. The ultimate goal is to have //chrome's
ExternalNavigationHandler.java and friends live inside this component
for sharing with WebLayer.

Bug: 1031465
Change-Id: I738f5a9eff6d415aedc85364cb4b8e6c0bb1475b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2082377Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746285}
parent d6912d3e
......@@ -300,6 +300,7 @@ android_library("chrome_java") {
"//components/embedder_support/android:context_menu_java",
"//components/embedder_support/android:util_java",
"//components/embedder_support/android:web_contents_delegate_java",
"//components/external_intents/android:java",
"//components/feature_engagement:feature_engagement_java",
"//components/feed/core/proto:proto_java",
"//components/find_in_page/android:java",
......
......@@ -13,6 +13,7 @@ include_rules = [
"+components/content_capture",
"+components/download",
"+components/embedder_support/android",
"+components/external_intents/android",
"+components/favicon_base",
"+components/find_in_page/android",
"+components/invalidation",
......
......@@ -26,7 +26,6 @@ import org.chromium.base.IntentUtils;
import org.chromium.base.Log;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.autofill_assistant.AutofillAssistantFacade;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
......@@ -37,6 +36,7 @@ import org.chromium.chrome.browser.tab.TabRedirectHandler;
import org.chromium.chrome.browser.webapps.WebappScopePolicy;
import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.components.embedder_support.util.UrlUtilities;
import org.chromium.components.external_intents.ExternalIntentsSwitches;
import org.chromium.content_public.common.ContentUrlConstants;
import org.chromium.ui.base.PageTransition;
import org.chromium.url.URI;
......@@ -491,7 +491,8 @@ public class ExternalNavigationHandler {
private boolean externalIntentRequestsDisabled() {
// TODO(changwan): check if we need to handle URL even when external intent is off.
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_EXTERNAL_INTENT_REQUESTS)) {
if (CommandLine.getInstance().hasSwitch(
ExternalIntentsSwitches.DISABLE_EXTERNAL_INTENT_REQUESTS)) {
Log.w(TAG, "External intent handling is disabled by a command-line flag.");
return true;
}
......
......@@ -42,10 +42,6 @@ public abstract class ChromeSwitches {{
/** Force the crash dump to be uploaded regardless of preferences. */
public static final String FORCE_CRASH_DUMP_UPLOAD = "force-dump-upload";
/** Never forward URL requests to external intents. */
public static final String DISABLE_EXTERNAL_INTENT_REQUESTS =
"disable-external-intent-requests";
/** Disable Contextual Search. */
public static final String DISABLE_CONTEXTUAL_SEARCH = "disable-contextual-search";
......
mthiesse@chromium.org
rsesek@chromium.org
tedchoc@chromium.org
twellington@chromium.org
yfriedman@chromium.org
Holds code related to the launching of external intents on Android.
# Copyright 2020 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.
import("//build/config/android/rules.gni")
android_library("java") {
sources = [ "java/src/org/chromium/components/external_intents/ExternalIntentsSwitches.java" ]
}
// Copyright 2020 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.
package org.chromium.components.external_intents;
/**
* Contains all of the command line switches for external intent launching.
*/
public abstract class ExternalIntentsSwitches {
/** Never forward URL requests to external intents. */
public static final String DISABLE_EXTERNAL_INTENT_REQUESTS =
"disable-external-intent-requests";
// Prevent instantiation.
private ExternalIntentsSwitches() {}
}
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