engine-webkit-3.3

16:35:46.530 INFO  jd.cli.Main - Decompiling engine-webkit-3.3.jar
package com.teamdev.jxbrowser.safari;

import com.teamdev.jxbrowser.BrowserFunction;
import com.teamdev.jxbrowser.webkit.SafariBrowserFunction;

public class BrowserFunctionProxy
  implements SafariBrowserFunction
{
  private final BrowserFunction proxy;
  
  public BrowserFunctionProxy(BrowserFunction paramBrowserFunction)
  {
    proxy = paramBrowserFunction;
  }
  
  public Object invoke(Object... paramVarArgs)
  {
    return proxy.invoke(paramVarArgs);
  }
}

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

import com.teamdev.jxbrowser.BrowserServices;
import com.teamdev.jxbrowser.events.NavigationEvent;

class PolicyDelegate
  implements com.teamdev.jxbrowser.webkit.WebPolicyDelegate
{
  private SafariEvents safariEvents;
  
  public PolicyDelegate(SafariEvents paramSafariEvents)
  {
    safariEvents = paramSafariEvents;
  }
  
  public boolean allowNavigation(String paramString)
  {
    BrowserServices localBrowserServices = safariEvents.getBrowser().getServices();
    com.teamdev.jxbrowser.WebPolicyDelegate localWebPolicyDelegate = localBrowserServices.getWebPolicyDelegate();
    return (localWebPolicyDelegate == null) || (localWebPolicyDelegate.allowNavigation(new NavigationEvent(safariEvents.getBrowser(), paramString)));
  }
  
  public boolean allowMimeType(String paramString1, String paramString2)
  {
    BrowserServices localBrowserServices = safariEvents.getBrowser().getServices();
    com.teamdev.jxbrowser.WebPolicyDelegate localWebPolicyDelegate = localBrowserServices.getWebPolicyDelegate();
    return (localWebPolicyDelegate == null) || (localWebPolicyDelegate.allowMimeType(paramString1, new NavigationEvent(safariEvents.getBrowser(), paramString2)));
  }
}

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

import com.teamdev.jxbrowser.AbstractBrowser;
import com.teamdev.jxbrowser.BrowserFunction;
import com.teamdev.jxbrowser.BrowserType;
import com.teamdev.jxbrowser.Configurable;
import com.teamdev.jxbrowser.ContextMenuHandler;
import com.teamdev.jxbrowser.dom.DOMFactory;
import com.teamdev.jxbrowser.events.DisposeEvent;
import com.teamdev.jxbrowser.print.PrintEvent;
import com.teamdev.jxbrowser.print.PrintListener;
import com.teamdev.jxbrowser.safari.dom.SafariDOMFactory;
import com.teamdev.jxbrowser.security.HttpSecurityHandler;
import com.teamdev.jxbrowser.webkit.Safari;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Image;
import java.util.List;
import org.w3c.dom.Document;

