public static GeckoEvent createIMEReplaceEvent(int start, int end, String text) { GeckoEvent event = new GeckoEvent(IME_EVENT); event.mAction = IME_REPLACE_TEXT; event.mStart = start; event.mEnd = end; event.mCharacters = text; return event; }
public static GeckoEvent createViewportEvent( ImmutableViewportMetrics metrics, DisplayPortMetrics displayPort) { GeckoEvent event = new GeckoEvent(VIEWPORT); event.mCharacters = "Viewport:Change"; StringBuffer sb = new StringBuffer(256); sb.append("{ \"x\" : ") .append(metrics.viewportRectLeft) .append(", \"y\" : ") .append(metrics.viewportRectTop) .append(", \"zoom\" : ") .append(metrics.zoomFactor) .append(", \"displayPort\" :") .append(displayPort.toJSON()) .append('}'); event.mCharactersExtra = sb.toString(); return event; }
public static GeckoEvent createVisitedEvent(String data) { GeckoEvent event = new GeckoEvent(VISITED); event.mCharacters = data; return event; }
public static GeckoEvent createBookmarkLoadEvent(String uri) { GeckoEvent event = new GeckoEvent(LOAD_URI); event.mCharacters = uri; event.mCharactersExtra = "-bookmark"; return event; }
public static GeckoEvent createWebappLoadEvent(String uri) { GeckoEvent event = new GeckoEvent(LOAD_URI); event.mCharacters = uri; event.mCharactersExtra = "-webapp"; return event; }
public static GeckoEvent createBroadcastEvent(String subject, String data) { GeckoEvent event = new GeckoEvent(BROADCAST); event.mCharacters = subject; event.mCharactersExtra = data; return event; }