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