Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed help link for connection info (uplift to 1.7.x) #5107

Merged
merged 1 commit into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/BraveBadge.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveFeatureList.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveHelper.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveIntentHandler.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveRelaunchUtils.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveSyncWorker.java",
"../../brave/android/java/org/chromium/chrome/browser/BraveRewardsNativeWorker.java",
Expand Down
30 changes: 30 additions & 0 deletions android/java/org/chromium/chrome/browser/BraveIntentHandler.java
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);
}
}
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.