Changeset 88422 in webkit


Ignore:
Timestamp:
Jun 8, 2011 10:35:21 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-08 Sailesh Agrawal <sail@chromium.org>

Reviewed by Darin Fisher.

[Chromium] Add stubs to WebWidget
https://bugs.webkit.org/show_bug.cgi?id=62263

This change add stub implementations for all WebWidget functions. Having stub methods should make it easier to add new functions to the class without breaking Chromium.

  • public/WebWidget.h: (WebKit::WebWidget::close): (WebKit::WebWidget::size): (WebKit::WebWidget::resize): (WebKit::WebWidget::animate): (WebKit::WebWidget::layout): (WebKit::WebWidget::paint): (WebKit::WebWidget::composite): (WebKit::WebWidget::themeChanged): (WebKit::WebWidget::handleInputEvent): (WebKit::WebWidget::mouseCaptureLost): (WebKit::WebWidget::setFocus): (WebKit::WebWidget::setComposition): (WebKit::WebWidget::confirmComposition): (WebKit::WebWidget::compositionRange): (WebKit::WebWidget::textInputType): (WebKit::WebWidget::caretOrSelectionBounds): (WebKit::WebWidget::selectionRange): (WebKit::WebWidget::caretOrSelectionRange): (WebKit::WebWidget::setTextDirection): (WebKit::WebWidget::isAcceleratedCompositingActive):
Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r88377 r88422  
     12011-06-08  Sailesh Agrawal  <sail@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] Add stubs to WebWidget
     6        https://bugs.webkit.org/show_bug.cgi?id=62263
     7
     8        This change add stub implementations for all WebWidget functions. Having stub methods should make it easier to add new functions to the class without breaking Chromium.
     9
     10        * public/WebWidget.h:
     11        (WebKit::WebWidget::close):
     12        (WebKit::WebWidget::size):
     13        (WebKit::WebWidget::resize):
     14        (WebKit::WebWidget::animate):
     15        (WebKit::WebWidget::layout):
     16        (WebKit::WebWidget::paint):
     17        (WebKit::WebWidget::composite):
     18        (WebKit::WebWidget::themeChanged):
     19        (WebKit::WebWidget::handleInputEvent):
     20        (WebKit::WebWidget::mouseCaptureLost):
     21        (WebKit::WebWidget::setFocus):
     22        (WebKit::WebWidget::setComposition):
     23        (WebKit::WebWidget::confirmComposition):
     24        (WebKit::WebWidget::compositionRange):
     25        (WebKit::WebWidget::textInputType):
     26        (WebKit::WebWidget::caretOrSelectionBounds):
     27        (WebKit::WebWidget::selectionRange):
     28        (WebKit::WebWidget::caretOrSelectionRange):
     29        (WebKit::WebWidget::setTextDirection):
     30        (WebKit::WebWidget::isAcceleratedCompositingActive):
     31
    1322011-06-08  Tom Sepez  <tsepez@chromium.org>
    233
  • trunk/Source/WebKit/chromium/public/WebWidget.h

    r87417 r88422  
    3535#include "WebCommon.h"
    3636#include "WebCompositionUnderline.h"
     37#include "WebRect.h"
     38#include "WebSize.h"
    3739#include "WebTextInputType.h"
    3840#include "WebTextDirection.h"
     
    4446class WebString;
    4547struct WebPoint;
    46 struct WebRect;
    47 struct WebSize;
    4848template <typename T> class WebVector;
    4949
     
    5151public:
    5252    // This method closes and deletes the WebWidget.
    53     virtual void close() = 0;
     53    virtual void close() { }
    5454
    5555    // Returns the current size of the WebWidget.
    56     virtual WebSize size() = 0;
     56    virtual WebSize size() { return WebSize(); }
    5757
    5858    // Used to group a series of resize events. For example, if the user
     
    6363
    6464    // Called to resize the WebWidget.
    65     virtual void resize(const WebSize&) = 0;
     65    virtual void resize(const WebSize&) { }
    6666
    6767    // Ends a group of resize events that was started with a call to
     
    7171    // Called to update imperative animation state.  This should be called before
    7272    // paint, although the client can rate-limit these calls.
    73     virtual void animate() = 0;
     73    virtual void animate() { }
    7474
    7575    // Called to layout the WebWidget.  This MUST be called before Paint,
    7676    // and it may result in calls to WebWidgetClient::didInvalidateRect.
    77     virtual void layout() = 0;
     77    virtual void layout() { }
    7878
    7979    // Called to paint the rectangular region within the WebWidget
     
    8484    // processed, it should be assumed that another call to layout is
    8585    // warranted before painting again).
    86     virtual void paint(WebCanvas*, const WebRect& viewPort) = 0;
     86    virtual void paint(WebCanvas*, const WebRect& viewPort) { }
    8787
    8888    // Triggers compositing of the current layers onto the screen.
     
    9191    // before calling this method, for the same reasons described in
    9292    // the paint method above.
    93     virtual void composite(bool finish) = 0;
     93    virtual void composite(bool finish) { }
    9494
    9595    // Called to inform the WebWidget of a change in theme.
    9696    // Implementors that cache rendered copies of widgets need to re-render
    9797    // on receiving this message
    98     virtual void themeChanged() = 0;
     98    virtual void themeChanged() { }
    9999
    100100    // Called to inform the WebWidget of an input event.  Returns true if
    101101    // the event has been processed, false otherwise.
    102     virtual bool handleInputEvent(const WebInputEvent&) = 0;
     102    virtual bool handleInputEvent(const WebInputEvent&) { return false; }
    103103
    104104    // Called to inform the WebWidget that mouse capture was lost.
    105     virtual void mouseCaptureLost() = 0;
     105    virtual void mouseCaptureLost() { }
    106106
    107107    // Called to inform the WebWidget that it has gained or lost keyboard focus.
    108     virtual void setFocus(bool) = 0;
     108    virtual void setFocus(bool) { }
    109109
    110110    // Called to inform the WebWidget of a new composition text.
     
    117117        const WebVector<WebCompositionUnderline>& underlines,
    118118        int selectionStart,
    119         int selectionEnd) = 0;
     119        int selectionEnd) { return false; }
    120120
    121121    // Called to inform the WebWidget to confirm an ongoing composition.
    122122    // This method is same as confirmComposition(WebString());
    123123    // Returns true if there is an ongoing composition.
    124     virtual bool confirmComposition() = 0;
     124    virtual bool confirmComposition() { return false; }
    125125
    126126    // Called to inform the WebWidget to confirm an ongoing composition with a
     
    130130    // there is no ongoing composition and the text is empty.
    131131    // Returns true if there is an ongoing composition or the text is inserted.
    132     virtual bool confirmComposition(const WebString& text) = 0;
     132    virtual bool confirmComposition(const WebString& text) { return false; }
    133133
    134134    // Fetches the character range of the current composition, also called the
    135135    // "marked range." Returns true and fills the out-paramters on success;
    136136    // returns false on failure.
    137     virtual bool compositionRange(size_t* location, size_t* length) = 0;
     137    virtual bool compositionRange(size_t* location, size_t* length) { return false; }
    138138
    139139    // Returns the current text input type of this WebWidget.
    140     virtual WebTextInputType textInputType() = 0;
     140    virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; }
    141141
    142142    // Returns the current caret bounds of this WebWidget. The selection bounds
    143143    // will be returned if a selection range is available.
    144     virtual WebRect caretOrSelectionBounds() = 0;
     144    virtual WebRect caretOrSelectionBounds() { return WebRect(); }
    145145
    146146    // Returns the start and end point for the current selection, aligned to the
    147147    // bottom of the selected line.
    148     virtual bool selectionRange(WebPoint& start, WebPoint& end) const = 0;
     148    virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; }
    149149
    150150    // Fetch the current selection range of this WebWidget. If there is no
     
    152152    // caret. Returns true and fills the out-paramters on success; returns false
    153153    // on failure.
    154     virtual bool caretOrSelectionRange(size_t* location, size_t* length) = 0;
     154    virtual bool caretOrSelectionRange(size_t* location, size_t* length) { return false; }
    155155
    156156    // Changes the text direction of the selected input node.
    157     virtual void setTextDirection(WebTextDirection) = 0;
     157    virtual void setTextDirection(WebTextDirection) { }
    158158
    159159    // Returns true if the WebWidget uses GPU accelerated compositing
    160160    // to render its contents.
    161     virtual bool isAcceleratedCompositingActive() const = 0;
     161    virtual bool isAcceleratedCompositingActive() const { return false; }
    162162
    163163protected:
Note: See TracChangeset for help on using the changeset viewer.