From: AlexeyBarabash <alexey@brave.com>
Date: Thu, 11 Jan 2018 13:27:34 +0200
Subject: Open YouTube links in Bromite

---
 .../chrome/browser/externalnav/ExternalNavigationHandler.java      | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
@@ -400,6 +400,13 @@ public class ExternalNavigationHandler {
             return OverrideUrlLoadingResult.NO_OVERRIDE;
         }
 
+        // Force to open YouTube urls in Bromite
+        String intentPackageName = intent.getPackage();
+        if (intentPackageName != null && intentPackageName.equals("com.google.android.youtube")) {
+            if (DEBUG) Log.i(TAG, "NO_OVERRIDE: YouTube URL for YouTube app");
+            return OverrideUrlLoadingResult.NO_OVERRIDE;
+        }
+
         // Sanitize the Intent, ensuring web pages can not bypass browser
         // security (only access to BROWSABLE activities).
         intent.addCategory(Intent.CATEGORY_BROWSABLE);
-- 
2.11.0

