Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / public / renderer / render_view_observer.h
index aed5a2f..4c7aba0 100644 (file)
@@ -11,7 +11,6 @@
 #include "ipc/ipc_listener.h"
 #include "ipc/ipc_sender.h"
 #include "third_party/WebKit/public/platform/WebVector.h"
-#include "third_party/WebKit/public/web/WebIconURL.h"
 
 class GURL;
 
@@ -26,9 +25,10 @@ class WebDataSource;
 class WebFrame;
 class WebFormElement;
 class WebGestureEvent;
-class WebMediaPlayerClient;
+class WebLocalFrame;
 class WebMouseEvent;
 class WebNode;
+class WebString;
 class WebTouchEvent;
 class WebURL;
 struct WebURLError;
@@ -52,37 +52,34 @@ class CONTENT_EXPORT RenderViewObserver : public IPC::Listener,
   // These match the WebKit API notifications
   virtual void DidStartLoading() {}
   virtual void DidStopLoading() {}
-  virtual void DidFinishDocumentLoad(blink::WebFrame* frame) {}
-  virtual void DidFailLoad(blink::WebFrame* frame,
+  virtual void DidFinishDocumentLoad(blink::WebLocalFrame* frame) {}
+  virtual void DidFailLoad(blink::WebLocalFrame* frame,
                            const blink::WebURLError& error) {}
-  virtual void DidFinishLoad(blink::WebFrame* frame) {}
-  virtual void DidStartProvisionalLoad(blink::WebFrame* frame) {}
-  virtual void DidFailProvisionalLoad(blink::WebFrame* frame,
+  virtual void DidFinishLoad(blink::WebLocalFrame* frame) {}
+  virtual void DidStartProvisionalLoad(blink::WebLocalFrame* frame) {}
+  virtual void DidFailProvisionalLoad(blink::WebLocalFrame* frame,
                                       const blink::WebURLError& error) {}
-  virtual void DidCommitProvisionalLoad(blink::WebFrame* frame,
+  virtual void DidCommitProvisionalLoad(blink::WebLocalFrame* frame,
                                         bool is_new_navigation) {}
-  virtual void DidClearWindowObject(blink::WebFrame* frame, int world_id) {}
-  virtual void DidCreateDocumentElement(blink::WebFrame* frame) {}
-  virtual void FrameCreated(blink::WebFrame* parent,
+  virtual void DidClearWindowObject(blink::WebLocalFrame* frame) {}
+  virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) {}
+  virtual void FrameCreated(blink::WebLocalFrame* parent,
                             blink::WebFrame* frame) {}
   virtual void FrameDetached(blink::WebFrame* frame) {}
   virtual void FrameWillClose(blink::WebFrame* frame) {}
   virtual void DidMatchCSS(
-      blink::WebFrame* frame,
+      blink::WebLocalFrame* frame,
       const blink::WebVector<blink::WebString>& newly_matching_selectors,
       const blink::WebVector<blink::WebString>& stopped_matching_selectors) {}
-  virtual void WillSendSubmitEvent(blink::WebFrame* frame,
+  virtual void WillSendSubmitEvent(blink::WebLocalFrame* frame,
                                    const blink::WebFormElement& form) {}
-  virtual void WillSubmitForm(blink::WebFrame* frame,
+  virtual void WillSubmitForm(blink::WebLocalFrame* frame,
                               const blink::WebFormElement& form) {}
-  virtual void DidCreateDataSource(blink::WebFrame* frame,
+  virtual void DidCreateDataSource(blink::WebLocalFrame* frame,
                                    blink::WebDataSource* ds) {}
-  virtual void PrintPage(blink::WebFrame* frame, bool user_initiated) {}
+  virtual void PrintPage(blink::WebLocalFrame* frame, bool user_initiated) {}
   virtual void FocusedNodeChanged(const blink::WebNode& node) {}
-  virtual void WillCreateMediaPlayer(blink::WebFrame* frame,
-                                     blink::WebMediaPlayerClient* client) {}
-  virtual void ZoomLevelChanged() {};
-  virtual void DidChangeScrollOffset(blink::WebFrame* frame) {}
+  virtual void DidChangeScrollOffset(blink::WebLocalFrame* frame) {}
   virtual void DraggableRegionsChanged(blink::WebFrame* frame) {}
   virtual void DidCommitCompositorFrame() {}
   virtual void DidUpdateLayout() {}
@@ -90,41 +87,34 @@ class CONTENT_EXPORT RenderViewObserver : public IPC::Listener,
   // These match the RenderView methods.
   virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {}
   virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {}
-
-  // This matches the RenderWidget method.
-  virtual void WillProcessUserGesture() {}
-
-  // Called when we receive a console message from WebKit for which we requested
-  // extra details (like the stack trace). |message| is the error message,
-  // |source| is the WebKit-reported source of the error (either external or
-  // internal), and |stack_trace| is the stack trace of the error in a
-  // human-readable format (each frame is formatted as
-  // "\n    at function_name (source:line_number:column_number)").
-  virtual void DetailedConsoleMessageAdded(const base::string16& message,
-                                           const base::string16& source,
-                                           const base::string16& stack_trace,
-                                           int32 line_number,
-                                           int32 severity_level) {}
+  virtual void DidHandleGestureEvent(const blink::WebGestureEvent& event) {}
 
   // These match incoming IPCs.
   virtual void Navigate(const GURL& url) {}
   virtual void ClosePage() {}
-  virtual void OrientationChangeEvent(int orientation) {}
+  virtual void OrientationChangeEvent() {}
+  virtual void Resized() {}
 
   virtual void OnStop() {}
 
   // IPC::Listener implementation.
-  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+  bool OnMessageReceived(const IPC::Message& message) override;
 
   // IPC::Sender implementation.
-  virtual bool Send(IPC::Message* message) OVERRIDE;
+  bool Send(IPC::Message* message) override;
 
   RenderView* render_view() const;
   int routing_id() const { return routing_id_; }
 
  protected:
   explicit RenderViewObserver(RenderView* render_view);
-  virtual ~RenderViewObserver();
+  ~RenderViewObserver() override;
+
+  // Sets |render_view_| to track.
+  // Removes itself of previous (if any) |render_view_| observer list and adds
+  // to the new |render_view|. Since it assumes that observer outlives
+  // render_view, OnDestruct should be overridden.
+  void Observe(RenderView* render_view);
 
  private:
   friend class RenderViewImpl;