engine-gecko-3.3

16:35:37.710 INFO  jd.cli.Main - Decompiling engine-gecko-3.3.jar
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.dom.DomProxyFactory;
import com.teamdev.jxbrowser.gecko.xpcom.ChromeContainerWindow;
import java.util.concurrent.atomic.AtomicReference;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMWindow;
import org.mozilla.interfaces.nsIWebBrowser;
import org.w3c.dom.Document;

class ActiveWebBrowserSupport$d
  implements Runnable
{
  ActiveWebBrowserSupport$d(ActiveWebBrowserSupport paramActiveWebBrowserSupport, AtomicReference paramAtomicReference) {}
  
  public void run()
  {
    nsIWebBrowser localnsIWebBrowser = ActiveWebBrowserSupport.a(b).getWebBrowser();
    nsIDOMWindow localnsIDOMWindow = localnsIWebBrowser.getContentDOMWindow();
    nsIDOMDocument localnsIDOMDocument = localnsIDOMWindow.getDocument();
    a.set((Document)DomProxyFactory.createDomObjectProxy(localnsIDOMDocument));
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.ActiveWebBrowserSupport.d
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import java.util.concurrent.atomic.AtomicReference;

class ActiveWebBrowserSupport$e
  implements Runnable
{
  ActiveWebBrowserSupport$e(ActiveWebBrowserSupport paramActiveWebBrowserSupport, AtomicReference paramAtomicReference, String paramString) {}
  
  public void run()
  {
    a.set(ActiveWebBrowserSupport.a(c, b));
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.ActiveWebBrowserSupport.e
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.xpcom.ChromeContainerWindow;
import com.teamdev.jxbrowser.gecko.xpcom.XPCOMManager;
import org.mozilla.interfaces.nsIDocShell;
import org.mozilla.interfaces.nsIInterfaceRequestor;

class ActiveWebBrowserSupport$b
  implements Runnable
{
  ActiveWebBrowserSupport$b(ActiveWebBrowserSupport paramActiveWebBrowserSupport, BrowserPreferences paramBrowserPreferences) {}
  
  public void run()
  {
    XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
    nsIInterfaceRequestor localnsIInterfaceRequestor = (nsIInterfaceRequestor)localXPCOMManager.queryInterface(ActiveWebBrowserSupport.a(b).getWebBrowser(), nsIInterfaceRequestor.class);
    nsIDocShell localnsIDocShell = (nsIDocShell)localXPCOMManager.getInterface(localnsIInterfaceRequestor, nsIDocShell.class);
    localnsIDocShell.setAllowAuth(a.isAllowAuthentication());
    localnsIDocShell.setAllowImages(a.isAllowImages());
    localnsIDocShell.setAllowJavascript(a.isAllowJavascript());
    localnsIDocShell.setAllowMetaRedirects(a.isAllowMetaRedirects());
    localnsIDocShell.setAllowPlugins(a.isAllowPlugins());
    localnsIDocShell.setAllowSubframes(a.isAllowSubframes());
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.ActiveWebBrowserSupport.b
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.xpcom.XPCOMManager;
import com.teamdev.jxbrowser.gecko.xpcom.util.b;
import com.teamdev.jxbrowser.gecko.xpcom.util.e;
import org.mozilla.interfaces.nsIDocShell;
import org.mozilla.interfaces.nsIInputStream;
import org.mozilla.interfaces.nsIInterfaceRequestor;
import org.mozilla.interfaces.nsIURI;
import org.mozilla.interfaces.nsIWebBrowserStream;

class ActiveWebBrowserSupport$c
  implements Runnable
{
  ActiveWebBrowserSupport$c(ActiveWebBrowserSupport paramActiveWebBrowserSupport, String paramString1, String paramString2, String paramString3, String paramString4) {}
  
  public void run()
  {
    XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
    nsIURI localnsIURI;
    Object localObject;
    if (a == null)
    {
      localnsIURI = new e().a("about:blank");
      localObject = (nsIInterfaceRequestor)localXPCOMManager.queryInterface(e.getNsIWebBrowser(), nsIInterfaceRequestor.class);
      nsIDocShell localnsIDocShell = (nsIDocShell)localXPCOMManager.getInterface((nsIInterfaceRequestor)localObject, nsIDocShell.class);
      b localb = new b();
      nsIInputStream localnsIInputStream = localb.a(b);
      localnsIDocShell.loadStream(localnsIInputStream, localnsIURI, c, d, null);
    }
    else
    {
      localnsIURI = new e().a(a);
      localObject = (nsIWebBrowserStream)localXPCOMManager.queryInterface(e.getNsIWebBrowser(), nsIWebBrowserStream.class);
      ((nsIWebBrowserStream)localObject).openStream(localnsIURI, c + ";charset=" + d);
      ((nsIWebBrowserStream)localObject).appendToStream(b.getBytes(), b.length());
      ((nsIWebBrowserStream)localObject).closeStream();
    }
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.ActiveWebBrowserSupport.c
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.events.impl.nsIWebProgressAdapter;
import com.teamdev.jxbrowser.gecko.xpcom.util.FlagUtil;
import java.util.concurrent.CountDownLatch;
import org.mozilla.interfaces.nsIRequest;
import org.mozilla.interfaces.nsIWebProgress;

class ActiveWebBrowserSupport$a$a
  extends nsIWebProgressAdapter
{
  ActiveWebBrowserSupport$a$a(ActiveWebBrowserSupport.a parama) {}
  
  public void onStateChange(nsIWebProgress paramnsIWebProgress, nsIRequest paramnsIRequest, long paramLong1, long paramLong2)
  {
    if (FlagUtil.checkFlag(paramLong1, 262160L)) {
      a.a.countDown();
    }
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.ActiveWebBrowserSupport.a.a
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.events.impl.nsIWebProgressAdapter;
import com.teamdev.jxbrowser.gecko.xpcom.XPCOMManager;
import com.teamdev.jxbrowser.gecko.xpcom.util.FlagUtil;
import java.io.File;
import java.util.concurrent.CountDownLatch;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMWindow;
import org.mozilla.interfaces.nsILocalFile;
import org.mozilla.interfaces.nsIRequest;
import org.mozilla.interfaces.nsIWebBrowser;
import org.mozilla.interfaces.nsIWebBrowserPersist;
import org.mozilla.interfaces.nsIWebProgress;
import org.mozilla.xpcom.Mozilla;

class ActiveWebBrowserSupport$a
  implements Runnable
{
  ActiveWebBrowserSupport$a(ActiveWebBrowserSupport paramActiveWebBrowserSupport, CountDownLatch paramCountDownLatch, File paramFile, String paramString) {}
  
  public void run()
  {
    a locala = new a();
    nsIWebBrowser localnsIWebBrowser = d.getNsIWebBrowser();
    nsIWebBrowserPersist localnsIWebBrowserPersist = (nsIWebBrowserPersist)XPCOMManager.getInstance().queryInterface(localnsIWebBrowser, nsIWebBrowserPersist.class);
    File localFile = new File(b, c);
    Mozilla localMozilla = Mozilla.getInstance();
    nsILocalFile localnsILocalFile1 = localMozilla.newLocalFile(localFile.getAbsolutePath(), false);
    nsILocalFile localnsILocalFile2 = localMozilla.newLocalFile(b.getAbsolutePath(), false);
    nsIDOMDocument localnsIDOMDocument = localnsIWebBrowser.getContentDOMWindow().getDocument();
    localnsIWebBrowserPersist.setProgressListener(locala);
    localnsIWebBrowserPersist.saveDocument(localnsIDOMDocument, localnsILocalFile1, localnsILocalFile2, "text/html", 4L, 0L);
  }
  
  class a
    extends nsIWebProgressAdapter
  {
    a() {}
    
    public void onStateChange(nsIWebProgress paramnsIWebProgress, nsIRequest paramnsIRequest, long paramLong1, long paramLong2)
    {
      if (FlagUtil.checkFlag(paramLong1, 262160L)) {
        a.countDown();
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.ActiveWebBrowserSupport.a
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.a.c;
import com.teamdev.jxbrowser.gecko.dom.DomProxyFactory;
import com.teamdev.jxbrowser.gecko.download.DownloadHandler;
import com.teamdev.jxbrowser.gecko.events.ContextMenuListener;
import com.teamdev.jxbrowser.gecko.events.DisposeListener;
import com.teamdev.jxbrowser.gecko.events.HistoryChangeListener;
import com.teamdev.jxbrowser.gecko.events.RequestListener;
import com.teamdev.jxbrowser.gecko.events.StatusChangeListener;
import com.teamdev.jxbrowser.gecko.events.TitleChangeListener;
import com.teamdev.jxbrowser.gecko.events.impl.ContextMenuListenerSupport;
import com.teamdev.jxbrowser.gecko.events.impl.DisposeListenerSupport;
import com.teamdev.jxbrowser.gecko.events.impl.HistoryChangeListenerSupport;
import com.teamdev.jxbrowser.gecko.events.impl.RequestListenersSupport;
import com.teamdev.jxbrowser.gecko.events.impl.StatusChangeListenerSupport;
import com.teamdev.jxbrowser.gecko.events.impl.TitleChangeListenerSupport;
import com.teamdev.jxbrowser.gecko.events.impl.WebNavigationSupport;
import com.teamdev.jxbrowser.gecko.events.impl.WebProgressListenerBridge;
import com.teamdev.jxbrowser.gecko.events.impl.nsIWebProgressAdapter;
import com.teamdev.jxbrowser.gecko.script.JavaScriptExecutor;
import com.teamdev.jxbrowser.gecko.xpcom.ChromeContainerWindow;
import com.teamdev.jxbrowser.gecko.xpcom.ChromeContainerWindowFactory;
import com.teamdev.jxbrowser.gecko.xpcom.ProxyObjectManager;
import com.teamdev.jxbrowser.gecko.xpcom.XPCOM;
import com.teamdev.jxbrowser.gecko.xpcom.XPCOMManager;
import com.teamdev.jxbrowser.gecko.xpcom.util.FlagUtil;
import com.teamdev.jxbrowser.gecko.xpcom.util.b;
import com.teamdev.jxbrowser.gecko.xpcom.util.e;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
import javax.imageio.ImageIO;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMWindow;
import org.mozilla.interfaces.nsIDocShell;
import org.mozilla.interfaces.nsIDocumentEncoder;
import org.mozilla.interfaces.nsIInputStream;
import org.mozilla.interfaces.nsIInterfaceRequestor;
import org.mozilla.interfaces.nsILocalFile;
import org.mozilla.interfaces.nsIRequest;
import org.mozilla.interfaces.nsIURI;
import org.mozilla.interfaces.nsIWebBrowser;
import org.mozilla.interfaces.nsIWebBrowserFind;
import org.mozilla.interfaces.nsIWebBrowserFindInFrames;
import org.mozilla.interfaces.nsIWebBrowserPersist;
import org.mozilla.interfaces.nsIWebBrowserStream;
import org.mozilla.interfaces.nsIWebPageDescriptor;
import org.mozilla.interfaces.nsIWebProgress;
import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Document;

public class ActiveWebBrowserSupport
  implements WebBrowserSupport
{
  private final ChromeContainerWindow a;
  private final WebNavigationSupport b;
  private final DisposeListenerSupport c;
  private final RequestListenersSupport d;
  private final StatusChangeListenerSupport e;
  private final TitleChangeListenerSupport f;
  private final HistoryChangeListenerSupport g;
  private final ContextMenuListenerSupport h;
  private final JavaScriptExecutor i;
  private final BrowserClipboard j;
  private DownloadHandler k;
  
  public ActiveWebBrowserSupport(WebBrowserWindow paramWebBrowserWindow)
  {
    a = ChromeContainerWindowFactory.newChromeContainer(paramWebBrowserWindow);
    d = new RequestListenersSupport(this);
    e = new StatusChangeListenerSupport(this);
    f = new TitleChangeListenerSupport(this);
    h = new ContextMenuListenerSupport(this);
    c = new DisposeListenerSupport();
    XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
    nsIWebBrowser localnsIWebBrowser = (nsIWebBrowser)localXPCOMManager.newComponent("@mozilla.org/embedding/browser/nsWebBrowser;1", nsIWebBrowser.class);
    a.setWebBrowser(localnsIWebBrowser);
    boolean bool = !(paramWebBrowserWindow instanceof c);
    b = new WebNavigationSupport(localnsIWebBrowser, bool);
    j = new BrowserClipboard(a.getWebBrowser());
    g = new HistoryChangeListenerSupport(this, localnsIWebBrowser);
    i = new JavaScriptExecutor(a);
    a();
  }
  
  private void a()
  {
    b();
    c();
    d();
    e();
    f();
  }
  
  public ChromeContainerWindow getChromeContainer()
  {
    return a;
  }
  
  private void b()
  {
    WebProgressListenerBridge localWebProgressListenerBridge = new WebProgressListenerBridge(d);
    a.getWebBrowser().addWebBrowserListener(localWebProgressListenerBridge, "{570f39d1-efd0-11d3-b093-00a024ffc08c}");
  }
  
  private void c()
  {
    a.setStatusChangeListenerSupport(e);
  }
  
  private void d()
  {
    a.setTitleChangeListenerSupport(f);
  }
  
  private void e()
  {
    a.setContextMenuListenerSupport(h);
  }
  
  private void f()
  {
    a.setDisposeListenerSupport(c);
  }
  
  public void addRequestListener(RequestListener paramRequestListener)
  {
    d.addRequestListener(paramRequestListener);
  }
  
  public void removeRequestListener(RequestListener paramRequestListener)
  {
    d.removeRequestListener(paramRequestListener);
  }
  
  public List<RequestListener> getRequestListeners()
  {
    return d.getRequestListeners();
  }
  
  public void addStatusChangeListener(StatusChangeListener paramStatusChangeListener)
  {
    e.addStatusChangeListener(paramStatusChangeListener);
  }
  
  public void removeStatusChangeListener(StatusChangeListener paramStatusChangeListener)
  {
    e.removeStatusChangeListener(paramStatusChangeListener);
  }
  
  public List<StatusChangeListener> getStatusChangeListeners()
  {
    return e.getStatusChangeListeners();
  }
  
  public void addTitleChangeListener(TitleChangeListener paramTitleChangeListener)
  {
    f.addTitleChangeListener(paramTitleChangeListener);
  }
  
  public void removeTitleChangeListener(TitleChangeListener paramTitleChangeListener)
  {
    f.removeTitleChangeListener(paramTitleChangeListener);
  }
  
  public List<TitleChangeListener> getTitleChangeListeners()
  {
    return f.getTitleChangeListeners();
  }
  
  public void addHistoryChangeListener(HistoryChangeListener paramHistoryChangeListener)
  {
    g.addHistoryChangeListener(paramHistoryChangeListener);
  }
  
  public void removeHistoryChangeListener(HistoryChangeListener paramHistoryChangeListener)
  {
    g.removeHistoryChangeListener(paramHistoryChangeListener);
  }
  
  public List<HistoryChangeListener> getHistoryChangeListeners()
  {
    return g.getHistoryChangeListeners();
  }
  
  public void addContextMenuListener(ContextMenuListener paramContextMenuListener)
  {
    h.addContextMenuListener(paramContextMenuListener);
  }
  
  public void removeContextMenuListener(ContextMenuListener paramContextMenuListener)
  {
    h.removeContextMenuListener(paramContextMenuListener);
  }
  
  public List<ContextMenuListener> getContextMenuListeners()
  {
    return h.getContextMenuListeners();
  }
  
  public void activate()
  {
    throw new UnsupportedOperationException();
  }
  
  public void deactivate()
  {
    throw new UnsupportedOperationException();
  }
  
  public void displayAsSource(boolean paramBoolean)
  {
    nsIWebBrowser localnsIWebBrowser = a.getWebBrowser();
    XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
    nsIInterfaceRequestor localnsIInterfaceRequestor = (nsIInterfaceRequestor)localXPCOMManager.queryInterface(localnsIWebBrowser, nsIInterfaceRequestor.class);
    nsIWebPageDescriptor localnsIWebPageDescriptor1 = (nsIWebPageDescriptor)localXPCOMManager.getInterface(localnsIInterfaceRequestor, nsIWebPageDescriptor.class);
    ProxyObjectManager localProxyObjectManager = ProxyObjectManager.getInstance();
    nsIWebPageDescriptor localnsIWebPageDescriptor2 = (nsIWebPageDescriptor)localProxyObjectManager.proxyForObject(localnsIWebPageDescriptor1, nsIWebPageDescriptor.class, false);
    localnsIWebPageDescriptor2.loadPage(localnsIWebPageDescriptor1.getCurrentDescriptor(), paramBoolean ? 1L : 2L);
  }
  
  public void dispose()
  {
    if (isDisposed()) {
      return;
    }
    f.dispose();
    e.dispose();
    d.dispose();
    a.dispose();
    c.dispose();
    k = null;
  }
  
  public String evaluateScript(String paramString)
  {
    return i.evaluateScript(paramString);
  }
  
  public boolean findNext(String paramString, SearchParams paramSearchParams)
  {
    XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
    nsIInterfaceRequestor localnsIInterfaceRequestor = (nsIInterfaceRequestor)localXPCOMManager.queryInterface(a.getWebBrowser(), nsIInterfaceRequestor.class);
    nsIWebBrowserFind localnsIWebBrowserFind = (nsIWebBrowserFind)localnsIInterfaceRequestor.getInterface("{2f977d44-5485-11d4-87e2-0010a4e75ef2}");
    localnsIWebBrowserFind.setSearchString(paramString);
    localnsIWebBrowserFind.setFindBackwards(paramSearchParams.isBackward());
    localnsIWebBrowserFind.setMatchCase(paramSearchParams.isCaseSensitive());
    localnsIWebBrowserFind.setEntireWord(paramSearchParams.isEntireWords());
    localnsIWebBrowserFind.setWrapFind(paramSearchParams.isWrapFind());
    localnsIWebBrowserFind.setSearchFrames(paramSearchParams.isSearchInSubFrames());
    nsIWebBrowserFindInFrames localnsIWebBrowserFindInFrames = (nsIWebBrowserFindInFrames)localXPCOMManager.queryInterface(localnsIWebBrowserFind, nsIWebBrowserFindInFrames.class);
    localnsIWebBrowserFindInFrames.setSearchSubframes(paramSearchParams.isSearchInSubFrames());
    try
    {
      return localnsIWebBrowserFind.findNext();
    }
    catch (XPCOMException localXPCOMException) {}
    return false;
  }
  
  public BrowserPreferences getPreferences()
  {
    BrowserPreferences localBrowserPreferences = new BrowserPreferences();
    XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
    nsIWebBrowser localnsIWebBrowser = a.getWebBrowser();
    nsIInterfaceRequestor localnsIInterfaceRequestor = (nsIInterfaceRequestor)localXPCOMManager.queryInterface(localnsIWebBrowser, nsIInterfaceRequestor.class);
    ProxyObjectManager localProxyObjectManager = ProxyObjectManager.getInstance();
    nsIDocShell localnsIDocShell1 = (nsIDocShell)localXPCOMManager.getInterface(localnsIInterfaceRequestor, nsIDocShell.class);
    nsIDocShell localnsIDocShell2 = (nsIDocShell)localProxyObjectManager.proxyForObject(localnsIDocShell1, nsIDocShell.class, true);
    localBrowserPreferences.setAllowAuthentication(localnsIDocShell2.getAllowAuth());
    localBrowserPreferences.setAllowImages(localnsIDocShell2.getAllowImages());
    localBrowserPreferences.setAllowJavascript(localnsIDocShell2.getAllowJavascript());
    localBrowserPreferences.setAllowMetaRedirects(localnsIDocShell2.getAllowMetaRedirects());
    localBrowserPreferences.setAllowPlugins(localnsIDocShell2.getAllowPlugins());
    localBrowserPreferences.setAllowSubframes(localnsIDocShell2.getAllowSubframes());
    return localBrowserPreferences;
  }
  
  public BrowserClipboard getClipboardSupport()
  {
    return j;
  }
  
  public Component getComponent()
  {
    return a.getContainerComponent();
  }
  
  public Document getDocument()
  {
    final AtomicReference localAtomicReference = new AtomicReference(null);
    XPCOM.invokeAndWait(new d(localAtomicReference));
    return (Document)localAtomicReference.get();
  }
  
  public String getDocumentContent(String paramString)
  {
    final String str;
    if ((null == paramString) || (paramString.equals(""))) {
      str = "text/html";
    } else {
      str = paramString;
    }
    final AtomicReference localAtomicReference = new AtomicReference("");
    XPCOM.invokeAndWait(new e(localAtomicReference, str));
    return (String)localAtomicReference.get();
  }
  
  private String a(String paramString)
  {
    nsIWebBrowser localnsIWebBrowser = a.getWebBrowser();
    nsIDOMWindow localnsIDOMWindow = localnsIWebBrowser.getContentDOMWindow();
    nsIDOMDocument localnsIDOMDocument = localnsIDOMWindow.getDocument();
    ProxyObjectManager localProxyObjectManager = ProxyObjectManager.getInstance();
    nsIDocumentEncoder localnsIDocumentEncoder = (nsIDocumentEncoder)localProxyObjectManager.createComponentProxy("@mozilla.org/layout/documentEncoder;1?type=" + paramString, nsIDocumentEncoder.class);
    localnsIDocumentEncoder.init(localnsIDOMDocument, paramString, 4L);
    return localnsIDocumentEncoder.encodeToString();
  }
  
  public String getLocationURL()
  {
    return b.currentURI().getSpec();
  }
  
  public String getTitle()
  {
    return a.getTitle();
  }
  
  public void goBack()
  {
    b.goBack();
  }
  
  public void goForward()
  {
    b.goForward();
  }
  
  public synchronized boolean isDisposed()
  {
    return a == null;
  }
  
  public void navigate(String paramString)
  {
    b.navigate(paramString);
  }
  
  public void navigate(String paramString1, String paramString2)
  {
    b.navigate(paramString1, paramString2);
  }
  
  public void navigate(String paramString1, String paramString2, long paramLong)
  {
    b.navigate(paramString1, paramString2, paramLong);
  }
  
  public void refresh()
  {
    b.refresh();
  }
  
  public void stop()
  {
    b.stop();
  }
  
  public void setPreferences(final BrowserPreferences paramBrowserPreferences)
  {
    XPCOM.invokeAndWait(new b(paramBrowserPreferences));
  }
  
  public void setContent(String paramString)
  {
    setContent(paramString, null, null);
  }
  
  public void setContent(String paramString1, String paramString2)
  {
    setContent(paramString1, paramString2, null);
  }
  
  public void setContent(String paramString1, String paramString2, String paramString3)
  {
    String str1 = paramString2 != null ? paramString2 : "text/html";
    String str2 = paramString3 != null ? paramString3 : "UTF-8";
    a(paramString1, str1, str2, null);
  }
  
  public void setContentWithContext(String paramString1, String paramString2, String paramString3)
  {
    a(paramString1, paramString2, "UTF-8", paramString3);
  }
  
  private void a(final String paramString1, final String paramString2, final String paramString3, final String paramString4)
  {
    XPCOM.invokeAndWait(new c(paramString4, paramString1, paramString2, paramString3));
  }
  
  public void setFocusAtFirstElement()
  {
    throw new UnsupportedOperationException();
  }
  
  public void setWindowCreator(WindowCreator paramWindowCreator)
  {
    throw new UnsupportedOperationException();
  }
  
  public BufferedImage toImage()
  {
    return toImage(null);
  }
  
  public BufferedImage toImage(Dimension paramDimension)
  {
    try
    {
      WebPageRenderer localWebPageRenderer = new WebPageRenderer();
      if (paramDimension == null) {
        return ImageIO.read(localWebPageRenderer.render(getNsIWebBrowser()));
      }
      return ImageIO.read(localWebPageRenderer.render(getNsIWebBrowser(), paramDimension));
    }
    catch (IOException localIOException)
    {
      throw new RuntimeException("Cannot capture a web page.", localIOException);
    }
  }
  
  public void addDisposeListener(DisposeListener paramDisposeListener)
  {
    c.addDisposeListener(paramDisposeListener);
  }
  
  public void removeDisposeListener(DisposeListener paramDisposeListener)
  {
    c.removeDisposeListener(paramDisposeListener);
  }
  
  public List<DisposeListener> getDisposeListeners()
  {
    return c.getDisposeListeners();
  }
  
  public nsIWebBrowser getNsIWebBrowser()
  {
    return a.getWebBrowser();
  }
  
  public void saveWebPage(final File paramFile, final String paramString)
  {
    final CountDownLatch localCountDownLatch = new CountDownLatch(1);
    XPCOM.invokeAndWait(new a(localCountDownLatch, paramFile, paramString));
    try
    {
      localCountDownLatch.await();
    }
    catch (InterruptedException localInterruptedException)
    {
      throw new RuntimeException(localInterruptedException);
    }
  }
  
  public DownloadHandler getDownloadHandler()
  {
    return k;
  }
  
  public void setDownloadHandler(DownloadHandler paramDownloadHandler)
  {
    k = paramDownloadHandler;
  }
  
  class d
    implements Runnable
  {
    d(AtomicReference paramAtomicReference) {}
    
    public void run()
    {
      nsIWebBrowser localnsIWebBrowser = ActiveWebBrowserSupport.a(ActiveWebBrowserSupport.this).getWebBrowser();
      nsIDOMWindow localnsIDOMWindow = localnsIWebBrowser.getContentDOMWindow();
      nsIDOMDocument localnsIDOMDocument = localnsIDOMWindow.getDocument();
      localAtomicReference.set((Document)DomProxyFactory.createDomObjectProxy(localnsIDOMDocument));
    }
  }
  
  class e
    implements Runnable
  {
    e(AtomicReference paramAtomicReference, String paramString) {}
    
    public void run()
    {
      localAtomicReference.set(ActiveWebBrowserSupport.a(ActiveWebBrowserSupport.this, str));
    }
  }
  
  class b
    implements Runnable
  {
    b(BrowserPreferences paramBrowserPreferences) {}
    
    public void run()
    {
      XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
      nsIInterfaceRequestor localnsIInterfaceRequestor = (nsIInterfaceRequestor)localXPCOMManager.queryInterface(ActiveWebBrowserSupport.a(ActiveWebBrowserSupport.this).getWebBrowser(), nsIInterfaceRequestor.class);
      nsIDocShell localnsIDocShell = (nsIDocShell)localXPCOMManager.getInterface(localnsIInterfaceRequestor, nsIDocShell.class);
      localnsIDocShell.setAllowAuth(paramBrowserPreferences.isAllowAuthentication());
      localnsIDocShell.setAllowImages(paramBrowserPreferences.isAllowImages());
      localnsIDocShell.setAllowJavascript(paramBrowserPreferences.isAllowJavascript());
      localnsIDocShell.setAllowMetaRedirects(paramBrowserPreferences.isAllowMetaRedirects());
      localnsIDocShell.setAllowPlugins(paramBrowserPreferences.isAllowPlugins());
      localnsIDocShell.setAllowSubframes(paramBrowserPreferences.isAllowSubframes());
    }
  }
  
  class c
    implements Runnable
  {
    c(String paramString1, String paramString2, String paramString3, String paramString4) {}
    
    public void run()
    {
      XPCOMManager localXPCOMManager = XPCOMManager.getInstance();
      nsIURI localnsIURI;
      Object localObject;
      if (paramString4 == null)
      {
        localnsIURI = new e().a("about:blank");
        localObject = (nsIInterfaceRequestor)localXPCOMManager.queryInterface(getNsIWebBrowser(), nsIInterfaceRequestor.class);
        nsIDocShell localnsIDocShell = (nsIDocShell)localXPCOMManager.getInterface((nsIInterfaceRequestor)localObject, nsIDocShell.class);
        b localb = new b();
        nsIInputStream localnsIInputStream = localb.a(paramString1);
        localnsIDocShell.loadStream(localnsIInputStream, localnsIURI, paramString2, paramString3, null);
      }
      else
      {
        localnsIURI = new e().a(paramString4);
        localObject = (nsIWebBrowserStream)localXPCOMManager.queryInterface(getNsIWebBrowser(), nsIWebBrowserStream.class);
        ((nsIWebBrowserStream)localObject).openStream(localnsIURI, paramString2 + ";charset=" + paramString3);
        ((nsIWebBrowserStream)localObject).appendToStream(paramString1.getBytes(), paramString1.length());
        ((nsIWebBrowserStream)localObject).closeStream();
      }
    }
  }
  
  class a
    implements Runnable
  {
    a(CountDownLatch paramCountDownLatch, File paramFile, String paramString) {}
    
    public void run()
    {
      a locala = new a();
      nsIWebBrowser localnsIWebBrowser = getNsIWebBrowser();
      nsIWebBrowserPersist localnsIWebBrowserPersist = (nsIWebBrowserPersist)XPCOMManager.getInstance().queryInterface(localnsIWebBrowser, nsIWebBrowserPersist.class);
      File localFile = new File(paramFile, paramString);
      Mozilla localMozilla = Mozilla.getInstance();
      nsILocalFile localnsILocalFile1 = localMozilla.newLocalFile(localFile.getAbsolutePath(), false);
      nsILocalFile localnsILocalFile2 = localMozilla.newLocalFile(paramFile.getAbsolutePath(), false);
      nsIDOMDocument localnsIDOMDocument = localnsIWebBrowser.getContentDOMWindow().getDocument();
      localnsIWebBrowserPersist.setProgressListener(locala);
      localnsIWebBrowserPersist.saveDocument(localnsIDOMDocument, localnsILocalFile1, localnsILocalFile2, "text/html", 4L, 0L);
    }
    
    class a
      extends nsIWebProgressAdapter
    {
      a() {}
      
      public void onStateChange(nsIWebProgress paramnsIWebProgress, nsIRequest paramnsIRequest, long paramLong1, long paramLong2)
      {
        if (FlagUtil.checkFlag(paramLong1, 262160L)) {
          a.countDown();
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.ActiveWebBrowserSupport
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

class Browser$a$a
  implements Runnable
{
  Browser$a$a(Browser.a parama) {}
  
  public void run()
  {
    Browser.a(a.b, new DeadWebBrowserSupport());
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.Browser.a.a
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.a.a;
import com.teamdev.jxbrowser.gecko.xpcom.ChromeContainerWindow;

class Browser$a
  implements Runnable
{
  Browser$a(Browser paramBrowser, WebBrowserWindow paramWebBrowserWindow) {}
  
  public void run()
  {
    b.setWindowCreator(new a());
    Browser.a(b, new ActiveWebBrowserSupport(a));
    Browser.a(b).getChromeContainer().setTopLevelWebBrowser(b);
    Browser.a(b).getChromeContainer().setHandlerWhenMozillaDestroyWindow(new a());
  }
  
  class a
    implements Runnable
  {
    a() {}
    
    public void run()
    {
      Browser.a(b, new DeadWebBrowserSupport());
    }
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.Browser.a
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.a.a;
import com.teamdev.jxbrowser.gecko.a.c;
import com.teamdev.jxbrowser.gecko.a.d;
import com.teamdev.jxbrowser.gecko.download.DownloadHandler;
import com.teamdev.jxbrowser.gecko.events.ContextMenuListener;
import com.teamdev.jxbrowser.gecko.events.DisposeListener;
import com.teamdev.jxbrowser.gecko.events.HistoryChangeListener;
import com.teamdev.jxbrowser.gecko.events.RequestListener;
import com.teamdev.jxbrowser.gecko.events.StatusChangeListener;
import com.teamdev.jxbrowser.gecko.events.TitleChangeListener;
import com.teamdev.jxbrowser.gecko.xpcom.ChromeContainerWindow;
import com.teamdev.jxbrowser.gecko.xpcom.ProxyObjectManager;
import com.teamdev.jxbrowser.gecko.xpcom.XPCOM;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.List;
import org.mozilla.interfaces.nsIWebBrowser;
import org.mozilla.interfaces.nsIWindowWatcher;
import org.w3c.dom.Document;

public class Browser
  implements WebBrowser
{
  private static final String a = "@mozilla.org/embedcomp/window-watcher;1";
  private static d b;
  private WebBrowserSupport c;
  
  public Browser()
  {
    this(new c());
  }
  
  public Browser(final WebBrowserWindow paramWebBrowserWindow)
  {
    XPCOM.invokeAndWait(new a(paramWebBrowserWindow));
  }
  
  private d a()
  {
    if (b == null)
    {
      ProxyObjectManager localProxyObjectManager = ProxyObjectManager.getInstance();
      nsIWindowWatcher localnsIWindowWatcher = (nsIWindowWatcher)localProxyObjectManager.proxyForService("@mozilla.org/embedcomp/window-watcher;1", nsIWindowWatcher.class);
      b = new d();
      localnsIWindowWatcher.setWindowCreator(b);
    }
    return b;
  }
  
  public ChromeContainerWindow getChromeContainer()
  {
    return c.getChromeContainer();
  }
  
  public Component getComponent()
  {
    return c.getComponent();
  }
  
  public void navigate(String paramString)
  {
    c.navigate(paramString);
  }
  
  public void navigate(String paramString1, String paramString2)
  {
    c.navigate(paramString1, paramString2);
  }
  
  public void navigate(String paramString1, String paramString2, long paramLong)
  {
    c.navigate(paramString1, paramString2, paramLong);
  }
  
  public void setContent(String paramString)
  {
    c.setContent(paramString);
  }
  
  public void setContent(String paramString1, String paramString2)
  {
    c.setContent(paramString1, paramString2);
  }
  
  public void setContent(String paramString1, String paramString2, String paramString3)
  {
    c.setContent(paramString1, paramString2, paramString3);
  }
  
  public void setContentWithContext(String paramString1, String paramString2, String paramString3)
  {
    c.setContentWithContext(paramString1, paramString2, paramString3);
  }
  
  public void dispose()
  {
    if (isDisposed()) {
      return;
    }
    c.dispose();
    c = new DeadWebBrowserSupport();
  }
  
  public boolean isDisposed()
  {
    return c instanceof DeadWebBrowserSupport;
  }
  
  public String getLocationURL()
  {
    return c.getLocationURL();
  }
  
  public String getTitle()
  {
    return c.getTitle();
  }
  
  public void goForward()
  {
    c.goForward();
  }
  
  public void goBack()
  {
    c.goBack();
  }
  
  public void stop()
  {
    c.stop();
  }
  
  public void refresh()
  {
    c.refresh();
  }
  
  public void addRequestListener(RequestListener paramRequestListener)
  {
    c.addRequestListener(paramRequestListener);
  }
  
  public void removeRequestListener(RequestListener paramRequestListener)
  {
    c.removeRequestListener(paramRequestListener);
  }
  
  public List<RequestListener> getRequestListeners()
  {
    return c.getRequestListeners();
  }
  
  public void addStatusChangeListener(StatusChangeListener paramStatusChangeListener)
  {
    c.addStatusChangeListener(paramStatusChangeListener);
  }
  
  public void removeStatusChangeListener(StatusChangeListener paramStatusChangeListener)
  {
    c.removeStatusChangeListener(paramStatusChangeListener);
  }
  
  public List<StatusChangeListener> getStatusChangeListeners()
  {
    return c.getStatusChangeListeners();
  }
  
  public void addTitleChangeListener(TitleChangeListener paramTitleChangeListener)
  {
    c.addTitleChangeListener(paramTitleChangeListener);
  }
  
  public void removeTitleChangeListener(TitleChangeListener paramTitleChangeListener)
  {
    c.removeTitleChangeListener(paramTitleChangeListener);
  }
  
  public List<TitleChangeListener> getTitleChangeListeners()
  {
    return c.getTitleChangeListeners();
  }
  
  public void addContextMenuListener(ContextMenuListener paramContextMenuListener)
  {
    c.addContextMenuListener(paramContextMenuListener);
  }
  
  public void removeContextMenuListener(ContextMenuListener paramContextMenuListener)
  {
    c.removeContextMenuListener(paramContextMenuListener);
  }
  
  public List<ContextMenuListener> getContextMenuListeners()
  {
    return c.getContextMenuListeners();
  }
  
  public Document getDocument()
  {
    return c.getDocument();
  }
  
  public void activate()
  {
    c.activate();
  }
  
  public void deactivate()
  {
    c.deactivate();
  }
  
  public String evaluateScript(String paramString)
  {
    return c.evaluateScript(paramString);
  }
  
  public nsIWebBrowser getNsIWebBrowser()
  {
    return c.getNsIWebBrowser();
  }
  
  public BrowserClipboard getClipboardSupport()
  {
    return c.getClipboardSupport();
  }
  
  public void setFocusAtFirstElement()
  {
    c.setFocusAtFirstElement();
  }
  
  public boolean findNext(String paramString, SearchParams paramSearchParams)
  {
    return c.findNext(paramString, paramSearchParams);
  }
  
  public void setPreferences(BrowserPreferences paramBrowserPreferences)
  {
    c.setPreferences(paramBrowserPreferences);
  }
  
  public BrowserPreferences getPreferences()
  {
    return c.getPreferences();
  }
  
  public void displayAsSource(boolean paramBoolean)
  {
    c.displayAsSource(paramBoolean);
  }
  
  public String getDocumentContent(String paramString)
  {
    return c.getDocumentContent(paramString);
  }
  
  public BufferedImage toImage()
  {
    return c.toImage();
  }
  
  public BufferedImage toImage(Dimension paramDimension)
  {
    return c.toImage(paramDimension);
  }
  
  public void addDisposeListener(DisposeListener paramDisposeListener)
  {
    c.addDisposeListener(paramDisposeListener);
  }
  
  public void removeDisposeListener(DisposeListener paramDisposeListener)
  {
    c.removeDisposeListener(paramDisposeListener);
  }
  
  public List<DisposeListener> getDisposeListeners()
  {
    return c.getDisposeListeners();
  }
  
  public void addHistoryChangeListener(HistoryChangeListener paramHistoryChangeListener)
  {
    c.addHistoryChangeListener(paramHistoryChangeListener);
  }
  
  public void removeHistoryChangeListener(HistoryChangeListener paramHistoryChangeListener)
  {
    c.removeHistoryChangeListener(paramHistoryChangeListener);
  }
  
  public List<HistoryChangeListener> getHistoryChangeListeners()
  {
    return c.getHistoryChangeListeners();
  }
  
  public void setWindowCreator(WindowCreator paramWindowCreator)
  {
    a().a(paramWindowCreator);
  }
  
  public void saveWebPage(File paramFile, String paramString)
  {
    c.saveWebPage(paramFile, paramString);
  }
  
  public void setDownloadHandler(DownloadHandler paramDownloadHandler)
  {
    c.setDownloadHandler(paramDownloadHandler);
  }
  
  public DownloadHandler getDownloadHandler()
  {
    return c.getDownloadHandler();
  }
  
  class a
    implements Runnable
  {
    a(WebBrowserWindow paramWebBrowserWindow) {}
    
    public void run()
    {
      setWindowCreator(new a());
      Browser.a(Browser.this, new ActiveWebBrowserSupport(paramWebBrowserWindow));
      Browser.a(Browser.this).getChromeContainer().setTopLevelWebBrowser(Browser.this);
      Browser.a(Browser.this).getChromeContainer().setHandlerWhenMozillaDestroyWindow(new a());
    }
    
    class a
      implements Runnable
    {
      a() {}
      
      public void run()
      {
        Browser.a(Browser.this, new DeadWebBrowserSupport());
      }
    }
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.Browser
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import org.mozilla.interfaces.nsIBaseWindow;
import org.mozilla.interfaces.nsIClipboardCommands;
import org.mozilla.interfaces.nsIInterfaceRequestor;
import org.mozilla.interfaces.nsIWebBrowser;

class BrowserClipboard$k
  implements Runnable
{
  BrowserClipboard$k(BrowserClipboard paramBrowserClipboard) {}
  
  public void run()
  {
    nsIBaseWindow localnsIBaseWindow = (nsIBaseWindow)BrowserClipboard.a(a).queryInterface("{046bc8a0-8015-11d3-af70-00a024ffc08c}");
    nsIInterfaceRequestor localnsIInterfaceRequestor = (nsIInterfaceRequestor)localnsIBaseWindow.queryInterface("{033a1470-8b2a-11d3-af88-00a024ffc08c}");
    nsIClipboardCommands localnsIClipboardCommands = (nsIClipboardCommands)localnsIInterfaceRequestor.getInterface("{b8100c90-73be-11d2-92a5-00105a1b0d64}");
    if (localnsIClipboardCommands.canCutSelection()) {
      localnsIClipboardCommands.cutSelection();
    }
  }
}

/* Location:
 * Qualified Name:     com.teamdev.jxbrowser.gecko.BrowserClipboard.k
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.teamdev.jxbrowser.gecko;

import com.teamdev.jxbrowser.gecko.dom.DomProxyFactory.DomProxy;
import org.mozilla.interfaces.nsIDOMNSEditableElement;
import org.mozilla.interfaces.nsIEditor;
import org.mozilla.interfaces.nsISelectionController;
import org.mozilla.interfaces.nsISupports;
import org.w3c.dom.Node;

class BrowserClipboard$f
  implements Runnable
{
  BrowserClipboard$f(BrowserClipboard paramBrowserClipboard, Node paramNode) {}
  
  public void run()
  {
    nsISupports localnsISupports = ((DomProxyFactory.DomProxy)a).getImplementingEntity();
    nsIDOMNSEditableElement localnsIDOMNSEditableElement = (nsIDOMNSEditableElement)localnsISupports.queryInterface("{b33eb56c-3120-418c-892b-774b00c7dde8}");
    nsIEditor l
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd