2011-05-26 Sailesh Agrawal <sail@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 May 2011 19:36:13 +0000 (19:36 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 May 2011 19:36:13 +0000 (19:36 +0000)
        Reviewed by Tony Chang.

        Expose willStartLiveResize and willEndLiveResize in WebWidget
        https://bugs.webkit.org/show_bug.cgi?id=60518

        * public/WebWidget.h:
        * src/WebPopupMenuImpl.cpp:
        (WebKit::WebPopupMenuImpl::willStartLiveResize):
        (WebKit::WebPopupMenuImpl::willEndLiveResize):
        * src/WebPopupMenuImpl.h:
        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::willStartLiveResize):
        (WebKit::WebViewImpl::willEndLiveResize):
        * src/WebViewImpl.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebWidget.h
Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
Source/WebKit/chromium/src/WebPopupMenuImpl.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h

index c0f142a..bce7253 100644 (file)
@@ -1,3 +1,20 @@
+2011-05-26  Sailesh Agrawal  <sail@chromium.org>
+
+        Reviewed by Tony Chang.
+
+        Expose willStartLiveResize and willEndLiveResize in WebWidget
+        https://bugs.webkit.org/show_bug.cgi?id=60518
+
+        * public/WebWidget.h:
+        * src/WebPopupMenuImpl.cpp:
+        (WebKit::WebPopupMenuImpl::willStartLiveResize):
+        (WebKit::WebPopupMenuImpl::willEndLiveResize):
+        * src/WebPopupMenuImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::willStartLiveResize):
+        (WebKit::WebViewImpl::willEndLiveResize):
+        * src/WebViewImpl.h:
+
 2011-05-25  Shishir Agrawal  <shishir@chromium.org>
 
         Reviewed by Dimitri Glazkov.
index 10143e1..0068b32 100644 (file)
@@ -55,9 +55,19 @@ public:
     // Returns the current size of the WebWidget.
     virtual WebSize size() = 0;
 
+    // Used to group a series of resize events. For example, if the user
+    // drags a resizer then willStartLiveResize will be called, followed by a
+    // sequence of resize events, ending with willEndLiveResize when the user
+    // lets go of the resizer.
+    virtual void willStartLiveResize() { }
+
     // Called to resize the WebWidget.
     virtual void resize(const WebSize&) = 0;
 
+    // Ends a group of resize events that was started with a call to
+    // willStartLiveResize.
+    virtual void willEndLiveResize() { }
+
     // Called to update imperative animation state.  This should be called before
     // paint, although the client can rate-limit these calls.
     virtual void animate() = 0;
index 0f31892..961ce24 100644 (file)
@@ -136,6 +136,10 @@ void WebPopupMenuImpl::close()
     deref();  // Balances ref() from WebWidget::Create
 }
 
+void WebPopupMenuImpl::willStartLiveResize()
+{
+}
+
 void WebPopupMenuImpl::resize(const WebSize& newSize)
 {
     if (m_size == newSize)
@@ -153,6 +157,10 @@ void WebPopupMenuImpl::resize(const WebSize& newSize)
     }
 }
 
+void WebPopupMenuImpl::willEndLiveResize()
+{
+}
+
 void WebPopupMenuImpl::animate()
 {
 }
index 5ae1b48..a91faf1 100644 (file)
@@ -62,7 +62,9 @@ public:
     // WebWidget
     virtual void close();
     virtual WebSize size() { return m_size; }
+    virtual void willStartLiveResize();
     virtual void resize(const WebSize&);
+    virtual void willEndLiveResize();
     virtual void animate();
     virtual void layout();
     virtual void paint(WebCanvas* canvas, const WebRect& rect);
index dc5e2b3..1e5d064 100644 (file)
@@ -973,6 +973,12 @@ void WebViewImpl::close()
     deref();  // Balances ref() acquired in WebView::create
 }
 
+void WebViewImpl::willStartLiveResize()
+{
+    if (mainFrameImpl() && mainFrameImpl()->frameView())
+        mainFrameImpl()->frameView()->willStartLiveResize();
+}
+
 void WebViewImpl::resize(const WebSize& newSize)
 {
     if (m_size == newSize)
@@ -1003,6 +1009,12 @@ void WebViewImpl::resize(const WebSize& newSize)
 #endif
 }
 
+void WebViewImpl::willEndLiveResize()
+{
+    if (mainFrameImpl() && mainFrameImpl()->frameView())
+        mainFrameImpl()->frameView()->willEndLiveResize();
+}
+
 void WebViewImpl::animate()
 {
     TRACE_EVENT("WebViewImpl::animate", this, 0);
index f290827..898e565 100644 (file)
@@ -91,7 +91,9 @@ public:
     // WebWidget methods:
     virtual void close();
     virtual WebSize size() { return m_size; }
+    virtual void willStartLiveResize();
     virtual void resize(const WebSize&);
+    virtual void willEndLiveResize();
     virtual void animate();
     virtual void layout();
     virtual void paint(WebCanvas*, const WebRect&);