Bug 801675 - Use loadUrl() to open the marketplace tab. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Mon, 15 Oct 2012 12:51:38 -0700
changeset 110452 f8e52edff71e0f3cb5c9d6530838763c4049fbec
parent 110451 8a070a22c369a739cae1a5ed7f17c3bee14d5c84
child 110453 4e9d97c921276a69bfdec4a4d6f86890f2c19fc3
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmfinkle
bugs801675
milestone19.0a1
Bug 801675 - Use loadUrl() to open the marketplace tab. r=mfinkle
mobile/android/base/AboutHomePromoBox.java
--- a/mobile/android/base/AboutHomePromoBox.java
+++ b/mobile/android/base/AboutHomePromoBox.java
@@ -60,27 +60,17 @@ public class AboutHomePromoBox extends L
         switch (mType) {
             case SYNC:
                 final Context context = v.getContext();
                 final Intent intent = new Intent(context, SetupSyncActivity.class);
                 context.startActivity(intent);
                 break;
 
             case APPS:
-                final String url = "https://marketplace.mozilla.org";
-                final JSONObject args = new JSONObject();
-                try {
-                    args.put("url", url);
-                    args.put("engine", null);
-                    args.put("userEntered", false);
-                } catch (Exception e) {
-                    Log.e(LOGTAG, "error building JSON arguments");
-                }
-                Log.d(LOGTAG, "Sending message to Gecko: " + SystemClock.uptimeMillis() + " - Tab:Add");
-                GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Tab:Add", args.toString()));
+                Tabs.getInstance().loadUrl("https://marketplace.mozilla.org", Tabs.LOADURL_NEW_TAB);
                 break;
 
             default:
                 Log.e(LOGTAG, "Invalid type was set when promo box was clicked.");
                 break;
         }
     }