-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5107 from brave/pr5095_android_changed_help_link_…
…1.7.x Changed help link for connection info (uplift to 1.7.x)
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 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
30 changes: 30 additions & 0 deletions
30
android/java/org/chromium/chrome/browser/BraveIntentHandler.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,30 @@ | ||
/* Copyright (c) 2020 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 http://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.chromium.chrome.browser; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
|
||
public class BraveIntentHandler extends IntentHandler { | ||
private static final String CONNECTION_INFO_HELP_URL = | ||
"https://support.google.com/chrome?p=android_connection_info"; | ||
private static final String BRAVE_CONNECTION_INFO_HELP_URL = | ||
"https://support.brave.com/hc/en-us/articles/360018185871-How-do-I-check-if-a-site-s-connection-is-secure-"; | ||
|
||
public BraveIntentHandler(IntentHandlerDelegate delegate, String packageName) { | ||
super(delegate, packageName); | ||
} | ||
|
||
public boolean onNewIntent(Intent intent) { | ||
// Redirect requests if necessary | ||
String url = getUrlFromIntent(intent); | ||
if (url != null && url.equals(CONNECTION_INFO_HELP_URL)) { | ||
intent.setData(Uri.parse(BRAVE_CONNECTION_INFO_HELP_URL)); | ||
} | ||
return super.onNewIntent(intent); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
patches/chrome-android-java-src-org-chromium-chrome-browser-ChromeActivity.java.patch
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,13 @@ | ||
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java | ||
index 3fdc4ba9b8005026571356579e2a0ca645746d55..228d4a0702ae126bdf7665da6e7fe2b211602ff9 100644 | ||
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java | ||
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java | ||
@@ -758,7 +758,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent> | ||
|
||
IntentHandler.setTestIntentsEnabled( | ||
CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS)); | ||
- mIntentHandler = new IntentHandler(createIntentHandlerDelegate(), getPackageName()); | ||
+ mIntentHandler = new BraveIntentHandler(createIntentHandlerDelegate(), getPackageName()); | ||
|
||
// This also ensures that subsequent native library and resource loading takes place | ||
// immediately, needed by restored tabs that use DFM. |