public final class SafariBrowser
  extends AbstractBrowser<Safari>
{
  private Safari engine;
  private SafariEvents events;
  private SafariConfigurable configurable;
  private DOMFactory domFactory;
  private HttpSecurityHandler handler;
  
  SafariBrowser()
  {
    this(new Safari());
  }
  
  SafariBrowser(Safari paramSafari)
  {
    engine = paramSafari;
    events = new SafariEvents(this);
    domFactory = new SafariDOMFactory(paramSafari);
    configurable = new SafariConfigurable(this);
    SafariNewWindowManager.register(this);
    new SafariPromptService(this);
  }
  
  public Component getComponent()
  {
    return engine.getComponent();
  }
  
  public String getContent()
  {
    return engine.getHTML();
  }
  
  public Document getDocument()
  {
    return domFactory.createDocument(engine.getDocument());
  }
  
  public BrowserType getType()
  {
    return BrowserType.Safari;
  }
  
  public void setContent(String paramString)
  {
    events.setNavigationFinished(false);
    setContent(paramString, null);
  }
  
  public void setContent(String paramString1, String paramString2)
  {
    engine.setHTML(paramString1, paramString2);
  }
  
  public Image toImage(boolean paramBoolean)
  {
    return engine.toImage();
  }
  
  public Image toImage(Dimension paramDimension)
  {
    return engine.toImage(paramDimension);
  }
  
  public void goBack()
  {
    engine.goBack();
  }
  
  public void goForward()
  {
    engine.goForward();
  }
  
  public boolean isNavigationFinished()
  {
    return events.isNavigationFinished();
  }
  
  public void navigate(String paramString)
  {
    engine.navigate(paramString);
  }
  
  public void navigate(String paramString1, String paramString2)
  {
    navigate(paramString1, paramString2, 0);
  }
  
  public void navigate(String paramString1, String paramString2, int paramInt)
  {
    if (paramString1 == null) {
      throw new NullPointerException("The location parameter cannot be null.");
    }
    engine.navigate(paramString1, paramString2, paramInt);
  }
  
  public void refresh()
  {
    engine.reload();
  }
  
  public void stop()
  {
    engine.stop();
  }
  
  public boolean canGoBack()
  {
    return engine.canGoBack();
  }
  
  public boolean canGoForward()
  {
    return engine.canGoForward();
  }
  
  public List<String> getAllHistory()
  {
    throw new UnsupportedOperationException();
  }
  
  public int getCurrentIndex()
  {
    throw new UnsupportedOperationException();
  }
  
  public String getCurrentLocation()
  {
    return engine.getLocationURL();
  }
  
  public HttpSecurityHandler getHttpSecurityHandler()
  {
    return handler;
  }
  
  public void setHttpSecurityHandler(HttpSecurityHandler paramHttpSecurityHandler)
  {
    handler = paramHttpSecurityHandler;
  }
  
  public String executeScript(String paramString)
  {
    return engine.executeScript(paramString);
  }
  
  public ContextMenuHandler getContextMenuHandler()
  {
    throw new UnsupportedOperationException();
  }
  
  public String getStatusMessage()
  {
    return events.getStatusMessage();
  }
  
  public String getTitle()
  {
    return events.getTitle();
  }
  
  public void setContextMenuHandler(ContextMenuHandler paramContextMenuHandler)
  {
    throw new UnsupportedOperationException();
  }
  
  public void dispose()
  {
    super.dispose();
    if (!isDisposed())
    {
      engine.dispose();
      notifyListeners(new DisposeEvent(this));
    }
  }
  
  public boolean isDisposed()
  {
    return engine.isDisposed();
  }
  
  public Configurable getConfigurable()
  {
    return configurable;
  }
  
  public void setUserAgent(String paramString)
  {
    engine.setUserAgent(paramString);
  }
  
  public Safari getPeer()
  {
    return engine;
  }
  
  public boolean isReady()
  {
    return engine.isReady();
  }
  
  public void registerFunction(String paramString, BrowserFunction paramBrowserFunction)
  {
    engine.registerFunction(paramString, new BrowserFunctionProxy(paramBrowserFunction));
  }
  
  public void print()
  {
    engine.print();
  }
  
  public void print(PrintListener paramPrintListener)
  {
    paramPrintListener.started(new PrintEvent(this));
    boolean bool = engine.print();
    if (bool) {
      paramPrintListener.finished(new PrintEvent(this));
    } else {
      paramPrintListener.canceled(new PrintEvent(this));
    }
  }
}

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

import com.teamdev.jxbrowser.Browser;
import com.teamdev.jxbrowser.BrowserFactory;

public final class SafariBrowserFactory
  extends BrowserFactory
{
  protected Browser create()
  {
    return new SafariBrowser();
  }
}

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

import com.jniwrapper.PlatformContext;
import com.teamdev.jxbrowser.BrowserType;

public class SafariBrowserType
  extends BrowserType
{
  public boolean isSupported()
  {
    return (PlatformContext.isMacOS()) && (!PlatformContext.isPPC()) && (!PlatformContext.isPPC64());
  }
  
  public String getName()
  {
    return "Safari";
  }
}

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

import com.teamdev.jxbrowser.cache.CacheStorage;
import com.teamdev.jxbrowser.webkit.SafariEngine;

public class SafariCacheStorage
  extends CacheStorage
{
  public void clearCache() {}
}

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

class SafariConfigurable$1 {}

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

abstract interface SafariConfigurable$FeatureStateChanger
{
  public abstract void change(boolean paramBoolean);
}

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

import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.webkit.WebPreferences;

class SafariConfigurable$ImagesStateChanger
  implements SafariConfigurable.FeatureStateChanger
{
  private SafariConfigurable$ImagesStateChanger(SafariConfigurable paramSafariConfigurable) {}
  
  public void change(boolean paramBoolean)
  {
    SafariConfigurable.access$400(this$0).setLoadsImagesAutomatically(paramBoolean);
    SafariConfigurable.access$500(this$0).getPeer().setPreferences(SafariConfigurable.access$400(this$0));
  }
}

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

import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.webkit.WebPreferences;

class SafariConfigurable$JavaPluginStateChanger
  implements SafariConfigurable.FeatureStateChanger
{
  private SafariConfigurable$JavaPluginStateChanger(SafariConfigurable paramSafariConfigurable) {}
  
  public void change(boolean paramBoolean)
  {
    SafariConfigurable.access$400(this$0).setJavaEnabled(paramBoolean);
    SafariConfigurable.access$500(this$0).getPeer().setPreferences(SafariConfigurable.access$400(this$0));
  }
}

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

