Bug 738859 - Increment mActivityDepth for all activities launched from GeckoApp. r=blassey a=akeybl
authorBrian Nicholson <bnicholson@mozilla.com>
Tue, 27 Mar 2012 12:25:26 -0700
changeset 91984 0e479285c04bccc7220a1a224cb50413c94e5853
parent 91983 28722c9549135026c145373fd623174618a54d6b
child 91985 ae195a8d5b234bd32b0061665ea4bb888e7607b0
push idunknown
push userunknown
push dateunknown
reviewersblassey, akeybl
bugs738859
milestone13.0a2
Bug 738859 - Increment mActivityDepth for all activities launched from GeckoApp. r=blassey a=akeybl
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -147,17 +147,17 @@ abstract public class GeckoApp
     private static GeckoSoftwareLayerClient mSoftwareLayerClient;
     private AboutHomeContent mAboutHomeContent;
     private static AbsoluteLayout mPluginContainer;
 
     public String mLastTitle;
     public String mLastSnapshotUri;
     public String mLastViewport;
     public byte[] mLastScreen;
-    public int mOwnActivityDepth = 0;
+    private int mOwnActivityDepth = 0;
     private boolean mRestoreSession = false;
     private boolean mInitialized = false;
 
     private static final String HANDLER_MSG_TYPE = "type";
     private static final int HANDLER_MSG_TYPE_INITIALIZE = 1;
 
     static class ExtraMenuItem implements MenuItem.OnMenuItemClickListener {
         String label;
@@ -2540,17 +2540,16 @@ abstract public class GeckoApp
             Tab tab = Tabs.getInstance().getSelectedTab();
             if (tab != null) {
                 String url = tab.getURL();
                 if (url != null) {
                     intent.putExtra(AwesomeBar.CURRENT_URL_KEY, url);
                 }
             }
         }
-        mOwnActivityDepth++;
         startActivityForResult(intent, AWESOMEBAR_REQUEST);
         return true;
     }
 
     public boolean doReload() {
         Log.i(LOGTAG, "Reload requested");
         Tab tab = Tabs.getInstance().getSelectedTab();
         if (tab == null)
@@ -2873,16 +2872,28 @@ abstract public class GeckoApp
             switch (type) {
                 case HANDLER_MSG_TYPE_INITIALIZE:
                     initialize();
                     break;
 
             }
         }
     } 
+
+    @Override
+    public void startActivity(Intent intent) {
+        mOwnActivityDepth++;
+        super.startActivity(intent);
+    }
+
+    @Override
+    public void startActivityForResult(Intent intent, int request) {
+        mOwnActivityDepth++;
+        super.startActivityForResult(intent, request);
+    }
 }
 
 class PluginLayoutParams extends AbsoluteLayout.LayoutParams
 {
     private static final int MAX_DIMENSION = 2048;
     private static final String LOGTAG = "GeckoApp.PluginLayoutParams";
 
     private int mOriginalX;