Bug 1282410 - part2 : open media with external apps. r=Margaret
authorAlastor Wu <alwu@mozilla.com>
Wed, 06 Jul 2016 10:53:53 +0800
changeset 303783 577309fc4bbb328a7825b26818089c2af6c7bbf2
parent 303782 339b5c5d3595fcbf3cafd35df8a2a2ecce484b5a
child 303784 39c367ecc144a8f505e865a599a19d0628201070
push id30401
push usercbook@mozilla.com
push dateWed, 06 Jul 2016 09:40:34 +0000
treeherdermozilla-central@a7d6bb9e7d12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMargaret
bugs1282410
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1282410 - part2 : open media with external apps. r=Margaret MozReview-Commit-ID: KQDmOf2RURN
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4688,16 +4688,17 @@ var BrowserEventHandler = {
       Services.obs.addObserver(this, "dom-touch-listener-added", false);
       BrowserApp.deck.addEventListener("touchstart", this, true);
     } else {
       BrowserApp.deck.addEventListener("touchend", this, true);
     }
 
     BrowserApp.deck.addEventListener("DOMUpdatePageReport", PopupBlockerObserver.onUpdatePageReport, false);
     BrowserApp.deck.addEventListener("MozMouseHittest", this, true);
+    BrowserApp.deck.addEventListener("OpenMediaWithExtenalApp", this, true);
 
     InitLater(() => BrowserApp.deck.addEventListener("click", InputWidgetHelper, true));
     InitLater(() => BrowserApp.deck.addEventListener("click", SelectHelper, true));
 
     // ReaderViews support backPress listeners.
     Messaging.addListener(() => {
       return Reader.onBackPress(BrowserApp.selectedTab.id);
     }, "Browser:OnBackPressed");
@@ -4711,16 +4712,19 @@ var BrowserEventHandler = {
       case 'touchend':
         if (this._inCluster) {
           aEvent.preventDefault();
         }
         break;
       case 'MozMouseHittest':
         this._handleRetargetedTouchStart(aEvent);
         break;
+      case 'OpenMediaWithExtenalApp':
+        ExternalApps.openExternal(aEvent.target);
+        break;
     }
   },
 
   _handleTouchStart: function(aEvent) {
     if (!BrowserApp.isBrowserContentDocumentDisplayed() || aEvent.touches.length > 1 || aEvent.defaultPrevented)
       return;
 
     let target = aEvent.target;