Backout changeset b520f34d78f1 but keep the callback parts because they may be useful for other things

This commit is contained in:
Ehsan Akhgari 2012-02-22 11:35:25 -05:00
parent dfd4c96ec1
commit 324ca6b6b4
6 changed files with 1 additions and 56 deletions

View File

@ -127,7 +127,6 @@ public class GeckoEvent {
public boolean mCanBeMetered;
public int mNativeWindow;
public int mTabId;
public GeckoEvent() {
mType = NATIVE_POKE;

View File

@ -1302,16 +1302,6 @@ abstract public class GeckoApp
Runnable r = new SessionSnapshotRunnable(tab);
GeckoAppShell.getHandler().postDelayed(r, 500);
}
GeckoAppShell.sendEventToGecko(
GeckoEvent.createMetaViewportQueryEvent(tab.getId(),
new GeckoEvent.Callback() {
public void callback(GeckoEvent ev, String data) {
Log.i(LOGTAG, "Meta Viewport Data:" + data);
// To do: do something with this data
}
})
);
}
void handleShowToast(final String message, final String duration) {

View File

@ -93,7 +93,6 @@ public class GeckoEvent {
private static final int PROXIMITY_EVENT = 23;
private static final int ACTIVITY_RESUMING = 24;
private static final int SCREENSHOT = 25;
private static final int META_VIEWPORT_QUERY = 26;
public static final int IME_COMPOSITION_END = 0;
public static final int IME_COMPOSITION_BEGIN = 1;
@ -141,7 +140,6 @@ public class GeckoEvent {
public boolean mCanBeMetered;
public int mNativeWindow;
public int mTabId;
Callback mCallback;
@ -390,13 +388,6 @@ public class GeckoEvent {
return event;
}
public static GeckoEvent createMetaViewportQueryEvent(int tabId, Callback callback) {
GeckoEvent event = new GeckoEvent(META_VIEWPORT_QUERY);
event.mCallback = callback;
event.mTabId = tabId;
return event;
}
public static GeckoEvent createLoadEvent(String uri) {
GeckoEvent event = new GeckoEvent(LOAD_URI);
event.mCharacters = uri;

View File

@ -76,7 +76,6 @@ jfieldID AndroidGeckoEvent::jLocationField = 0;
jfieldID AndroidGeckoEvent::jAddressField = 0;
jfieldID AndroidGeckoEvent::jBandwidthField = 0;
jfieldID AndroidGeckoEvent::jCanBeMeteredField = 0;
jfieldID AndroidGeckoEvent::jTabIdField = 0;
jmethodID AndroidGeckoEvent::jDoCallbackMethod = 0;
jclass AndroidPoint::jPointClass = 0;
@ -211,7 +210,6 @@ AndroidGeckoEvent::InitGeckoEventClass(JNIEnv *jEnv)
jBandwidthField = getField("mBandwidth", "D");
jCanBeMeteredField = getField("mCanBeMetered", "Z");
jTabIdField = getField("mTabId", "I");
jDoCallbackMethod = getMethod("doCallback", "(Ljava/lang/String;)V");
}
@ -602,10 +600,6 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj)
break;
}
case META_VIEWPORT_QUERY:
mTabId = jenv->GetIntField(jobj, jTabIdField);
break;
case VIEWPORT:
case BROADCAST: {
ReadCharactersField(jenv);

View File

@ -548,7 +548,6 @@ public:
nsGeoPositionAddress* GeoAddress() { return mGeoAddress; }
double Bandwidth() { return mBandwidth; }
bool CanBeMetered() { return mCanBeMetered; }
int TabId() { return mTabId; }
void DoCallback(const nsAString& data);
protected:
@ -575,7 +574,6 @@ protected:
nsRefPtr<nsGeoPositionAddress> mGeoAddress;
double mBandwidth;
bool mCanBeMetered;
int mTabId;
void ReadIntArray(nsTArray<int> &aVals,
JNIEnv *jenv,
@ -630,7 +628,6 @@ protected:
static jfieldID jBandwidthField;
static jfieldID jCanBeMeteredField;
static jfieldID jTabIdField;
static jmethodID jDoCallbackMethod;
@ -661,7 +658,6 @@ public:
PROXIMITY_EVENT = 23,
ACTIVITY_RESUMING = 24,
SCREENSHOT = 25,
META_VIEWPORT_QUERY = 26,
dummy_java_enum_list_end
};

View File

@ -60,7 +60,7 @@
#include <android/log.h>
#include <pthread.h>
#include <wchar.h>
#include "nsContentUtils.h"
#ifdef MOZ_ANDROID_HISTORY
#include "nsAndroidHistory.h"
#endif
@ -454,31 +454,6 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
}
case AndroidGeckoEvent::META_VIEWPORT_QUERY:
{
nsCOMPtr<nsIDOMWindow> domWindow;
mBrowserApp->GetWindowForTab(curEvent->TabId(), getter_AddRefs(domWindow));
if (!domWindow)
break;
nsCOMPtr<nsIDOMDocument> domDocument;
domWindow->GetDocument(getter_AddRefs(domDocument));
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDocument);
ViewportInfo vi = nsContentUtils::GetViewportInfo(doc);
nsAutoString data;
data.AppendLiteral("{");
data.AppendPrintf("\"defaultZoom\": %f,", vi.defaultZoom);
data.AppendPrintf("\"minZoom\": %f,", vi.minZoom);
data.AppendPrintf("\"maxZoom\": %f,", vi.maxZoom);
data.AppendPrintf("\"width\": %d,", vi.width);
data.AppendPrintf("\"height\": %d,", vi.height);
data.AppendPrintf("\"autoSize\": %s,", vi.autoSize ? "true" : "false");
data.AppendPrintf("\"allowZoom\": %s,", vi.allowZoom ? "true" : "false");
data.AppendPrintf("\"autoScale\": %s", vi.autoScale ? "true" : "false");
data.AppendLiteral("}");
curEvent->DoCallback(data);
}
break;
case AndroidGeckoEvent::VIEWPORT:
case AndroidGeckoEvent::BROADCAST: {