Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public static GeckoEvent createVisitedEvent(String data) {
   GeckoEvent event = new GeckoEvent(VISITED);
   event.mCharacters = data;
   return event;
 }
Ejemplo n.º 4
0
 public static GeckoEvent createBookmarkLoadEvent(String uri) {
   GeckoEvent event = new GeckoEvent(LOAD_URI);
   event.mCharacters = uri;
   event.mCharactersExtra = "-bookmark";
   return event;
 }
Ejemplo n.º 5
0
 public static GeckoEvent createWebappLoadEvent(String uri) {
   GeckoEvent event = new GeckoEvent(LOAD_URI);
   event.mCharacters = uri;
   event.mCharactersExtra = "-webapp";
   return event;
 }
Ejemplo n.º 6
0
 public static GeckoEvent createBroadcastEvent(String subject, String data) {
   GeckoEvent event = new GeckoEvent(BROADCAST);
   event.mCharacters = subject;
   event.mCharactersExtra = data;
   return event;
 }