Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / public / web / WebFrameClient.h
index 6d0196a..6d41edb 100644 (file)
@@ -32,6 +32,7 @@
 #define WebFrameClient_h
 
 #include "../platform/WebColor.h"
+#include "WebAXObject.h"
 #include "WebDOMMessageEvent.h"
 #include "WebDataSource.h"
 #include "WebFrame.h"
@@ -62,16 +63,23 @@ class WebContentDecryptionModule;
 class WebCookieJar;
 class WebDataSource;
 class WebDOMEvent;
+class WebExternalPopupMenu;
+class WebExternalPopupMenuClient;
 class WebFormElement;
+class WebGeolocationClient;
 class WebInputEvent;
 class WebMediaPlayer;
 class WebMediaPlayerClient;
+class WebMIDIClient;
+class WebNotificationPermissionCallback;
 class WebNotificationPresenter;
 class WebServiceWorkerProvider;
 class WebServiceWorkerProviderClient;
+class WebSocketHandle;
 class WebNode;
 class WebPlugin;
 class WebRTCPeerConnectionHandler;
+class WebScreenOrientationClient;
 class WebSharedWorker;
 class WebSharedWorkerClient;
 class WebSocketStreamHandle;
@@ -85,6 +93,7 @@ struct WebColorSuggestion;
 struct WebConsoleMessage;
 struct WebContextMenuData;
 struct WebPluginParams;
+struct WebPopupMenuInfo;
 struct WebRect;
 struct WebSize;
 struct WebURLError;
@@ -97,7 +106,8 @@ public:
     virtual WebPlugin* createPlugin(WebLocalFrame*, const WebPluginParams&) { return 0; }
 
     // May return null.
-    virtual WebMediaPlayer* createMediaPlayer(WebLocalFrame*, const WebURL&, WebMediaPlayerClient*) { return 0; }
+    // WebContentDecryptionModule* may be null if one has not yet been set.
+    virtual WebMediaPlayer* createMediaPlayer(WebLocalFrame*, const WebURL&, WebMediaPlayerClient*, WebContentDecryptionModule*) { return 0; }
 
     // May return null.
     virtual WebContentDecryptionModule* createContentDecryptionModule(WebLocalFrame*, const WebSecurityOrigin&, const WebString& keySystem) { return 0; }
@@ -111,6 +121,11 @@ public:
     // May return null.
     virtual WebWorkerPermissionClientProxy* createWorkerPermissionClientProxy(WebLocalFrame*) { return 0; }
 
+    // Create a new WebPopupMenu. In the "createExternalPopupMenu" form, the
+    // client is responsible for rendering the contents of the popup menu.
+    virtual WebExternalPopupMenu* createExternalPopupMenu(
+        const WebPopupMenuInfo&, WebExternalPopupMenuClient*) { return 0; }
+
 
     // Services ------------------------------------------------------------
 
@@ -178,6 +193,32 @@ public:
 
     // The client may choose to alter the navigation policy.  Otherwise,
     // defaultPolicy should just be returned.
+
+    struct NavigationPolicyInfo {
+        WebLocalFrame* frame;
+        WebDataSource::ExtraData* extraData;
+        const WebURLRequest& urlRequest;
+        WebNavigationType navigationType;
+        WebNavigationPolicy defaultPolicy;
+        bool isRedirect;
+        bool isTransitionNavigation;
+
+        NavigationPolicyInfo(const WebURLRequest& urlRequest)
+            : frame(0)
+            , extraData(0)
+            , urlRequest(urlRequest)
+            , navigationType(WebNavigationTypeOther)
+            , defaultPolicy(WebNavigationPolicyIgnore)
+            , isRedirect(false)
+            , isTransitionNavigation(false) { }
+    };
+
+    virtual WebNavigationPolicy decidePolicyForNavigation(const NavigationPolicyInfo& info)
+    {
+        return decidePolicyForNavigation(info.frame, info.extraData, info.urlRequest, info.navigationType, info.defaultPolicy, info.isRedirect);
+    }
+
+    // DEPRECATED
     virtual WebNavigationPolicy decidePolicyForNavigation(
         WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavigationType,
         WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPolicy; }
@@ -210,7 +251,7 @@ public:
     virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) { }
 
     // A new provisional load has been started.
-    virtual void didStartProvisionalLoad(WebLocalFrame*) { }
+    virtual void didStartProvisionalLoad(WebLocalFrame* localFrame, bool isTransitionNavigation) { }
 
     // The provisional load was redirected via a HTTP 3xx response.
     virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) { }
@@ -226,10 +267,7 @@ public:
     // The window object for the frame has been cleared of any extra
     // properties that may have been set by script from the previously
     // loaded document.