import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.webkit.WebPreferences;

class SafariConfigurable$JavascriptStateChanger
  implements SafariConfigurable.FeatureStateChanger
{
  private SafariConfigurable$JavascriptStateChanger(SafariConfigurable paramSafariConfigurable) {}
  
  public void change(boolean paramBoolean)
  {
    SafariConfigurable.access$400(this$0).setJavaScriptEnabled(paramBoolean);
    SafariConfigurable.access$500(this$0).getPeer().setPreferences(SafariConfigurable.access$400(this$0));
  }
}

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

import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.webkit.WebPreferences;

class SafariConfigurable$PluginsStateChanger
  implements SafariConfigurable.FeatureStateChanger
{
  private SafariConfigurable$PluginsStateChanger(SafariConfigurable paramSafariConfigurable) {}
  
  public void change(boolean paramBoolean)
  {
    SafariConfigurable.access$400(this$0).setPlugInsEnabled(paramBoolean);
    SafariConfigurable.access$400(this$0).setJavaEnabled(false);
    SafariConfigurable.access$500(this$0).getPeer().setPreferences(SafariConfigurable.access$400(this$0));
  }
}

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

import com.teamdev.jxbrowser.Configurable;
import com.teamdev.jxbrowser.Feature;
import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.webkit.WebPreferences;
import java.awt.Font;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

class SafariConfigurable
  implements Configurable
{
  private SafariBrowser browser;
  private WebPreferences preferences;
  private final Map<Feature, FeatureStateChanger> features;
  
  SafariConfigurable(SafariBrowser paramSafariBrowser)
  {
    browser = paramSafariBrowser;
    preferences = paramSafariBrowser.getPeer().getPreferences();
    features = new HashMap();
    features.put(Feature.DOWNLOAD_IMAGES, new ImagesStateChanger(null));
    features.put(Feature.JAVASCRIPT, new JavascriptStateChanger(null));
    features.put(Feature.PLUGINS, new PluginsStateChanger(null));
    new JavaPluginStateChanger(null).change(false);
  }
  
  public void disableFeature(Feature paramFeature)
  {
    update(paramFeature, false);
  }
  
  public void enableFeature(Feature paramFeature)
  {
    update(paramFeature, true);
  }
  
  public Map<Feature, Boolean> getFeatures()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put(Feature.DOWNLOAD_IMAGES, Boolean.valueOf(preferences.canLoadsImagesAutomatically()));
    localHashMap.put(Feature.JAVASCRIPT, Boolean.valueOf(preferences.isJavaScriptEnabled()));
    localHashMap.put(Feature.PLUGINS, Boolean.valueOf((preferences.arePlugInsEnabled()) && (preferences.isJavaEnabled())));
    return localHashMap;
  }
  
  public void setFeatures(Map<Feature, Boolean> paramMap)
  {
    Iterator localIterator = paramMap.keySet().iterator();
    while (localIterator.hasNext())
    {
      Feature localFeature = (Feature)localIterator.next();
      update(localFeature, ((Boolean)paramMap.get(localFeature)).booleanValue());
    }
  }
  
  public Font getDefaultFont()
  {
    String str = preferences.standardFontFamily();
    int i = preferences.defaultFontSize();
    return new Font(str, 0, i);
  }
  
  public void setDefaultFont(Font paramFont)
  {
    preferences.setStandardFontFamily(paramFont.getName());
    preferences.setDefaultFontSize(paramFont.getSize());
  }
  
  public int getZoomValue()
  {
    throw new UnsupportedOperationException();
  }
  
  public void setZoomValue(int paramInt)
  {
    if ((paramInt < 10) || (paramInt > 1000)) {
      throw new IllegalArgumentException("Zoom value must be between 10 and 1000.");
    }
    throw new UnsupportedOperationException();
  }
  
  private void update(Feature paramFeature, boolean paramBoolean)
  {
    if (features.containsKey(paramFeature)) {
      ((FeatureStateChanger)features.get(paramFeature)).change(paramBoolean);
    }
  }
  
  private class JavaPluginStateChanger
    implements SafariConfigurable.FeatureStateChanger
  {
    private JavaPluginStateChanger() {}
    
    public void change(boolean paramBoolean)
    {
      preferences.setJavaEnabled(paramBoolean);
      browser.getPeer().setPreferences(preferences);
    }
  }
  
  private class PluginsStateChanger
    implements SafariConfigurable.FeatureStateChanger
  {
    private PluginsStateChanger() {}
    
    public void change(boolean paramBoolean)
    {
      preferences.setPlugInsEnabled(paramBoolean);
      preferences.setJavaEnabled(false);
      browser.getPeer().setPreferences(preferences);
    }
  }
  
  private class JavascriptStateChanger
    implements SafariConfigurable.FeatureStateChanger
  {
    private JavascriptStateChanger() {}
    
    public void change(boolean paramBoolean)
    {
      preferences.setJavaScriptEnabled(paramBoolean);
      browser.getPeer().setPreferences(preferences);
    }
  }
  
  private class ImagesStateChanger
    implements SafariConfigurable.FeatureStateChanger
  {
    private ImagesStateChanger() {}
    
    public void change(boolean paramBoolean)
    {
      preferences.setLoadsImagesAutomatically(paramBoolean);
      browser.getPeer().setPreferences(preferences);
    }
  }
  
  private static abstract interface FeatureStateChanger
  {
    public abstract void change(boolean paramBoolean);
  }
}

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

