Skip to content

Commit

Permalink
Merge pull request #5107 from brave/pr5095_android_changed_help_link_…
Browse files Browse the repository at this point in the history
…1.7.x

Changed help link for connection info (uplift to 1.7.x)
  • Loading branch information
kjozwiak authored Mar 31, 2020
2 parents ad118ab + c802c4d commit e3c9166
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
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.

0 comments on commit e3c9166

Please sign in to comment.