Bug 977196 - Part 1: Loading URL from an intent. r=liuche
authorSola Ogunsakin <oogunsakin@mozilla.com>
Tue, 01 Apr 2014 21:33:21 -0700
changeset 181331 703be46d6ef5c5e4a46012a5347c5adcb6caab9f
parent 181330 d08e05dc625315ad2ceeaa3dd0d0246881542fd7
child 181332 ed805b5390885f9925732453b742d84e0e31863a
push id26701
push usercbook@mozilla.com
push dateFri, 02 May 2014 12:52:30 +0000
treeherdermozilla-central@35c124cab3a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche
bugs977196
milestone32.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 977196 - Part 1: Loading URL from an intent. r=liuche
mobile/android/base/BrowserApp.java
mobile/android/base/TelemetryContract.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -482,16 +482,18 @@ abstract public class BrowserApp extends
         mActionBar = (ActionModeCompatView) findViewById(R.id.actionbar);
 
         mBrowserToolbar = (BrowserToolbar) findViewById(R.id.browser_toolbar);
         mProgressView = (ToolbarProgressView) findViewById(R.id.progress);
         mBrowserToolbar.setProgressBar(mProgressView);
         if (Intent.ACTION_VIEW.equals(intent.getAction())) {
             // Show the target URL immediately in the toolbar.
             mBrowserToolbar.setTitle(intent.getDataString());
+
+            Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.INTENT);
         }
 
         ((GeckoApp.MainLayout) mMainLayout).setTouchEventInterceptor(new HideTabsTouchListener());
         ((GeckoApp.MainLayout) mMainLayout).setMotionEventInterceptor(new MotionEventInterceptor() {
             @Override
             public boolean onInterceptMotionEvent(View view, MotionEvent event) {
                 // If we get a gamepad panning MotionEvent while the focus is not on the layerview,
                 // put the focus on the layerview and carry on
@@ -2538,19 +2540,21 @@ abstract public class BrowserApp extends
             String uri = intent.getDataString();
             GeckoAppShell.sendEventToGecko(GeckoEvent.createURILoadEvent(uri));
         }
 
         if (!mInitialized) {
             return;
         }
 
-        // Dismiss editing mode if the user is loading a URL from an external app.
         if (Intent.ACTION_VIEW.equals(action)) {
+            // Dismiss editing mode if the user is loading a URL from an external app.
             mBrowserToolbar.cancelEdit();
+
+            Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.INTENT);
             return;
         }
 
         // Only solicit feedback when the app has been launched from the icon shortcut.
         if (!Intent.ACTION_MAIN.equals(action)) {
             return;
         }
 
--- a/mobile/android/base/TelemetryContract.java
+++ b/mobile/android/base/TelemetryContract.java
@@ -38,31 +38,37 @@ public interface TelemetryContract {
 
         // Saving a resource (reader, bookmark, etc) for viewing later.
         // Note: Only used in JavaScript for now, but here for completeness.
         public static final String SAVE = "save.1";
 
         // Stop holding a resource (reader, bookmark, etc) for viewing later.
         // Note: Only used in JavaScript for now, but here for completeness.
         public static final String UNSAVE = "unsave.1";
+
+        // Loading a URL.
+        public static final String LOAD_URL = "loadurl.1";
     }
 
     /**
      * Holds event methods. Intended for use in
      * Telemetry.sendUIEvent() as the "method" parameter.
      */
     public interface Method {
         // Action triggered from a list.
         public static final String LIST = "list";
 
         // Action triggered from a button.
         public static final String BUTTON = "button";
 
         // Action triggered from a dialog.
         public static final String DIALOG = "dialog";
+
+        // Action occurred via an intent.
+        public static final String INTENT = "intent";
     }
 
     /**
      * Holds session names. Intended for use with
      * Telemetry.startUISession() as the "sessionName" parameter.
      */
     public interface Session {
         // Started when a user enters about:home.