import com.teamdev.jxbrowser.ContextMenuHandler;
import com.teamdev.jxbrowser.webkit.Properties;
import com.teamdev.jxbrowser.webkit.Safari;

public class SafariContextMenu
{
  private SafariBrowser browser;
  private ContextMenuHandler handler;
  
  SafariContextMenu(SafariBrowser paramSafariBrowser)
  {
    browser = paramSafariBrowser;
  }
  
  public ContextMenuHandler getContextMenuHandler()
  {
    return handler;
  }
  
  public void setContextMenuHandler(ContextMenuHandler paramContextMenuHandler)
  {
    handler = paramContextMenuHandler;
    browser.getPeer().getProperties().setAllowContextMenu(paramContextMenuHandler == null);
    if (paramContextMenuHandler != null) {}
  }
}

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

import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookieStorage;

class SafariCookieStorage$1
  implements Runnable
{
  SafariCookieStorage$1(SafariCookieStorage paramSafariCookieStorage) {}
  
  public void run()
  {
    SafariCookieStorage.access$002(this$0, NSHttpCookieStorage.sharedHTTPCookieStorage());
  }
}

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

import com.jniwrapper.UInt16;
import com.teamdev.jxbrowser.webkit.cocoa.Id;
import com.teamdev.jxbrowser.webkit.cocoa.nsarray.NSArray;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookie;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookieStorage;
import java.util.List;

class SafariCookieStorage$2
  implements Runnable
{
  SafariCookieStorage$2(SafariCookieStorage paramSafariCookieStorage, List paramList) {}
  
  public void run()
  {
    NSArray localNSArray = SafariCookieStorage.access$000(this$0).cookies();
    UInt16 localUInt16 = localNSArray.count();
    for (int i = 0; i < localUInt16.getValue(); i++)
    {
      Id localId = localNSArray.objectAtIndex(new UInt16(i));
      NSHttpCookie localNSHttpCookie = new NSHttpCookie(localId);
      val$result.add(SafariCookieStorage.access$100(this$0, localNSHttpCookie));
    }
  }
}

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

import com.jniwrapper.UInt16;
import com.teamdev.jxbrowser.webkit.cocoa.Id;
import com.teamdev.jxbrowser.webkit.cocoa.nsarray.NSArray;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookie;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookieStorage;
import com.teamdev.jxbrowser.webkit.cocoa.nsurl.NSURL;
import java.util.List;

class SafariCookieStorage$3
  implements Runnable
{
  SafariCookieStorage$3(SafariCookieStorage paramSafariCookieStorage, String paramString, List paramList) {}
  
  public void run()
  {
    NSArray localNSArray = SafariCookieStorage.access$000(this$0).cookiesForURL(NSURL.NSURL_URLWithString(val$url));
    UInt16 localUInt16 = localNSArray.count();
    for (int i = 0; i < localUInt16.getValue(); i++)
    {
      Id localId = localNSArray.objectAtIndex(new UInt16(i));
      NSHttpCookie localNSHttpCookie = new NSHttpCookie(localId);
      val$result.add(SafariCookieStorage.access$100(this$0, localNSHttpCookie));
    }
  }
}

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

import com.teamdev.jxbrowser.cookie.HttpCookie;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookieStorage;

class SafariCookieStorage$4
  implements Runnable
{
  SafariCookieStorage$4(SafariCookieStorage paramSafariCookieStorage, HttpCookie paramHttpCookie) {}
  
  public void run()
  {
    SafariCookieStorage.access$000(this$0).setCookie(SafariCookieStorage.access$200(this$0, val$cookie));
  }
}

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

import com.teamdev.jxbrowser.cookie.HttpCookie;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookieStorage;

class SafariCookieStorage$5
  implements Runnable
{
  SafariCookieStorage$5(SafariCookieStorage paramSafariCookieStorage, HttpCookie paramHttpCookie) {}
  
  public void run()
  {
    SafariCookieStorage.access$000(this$0).deleteCookie(SafariCookieStorage.access$200(this$0, val$cookie));
  }
}

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

