Changeset 88422 in webkit
- Timestamp:
- Jun 8, 2011 10:35:21 PM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r88377 r88422 1 2011-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 1 32 2011-06-08 Tom Sepez <tsepez@chromium.org> 2 33 -
trunk/Source/WebKit/chromium/public/WebWidget.h
r87417 r88422 35 35 #include "WebCommon.h" 36 36 #include "WebCompositionUnderline.h" 37 #include "WebRect.h" 38 #include "WebSize.h" 37 39 #include "WebTextInputType.h" 38 40 #include "WebTextDirection.h" … … 44 46 class WebString; 45 47 struct WebPoint; 46 struct WebRect;47 struct WebSize;48 48 template <typename T> class WebVector; 49 49 … … 51 51 public: 52 52 // This method closes and deletes the WebWidget. 53 virtual void close() = 0;53 virtual void close() { } 54 54 55 55 // Returns the current size of the WebWidget. 56 virtual WebSize size() = 0;56 virtual WebSize size() { return WebSize(); } 57 57 58 58 // Used to group a series of resize events. For example, if the user … … 63 63 64 64 // Called to resize the WebWidget. 65 virtual void resize(const WebSize&) = 0;65 virtual void resize(const WebSize&) { } 66 66 67 67 // Ends a group of resize events that was started with a call to … … 71 71 // Called to update imperative animation state. This should be called before 72 72 // paint, although the client can rate-limit these calls. 73 virtual void animate() = 0;73 virtual void animate() { } 74 74 75 75 // Called to layout the WebWidget. This MUST be called before Paint, 76 76 // and it may result in calls to WebWidgetClient::didInvalidateRect. 77 virtual void layout() = 0;77 virtual void layout() { } 78 78 79 79 // Called to paint the rectangular region within the WebWidget … … 84 84 // processed, it should be assumed that another call to layout is 85 85 // warranted before painting again). 86 virtual void paint(WebCanvas*, const WebRect& viewPort) = 0;86 virtual void paint(WebCanvas*, const WebRect& viewPort) { } 87 87 88 88 // Triggers compositing of the current layers onto the screen. … … 91 91 // before calling this method, for the same reasons described in 92 92 // the paint method above. 93 virtual void composite(bool finish) = 0;93 virtual void composite(bool finish) { } 94 94 95 95 // Called to inform the WebWidget of a change in theme. 96 96 // Implementors that cache rendered copies of widgets need to re-render 97 97 // on receiving this message 98 virtual void themeChanged() = 0;98 virtual void themeChanged() { } 99 99 100 100 // Called to inform the WebWidget of an input event. Returns true if 101 101 // the event has been processed, false otherwise. 102 virtual bool handleInputEvent(const WebInputEvent&) = 0;102 virtual bool handleInputEvent(const WebInputEvent&) { return false; } 103 103 104 104 // Called to inform the WebWidget that mouse capture was lost. 105 virtual void mouseCaptureLost() = 0;105 virtual void mouseCaptureLost() { } 106 106 107 107 // Called to inform the WebWidget that it has gained or lost keyboard focus. 108 virtual void setFocus(bool) = 0;108 virtual void setFocus(bool) { } 109 109 110 110 // Called to inform the WebWidget of a new composition text. … … 117 117 const WebVector<WebCompositionUnderline>& underlines, 118 118 int selectionStart, 119 int selectionEnd) = 0;119 int selectionEnd) { return false; } 120 120 121 121 // Called to inform the WebWidget to confirm an ongoing composition. 122 122 // This method is same as confirmComposition(WebString()); 123 123 // Returns true if there is an ongoing composition. 124 virtual bool confirmComposition() = 0;124 virtual bool confirmComposition() { return false; } 125 125 126 126 // Called to inform the WebWidget to confirm an ongoing composition with a … … 130 130 // there is no ongoing composition and the text is empty. 131 131 // 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; } 133 133 134 134 // Fetches the character range of the current composition, also called the 135 135 // "marked range." Returns true and fills the out-paramters on success; 136 136 // 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; } 138 138 139 139 // Returns the current text input type of this WebWidget. 140 virtual WebTextInputType textInputType() = 0;140 virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; } 141 141 142 142 // Returns the current caret bounds of this WebWidget. The selection bounds 143 143 // will be returned if a selection range is available. 144 virtual WebRect caretOrSelectionBounds() = 0;144 virtual WebRect caretOrSelectionBounds() { return WebRect(); } 145 145 146 146 // Returns the start and end point for the current selection, aligned to the 147 147 // 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; } 149 149 150 150 // Fetch the current selection range of this WebWidget. If there is no … … 152 152 // caret. Returns true and fills the out-paramters on success; returns false 153 153 // 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; } 155 155 156 156 // Changes the text direction of the selected input node. 157 virtual void setTextDirection(WebTextDirection) = 0;157 virtual void setTextDirection(WebTextDirection) { } 158 158 159 159 // Returns true if the WebWidget uses GPU accelerated compositing 160 160 // to render its contents. 161 virtual bool isAcceleratedCompositingActive() const = 0;161 virtual bool isAcceleratedCompositingActive() const { return false; } 162 162 163 163 protected:
Note: See TracChangeset
for help on using the changeset viewer.