| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WidgetClientWin_H__ | |
| 6 #define WidgetClientWin_H__ | |
| 7 | |
| 8 #include "base/gfx/native_widget_types.h" | |
| 9 #include "WidgetClient.h" | |
| 10 | |
| 11 class SkBitmap; | |
| 12 | |
| 13 namespace WebCore { | |
| 14 | |
| 15 class Cursor; | |
| 16 class IntRect; | |
| 17 class Range; | |
| 18 | |
| 19 // Generic interface for features needed by the Widget. | |
| 20 class WidgetClientWin : public WidgetClient { | |
| 21 public: | |
| 22 virtual ~WidgetClientWin() {} | |
| 23 | |
| 24 // Returns the containing window for the Widget. | |
| 25 // TODO(pinkerton): this needs a better name, "window" is incorrect on other | |
| 26 // platforms. | |
| 27 virtual gfx::ViewHandle containingWindow() = 0; | |
| 28 | |
| 29 // Invalidate a region of the widget's containing window. | |
| 30 virtual void invalidateRect(const IntRect& damagedRect) = 0; | |
| 31 | |
| 32 // Scroll the region of the widget's containing window within the given | |
| 33 // clipRect by the specified dx and dy. | |
| 34 virtual void scrollRect(int dx, int dy, const IntRect& clipRect) = 0; | |
| 35 | |
| 36 // Notifies the client of a new popup widget. The client should place | |
| 37 // and size the widget with the given bounds, relative to the screen. | |
| 38 virtual void popupOpened(Widget* widget, const IntRect& bounds) = 0; | |
| 39 | |
| 40 // Notifies the client that the given popup widget has closed. | |
| 41 virtual void popupClosed(Widget* widget) = 0; | |
| 42 | |
| 43 // Indicates that a new cursor should be shown. | |
| 44 virtual void setCursor(const Cursor& cursor) = 0; | |
| 45 | |
| 46 // Indicates the widget thinks it has focus. This should give focus to the | |
| 47 // window hosting the widget. | |
| 48 virtual void setFocus() = 0; | |
| 49 | |
| 50 // This function is called to retrieve a resource bitmap from the | |
| 51 // renderer that was cached as a result of the renderer receiving a | |
| 52 // ViewMsg_Preload_Bitmap message from the browser. | |
| 53 virtual const SkBitmap* getPreloadedResourceBitmap(int resource_id) = 0; | |
| 54 | |
| 55 // Notification that the given widget's scroll position has changed. This | |
| 56 // function is called AFTER the position has been updated. | |
| 57 virtual void onScrollPositionChanged(Widget* widget) = 0; | |
| 58 | |
| 59 // Retrieves the tick-marks for a given frame. | |
| 60 virtual const WTF::Vector<RefPtr<WebCore::Range> >* getTickmarks( | |
| 61 WebCore::Frame* frame) = 0; | |
| 62 | |
| 63 // Retrieves the index of the active tickmark for a given frame. If the | |
| 64 // frame does not have an active tickmark (for example if the active | |
| 65 // tickmark resides in another frame) this function returns kNoTickmark. | |
| 66 static const size_t kNoTickmark = -1; | |
| 67 virtual size_t getActiveTickmarkIndex(WebCore::Frame* frame) = 0; | |
| 68 | |
| 69 // Returns true if this widget is hidden because it's in a background tab. | |
| 70 virtual bool isHidden() = 0; | |
| 71 }; | |
| 72 | |
| 73 } // namespace WebCore | |
| 74 | |
| 75 #endif // WidgetClientWin_H__ | |
| OLD | NEW |