import com.jniwrapper.AnsiString;
import com.jniwrapper.Parameter;
import com.jniwrapper.Pointer.Void;
import com.jniwrapper.UInt16;
import com.teamdev.jxbrowser.cookie.HttpCookie;
import com.teamdev.jxbrowser.cookie.HttpCookieStorage;
import com.teamdev.jxbrowser.webkit.cocoa.Id;
import com.teamdev.jxbrowser.webkit.cocoa.nsarray.NSArray;
import com.teamdev.jxbrowser.webkit.cocoa.nsdate.NSDate;
import com.teamdev.jxbrowser.webkit.cocoa.nsdate.NSTimeInterval;
import com.teamdev.jxbrowser.webkit.cocoa.nsdictionary.NSDictionary;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookie;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookieProperty;
import com.teamdev.jxbrowser.webkit.cocoa.nshttpcookie.NSHttpCookieStorage;
import com.teamdev.jxbrowser.webkit.cocoa.nsstring.NSString;
import com.teamdev.jxbrowser.webkit.cocoa.nsurl.NSURL;
import com.teamdev.jxdesktop.macosx.MainMessageLoop;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class SafariCookieStorage
  extends HttpCookieStorage
{
  private NSHttpCookieStorage storage;
  
  public SafariCookieStorage()
  {
    MainMessageLoop.invokeAndWait(new Runnable()
    {
      public void run()
      {
        storage = NSHttpCookieStorage.sharedHTTPCookieStorage();
      }
    });
  }
  
  public List<HttpCookie> getCookies()
  {
    final ArrayList localArrayList = new ArrayList();
    MainMessageLoop.invokeAndWait(new Runnable()
    {
      public void run()
      {
        NSArray localNSArray = storage.cookies();
        UInt16 localUInt16 = localNSArray.count();
        for (int i = 0; i < localUInt16.getValue(); i++)
        {
          Id localId = localNSArray.objectAtIndex(new UInt16(i));
          NSHttpCookie localNSHttpCookie = new NSHttpCookie(localId);
          localArrayList.add(SafariCookieStorage.this.safariCookieToJxBrowserCookie(localNSHttpCookie));
        }
      }
    });
    return localArrayList;
  }
  
  public List<HttpCookie> getCookies(final String paramString)
  {
    final ArrayList localArrayList = new ArrayList();
    MainMessageLoop.invokeAndWait(new Runnable()
    {
      public void run()
      {
        NSArray localNSArray = storage.cookiesForURL(NSURL.NSURL_URLWithString(paramString));
        UInt16 localUInt16 = localNSArray.count();
        for (int i = 0; i < localUInt16.getValue(); i++)
        {
          Id localId = localNSArray.objectAtIndex(new UInt16(i));
          NSHttpCookie localNSHttpCookie = new NSHttpCookie(localId);
          localArrayList.add(SafariCookieStorage.this.safariCookieToJxBrowserCookie(localNSHttpCookie));
        }
      }
    });
    return localArrayList;
  }
  
  public void setCookie(final HttpCookie paramHttpCookie, String paramString)
  {
    MainMessageLoop.invokeAndWait(new Runnable()
    {
      public void run()
      {
        storage.setCookie(SafariCookieStorage.this.jxBrowserCookieToSafariCookie(paramHttpCookie));
      }
    });
  }
  
  public void setCookie(List<HttpCookie> paramList, String paramString)
  {
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
    {
      HttpCookie localHttpCookie = (HttpCookie)localIterator.next();
      setCookie(localHttpCookie, paramString);
    }
  }
  
  public void deleteCookie(final HttpCookie paramHttpCookie)
  {
    MainMessageLoop.invokeAndWait(new Runnable()
    {
      public void run()
      {
        storage.deleteCookie(SafariCookieStorage.this.jxBrowserCookieToSafariCookie(paramHttpCookie));
      }
    });
  }
  
  public void deleteCookie(List<HttpCookie> paramList)
  {
    Iterator localIterator = paramList.iterator();
    while (localIterator.hasNext())
    {
      HttpCookie localHttpCookie = (HttpCookie)localIterator.next();
      deleteCookie(localHttpCookie);
    }
  }
  
  private HttpCookie safariCookieToJxBrowserCookie(NSHttpCookie paramNSHttpCookie)
  {
    String str1 = paramNSHttpCookie.name().cString().getValue();
    String str2 = paramNSHttpCookie.value().cString().getValue();
    String str3 = paramNSHttpCookie.domain().cString().getValue();
    String str4 = paramNSHttpCookie.path().cString().getValue();
    boolean bool1 = paramNSHttpCookie.isSessionOnly();
    boolean bool2 = paramNSHttpCookie.isHTTPOnly();
    boolean bool3 = paramNSHttpCookie.isSecure();
    long l = paramNSHttpCookie.expiresDate().timeIntervalSince1970().getValue();
    return new HttpCookie(str1, str2, str3, str4, l, bool2, bool3, bool1);
  }
  
  private NSHttpCookie jxBrowserCookieToSafariCookie(HttpCookie paramHttpCookie)
  {
    NSHttpCookieProperty localNSHttpCookieProperty = NSHttpCookieProperty.getInstance();
    NSString localNSString1 = localNSHttpCookieProperty.getPropertyName("NSHTTPCookieName");
    NSString localNSString2 = localNSHttpCookieProperty.getPropertyName("NSHTTPCookieValue");
    NSString localNSString3 = localNSHttpCookieProperty.getPropertyName("NSHTTPCookieDomain");
    NSString localNSString4 = localNSHttpCookieProperty.getPropertyName("NSHTTPCookiePath");
    NSString localNSString5 = localNSHttpCookieProperty.getPropertyName("NSHTTPCookieExpires");
    NSString localNSString6 = NSString.NSString_stringWithString(paramHttpCookie.getName());
    NSString localNSString7 = NSString.NSString_stringWithString(paramHttpCookie.getValue());
    NSString localNSString8 = NSString.NSString_stringWithString(paramHttpCookie.getDomain());
    NSString localNSString9 = NSString.NSString_stringWithString(paramHttpCookie.getPath());
    NSDate localNSDate = NSDate.NSDate_dateWithTimeIntervalSinceReferenceDate(new NSTimeInterval(paramHttpCookie.getExpiresDate()));
    NSArray localNSArray1 = NSArray.NSArray_arrayWithObjects(localNSString1, new Parameter[] { localNSString2, localNSString3, localNSString4, localNSString5, new Pointer.Void() });
    NSArray localNSArray2 = NSArray.NSArray_arrayWithObjects(localNSString6, new Parameter[] { localNSString7, localNSString8, localNSString9, localNSDate, new Pointer.Void() });
    NSDictionary localNSDictionary = NSDictionary.NSDictionary_dictionaryWithObjects_forKeys(localNSArray2, localNSArray1);
    return NSHttpCookie.cookieWithProperties(localNSDictionary);
  }
}

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