-    virtual void didClearWindowObject(WebLocalFrame* frame) { didClearWindowObject(frame, 0); }
-
-    // Deprecated.
-    virtual void didClearWindowObject(WebLocalFrame* frame, int worldId) { }
+    virtual void didClearWindowObject(WebLocalFrame* frame) { }
 
     // The document element has been created.
     virtual void didCreateDocumentElement(WebLocalFrame*) { }
@@ -265,10 +303,23 @@ public:
     // The frame's manifest has changed.
     virtual void didChangeManifest(WebLocalFrame*) { }
 
+    // The frame's theme color has changed.
+    virtual void didChangeThemeColor() { }
+
+
+    // Transition navigations -----------------------------------------------
+
+    // Provides serialized markup of transition elements for use in the following navigation.
+    virtual void addNavigationTransitionData(const WebString& allowedDestinationOrigin, const WebString& selector, const WebString& markup) { }
 
-    // Misc ----------------------------------------------------------------
+
+    // Web Notifications ---------------------------------------------------
+
+    // Requests permission to display platform notifications on the origin of this frame.
+    virtual void requestNotificationPermission(const WebSecurityOrigin&, WebNotificationPermissionCallback* callback) { }
 
     // Called to retrieve the provider of desktop notifications.
+    // FIXME: Remove this method once the presenter is obtained through Platform.
     virtual WebNotificationPresenter* notificationPresenter() { return 0; }
 
 
@@ -334,9 +385,6 @@ public:
     // An element will request a resource.
     virtual void willRequestResource(WebLocalFrame*, const WebCachedURLRequest&) { }
 
-    // The request is after preconnect is triggered.
-    virtual void willRequestAfterPreconnect(WebLocalFrame*, WebURLRequest&) { }
-
     // A request is about to be sent out, and the client may modify it.  Request
     // is writable, and changes to the URL, for example, will change the request
     // made.  If this request is the result of a redirect, then redirectResponse
@@ -351,7 +399,7 @@ public:
         WebLocalFrame*, unsigned identifier, const WebURLResponse&) { }
 
     virtual void didChangeResourcePriority(
-        WebLocalFrame* webFrame, unsigned identifier, const blink::WebURLRequest::Priority& priority, int) { }
+        WebLocalFrame* webFrame, unsigned identifier, const WebURLRequest::Priority& priority, int) { }
 
     // The resource request given by identifier succeeded.
     virtual void didFinishResourceLoad(
@@ -396,9 +444,6 @@ public:
     // The frame's document finished the initial non-empty layout of a page.
     virtual void didFirstVisuallyNonEmptyLayout(WebLocalFrame*) { }
 
-    // The size of the content area changed.
-    virtual void didChangeContentsSize(WebLocalFrame*, const WebSize&) { }
-
     // The main frame scrolled.
     virtual void didChangeScrollOffset(WebLocalFrame*) { }
 
@@ -442,9 +487,20 @@ public:
 
     // WebSocket -----------------------------------------------------
 
-    // A WebSocket object is going to open new stream connection.
+    // A WebSocket object is going to open a new socket stream connection. Used
+    // by the old WebSocket implementation.
     virtual void willOpenSocketStream(WebSocketStreamHandle*) { }
 
+    // A WebSocket object is going to open a new WebSocket connection. Used by
+    // the new WebSocket implementation.
+    virtual void willOpenWebSocket(WebSocketHandle*) { }
+
+
+    // Geolocation ---------------------------------------------------------
+
+    // Access the embedder API for (client-based) geolocation client .
+    virtual WebGeolocationClient* geolocationClient() { return 0; }
+
 
     // MediaStream -----------------------------------------------------
 
@@ -454,6 +510,11 @@ public:
     virtual WebUserMediaClient* userMediaClient() { return 0; }
 
 
+    // Web MIDI -------------------------------------------------------------
+
+    virtual WebMIDIClient* webMIDIClient() { return 0; }
+
+
     // Messages ------------------------------------------------------
 
     // Notifies the embedder that a postMessage was issued on this frame, and
@@ -495,8 +556,24 @@ public:
     // Send initial drawing parameters to a child frame that is being rendered out of process.
     virtual void initializeChildFrame(const WebRect& frameRect, float scaleFactor) { }
 
+
+    // Screen Orientation --------------------------------------------------
+
+    // Access the embedder API for (client-based) screen orientation client .
+    virtual WebScreenOrientationClient* webScreenOrientationClient() { return 0; }
+
+    // Accessibility -------------------------------------------------------
+
+    // Notifies embedder about an accessibility event.
+    virtual void postAccessibilityEvent(const WebAXObject&, WebAXEvent) { }
+
+    // ServiceWorker -------------------------------------------------------
+
+    // Whether the frame is controlled by the ServiceWorker
+    virtual bool isControlledByServiceWorker() { return false; }
+
 protected:
-    ~WebFrameClient() { }
+    virtual ~WebFrameClient() { }
 };
 
 } // namespace blink