class SafariEvents$1 {}

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

import com.teamdev.jxbrowser.events.NavigationEvent;
import com.teamdev.jxbrowser.events.NavigationFinishedEvent;
import com.teamdev.jxbrowser.events.ProgressChangedEvent;
import com.teamdev.jxbrowser.events.StatusChangedEvent;
import com.teamdev.jxbrowser.events.TitleChangedEvent;
import com.teamdev.jxbrowser.webkit.event.BrowserEvent;
import com.teamdev.jxbrowser.webkit.event.BrowserListener;

class SafariEvents$SafariBrowserListener
  implements BrowserListener
{
  private SafariEvents$SafariBrowserListener(SafariEvents paramSafariEvents) {}
  
  public void onTitleChange(BrowserEvent paramBrowserEvent)
  {
    SafariEvents.access$102(this$0, paramBrowserEvent.getTitle());
    SafariEvents.access$200(this$0).notifyListeners(new TitleChangedEvent(SafariEvents.access$200(this$0), SafariEvents.access$100(this$0)));
  }
  
  public void onStatusChange(BrowserEvent paramBrowserEvent)
  {
    SafariEvents.access$200(this$0).notifyListeners(new StatusChangedEvent(SafariEvents.access$200(this$0), paramBrowserEvent.getStatus()));
  }
  
  public void onDownloadBegin(BrowserEvent paramBrowserEvent)
  {
    this$0.setNavigationFinished(false);
    SafariEvents.access$200(this$0).notifyListeners(new NavigationEvent(SafariEvents.access$200(this$0), paramBrowserEvent.getUrl()));
  }
  
  public void onDownloadComplete(BrowserEvent paramBrowserEvent)
  {
    this$0.setNavigationFinished(true);
    SafariEvents.access$200(this$0).notifyListeners(new NavigationFinishedEvent(SafariEvents.access$200(this$0), SafariEvents.access$300(this$0, paramBrowserEvent.getStatusCode()), paramBrowserEvent.getUrl()));
  }
  
  public void onNavigationErrorOccurred(BrowserEvent paramBrowserEvent)
  {
    this$0.setNavigationFinished(true);
    SafariEvents.access$200(this$0).notifyListeners(new NavigationFinishedEvent(SafariEvents.access$200(this$0), SafariEvents.access$300(this$0, paramBrowserEvent.getStatusCode()), paramBrowserEvent.getUrl()));
  }
  
  public void onProgressChanged(long paramLong)
  {
    SafariEvents.access$200(this$0).notifyListeners(new ProgressChangedEvent(SafariEvents.access$200(this$0), paramLong, 100L));
  }
}

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

import com.teamdev.jxbrowser.events.NavigationEvent;
import com.teamdev.jxbrowser.events.NavigationFinishedEvent;
import com.teamdev.jxbrowser.events.NavigationStatusCode;
import com.teamdev.jxbrowser.events.ProgressChangedEvent;
import com.teamdev.jxbrowser.events.StatusChangedEvent;
import com.teamdev.jxbrowser.events.TitleChangedEvent;
import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.event.BrowserEvent;
import com.teamdev.jxbrowser.webkit.event.BrowserListener;
import com.teamdev.jxbrowser.webkit.event.StatusCode;

class SafariEvents
{
  private SafariBrowser browser;
  private String documentTitle;
  private boolean navigationFinished;
  
  public SafariEvents(SafariBrowser paramSafariBrowser)
  {
    browser = paramSafariBrowser;
    browser.getPeer().addBrowserListener(new SafariBrowserListener(null));
    browser.getPeer().setWebPolicyDelegate(new PolicyDelegate(this));
  }
  
  public SafariBrowser getBrowser()
  {
    return browser;
  }
  
  public boolean isNavigationFinished()
  {
    return navigationFinished;
  }
  
  boolean isReady()
  {
    return browser.getPeer().isReady();
  }
  
  public String getStatusMessage()
  {
    return "";
  }
  
  public String getTitle()
  {
    return documentTitle;
  }
  
  private NavigationStatusCode getNavigationStatusCode(StatusCode paramStatusCode)
  {
    return new NavigationStatusCode(paramStatusCode.getValue(), paramStatusCode.getDescription());
  }
  
  public void setNavigationFinished(boolean paramBoolean)
  {
    navigationFinished = paramBoolean;
  }
  
  private class SafariBrowserListener
    implements BrowserListener
  {
    private SafariBrowserListener() {}
    
    public void onTitleChange(BrowserEvent paramBrowserEvent)
    {
      documentTitle = paramBrowserEvent.getTitle();
      browser.notifyListeners(new TitleChangedEvent(browser, documentTitle));
    }
    
    public void onStatusChange(BrowserEvent paramBrowserEvent)
    {
      browser.notifyListeners(new StatusChangedEvent(browser, paramBrowserEvent.getStatus()));
    }
    
    public void onDownloadBegin(BrowserEvent paramBrowserEvent)
    {
      setNavigationFinished(false);
      browser.notifyListeners(new NavigationEvent(browser, paramBrowserEvent.getUrl()));
    }
    
    public void onDownloadComplete(BrowserEvent paramBrowserEvent)
    {
      setNavigationFinished(true);
      browser.notifyListeners(new NavigationFinishedEvent(browser, SafariEvents.this.getNavigationStatusCode(paramBrowserEvent.getStatusCode()), paramBrowserEvent.getUrl()));
    }
    
    public void onNavigationErrorOccurred(BrowserEvent paramBrowserEvent)
    {
      setNavigationFinished(true);
      browser.notifyListeners(new NavigationFinishedEvent(browser, SafariEvents.this.getNavigationStatusCode(paramBrowserEvent.getStatusCode()), paramBrowserEvent.getUrl()));
    }
    
    public void onProgressChanged(long paramLong)
    {
      browser.notifyListeners(new ProgressChangedEvent(browser, paramLong, 100L));
    }
  }
}

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

class SafariNewWindowManager$1 {}

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

import com.teamdev.jxbrowser.NewWindowContainer;
import com.teamdev.jxbrowser.VisualWindowContainer;
import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.WebBrowser;
import com.teamdev.jxbrowser.webkit.WebBrowserWindow;
import java.awt.Rectangle;

class SafariNewWindowManager$PopupWindow
  implements WebBrowserWindow
{
  private NewWindowContainer windowContainer;
  private SafariBrowser safariBrowser;
  
  private SafariNewWindowManager$PopupWindow(NewWindowContainer paramNewWindowContainer)
  {
    windowContainer = paramNewWindowContainer;
  }
  
  public void createWindow(WebBrowser paramWebBrowser)
  {
    safariBrowser = new SafariBrowser((Safari)paramWebBrowser);
    windowContainer.insertBrowser(safariBrowser);
  }
  
  public void disposeWindow()
  {
    safariBrowser.dispose();
  }
  
  public void setVisible(boolean paramBoolean)
  {
    if ((windowContainer instanceof VisualWindowContainer)) {
      ((VisualWindowContainer)windowContainer).setVisible(paramBoolean);
    }
  }
  
  public void setBounds(Rectangle paramRectangle)
  {
    if ((windowContainer instanceof VisualWindowContainer))
    {
      ((VisualWindowContainer)windowContainer).setLocation(paramRectangle.getLocation());
      ((VisualWindowContainer)windowContainer).setSize(paramRectangle.getSize());
    }
  }
}

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

import com.teamdev.jxbrowser.BrowserServices;
import com.teamdev.jxbrowser.NewWindowContainer;
import com.teamdev.jxbrowser.NewWindowManager;
import com.teamdev.jxbrowser.NewWindowParams;
import com.teamdev.jxbrowser.webkit.WebBrowserWindow;
import com.teamdev.jxbrowser.webkit.WindowCreator;
import java.awt.Component;
import java.awt.Rectangle;

class SafariNewWindowManager$SafariWindowCreator
  implements WindowCreator
{
  private SafariBrowser parent;
  
  private SafariNewWindowManager$SafariWindowCreator(SafariBrowser paramSafariBrowser)
  {
    parent = paramSafariBrowser;
  }
  
  public WebBrowserWindow createWindow()
  {
    BrowserServices localBrowserServices = BrowserServices.getInstance();
    NewWindowManager localNewWindowManager = localBrowserServices.getNewWindowManager();
    if (localNewWindowManager != null)
    {
      Rectangle localRectangle = parent.getComponent().getBounds();
      NewWindowParams localNewWindowParams = new NewWindowParams(parent, localRectangle, "", "");
      NewWindowContainer localNewWindowContainer = localNewWindowManager.evaluateWindow(localNewWindowParams);
      if (localNewWindowContainer != null) {
        return new SafariNewWindowManager.PopupWindow(localNewWindowContainer, null);
      }
    }
    return null;
  }
}

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

import com.teamdev.jxbrowser.BrowserServices;
import com.teamdev.jxbrowser.NewWindowContainer;
import com.teamdev.jxbrowser.NewWindowManager;
import com.teamdev.jxbrowser.NewWindowParams;
import com.teamdev.jxbrowser.VisualWindowContainer;
import com.teamdev.jxbrowser.webkit.Safari;
import com.teamdev.jxbrowser.webkit.WebBrowser;
import com.teamdev.jxbrowser.webkit.WebBrowserWindow;
import com.teamdev.jxbrowser.webkit.WindowCreator;
import java.awt.Component;
import java.awt.Rectangle;

class SafariNewWindowManager
{
  public static void register(SafariBrowser paramSafariBrowser)
  {
    paramSafariBrowser.getPeer().setWindowCreator(new SafariWindowCreator(paramSafariBrowser, null));
  }
  
  private static class PopupWindow
    implements WebBrowserWindow
  {
    private NewWindowContainer windowContainer;
    private SafariBrowser safariBrowser;
    
    private PopupWindow(NewWindowContainer paramNewWindowContainer)
    {
      windowContainer = paramNewWindowContainer;
    }
    
    public void createWindow(WebBrowser paramWebBrowser)
    {
      safariBrowser = new SafariBrowser((Safari)paramWebBrowser);
      windowContainer.insertBrowser(safariBrowser);
    }
    
    public void disposeWindow()
    {
      safariBrowser.dispose();
    }
    
    public void setVisible(boolean paramBoolean)
    {
      if ((windowContainer instanceof VisualWindowContainer)) {
        ((VisualWindowContainer)windowContainer).setVisible(paramBoolean);
      }
    }
    
    public void setBounds(Rectangle paramRectangle)
    {
      if ((windowContainer instanceof VisualWindowContainer))
      {
        ((VisualWindowContainer)windowContainer).setLocation(paramRectangle.getLocation());
        ((VisualWindowContainer)windowContainer).setSize(paramRectangle.getSize());
      }
    }
  }
  
  private static class SafariWindowCreator
    implements WindowCreator
  {
    private SafariBrowser parent;
    
    private SafariWindowCreator(SafariBrowser paramSafariBrowser)
    {
      parent = paramSafariBrowser;
    }
    
    public WebBrowserWindow createWindow()
    {
      BrowserServices localBrowserServices = BrowserServices.getInstance();
      NewWindowManager localNewWindowManager = localBrowserServices.getNewWindowManager();
      if (localNewWindowManager != null)
      {
        Rectangle localRectangle = parent.getComponent().getBounds();
        NewWindowParams localNewWindowParams = new NewWindowParams(parent, localRectangle, "", "");
        NewWindowContainer localNewWindowContainer = localNewWindowManager.evaluateWindow(localNewWindowParams);
        if (localNewWindowContainer != null) {
          return new SafariNewWindowManager.PopupWindow(localNewWindowContainer, null);
        }
      }
      return null;
    }
  }
}

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

class SafariPromptService$1 {}

/* Locati
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

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