Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: sky/engine/public/web/WebViewClient.h

Issue 880643007: Merge WebWidgetClient into WebViewClient. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/public/web/WebTouchAction.h ('k') | sky/engine/public/web/WebWidgetClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef SKY_ENGINE_PUBLIC_WEB_WEBVIEWCLIENT_H_ 31 #ifndef SKY_ENGINE_PUBLIC_WEB_WEBVIEWCLIENT_H_
32 #define SKY_ENGINE_PUBLIC_WEB_WEBVIEWCLIENT_H_ 32 #define SKY_ENGINE_PUBLIC_WEB_WEBVIEWCLIENT_H_
33 33
34 #include "../platform/WebGraphicsContext3D.h" 34 #include "../platform/WebGraphicsContext3D.h"
35 #include "../platform/WebString.h" 35 #include "../platform/WebString.h"
36 #include "sky/engine/public/platform/WebCommon.h"
37 #include "sky/engine/public/platform/WebRect.h"
38 #include "sky/engine/public/platform/WebScreenInfo.h"
36 #include "sky/engine/public/web/WebFrame.h" 39 #include "sky/engine/public/web/WebFrame.h"
37 #include "sky/engine/public/web/WebNavigatorContentUtilsClient.h" 40 #include "sky/engine/public/web/WebNavigatorContentUtilsClient.h"
38 #include "sky/engine/public/web/WebPageVisibilityState.h" 41 #include "sky/engine/public/web/WebPageVisibilityState.h"
39 #include "sky/engine/public/web/WebTextAffinity.h" 42 #include "sky/engine/public/web/WebTextAffinity.h"
40 #include "sky/engine/public/web/WebTextDirection.h" 43 #include "sky/engine/public/web/WebTextDirection.h"
41 #include "sky/engine/public/web/WebWidgetClient.h"
42 44
43 namespace blink { 45 namespace blink {
44 46
45 class ServiceProvider; 47 class ServiceProvider;
46 class WebElement; 48 class WebElement;
47 class WebHitTestResult; 49 class WebHitTestResult;
48 class WebImage; 50 class WebImage;
49 class WebKeyboardEvent; 51 class WebKeyboardEvent;
50 class WebNode; 52 class WebNode;
51 class WebRange; 53 class WebRange;
52 class WebURL; 54 class WebURL;
53 class WebURLRequest; 55 class WebURLRequest;
54 class WebView; 56 class WebView;
55 class WebWidget; 57 class WebWidget;
56 struct WebConsoleMessage; 58 struct WebConsoleMessage;
57 struct WebPoint; 59 struct WebPoint;
58 struct WebRect; 60 struct WebRect;
59 struct WebSize; 61 struct WebSize;
60 62
61 // Since a WebView is a WebWidget, a WebViewClient is a WebWidgetClient. 63 class WebViewClient {
62 // Virtual inheritance allows an implementation of WebWidgetClient to be
63 // easily reused as part of an implementation of WebViewClient.
64 class WebViewClient : virtual public WebWidgetClient {
65 public: 64 public:
66 virtual ServiceProvider& services() = 0; 65 virtual ServiceProvider& services() = 0;
67 66
67 // Initialize compositing for this widget.
68 virtual void initializeLayerTreeView() { BLINK_ASSERT_NOT_REACHED(); };
69
70 // Called when the page should pump a frame.
71 virtual void scheduleAnimation() { }
72
73 // TODO(esprehn): Sky needs to implement these to control the mojo::View.
74
75 // Called to get/set the position of the widget in screen coordinates.
76 virtual WebRect windowRect() { return WebRect(); }
77 virtual void setWindowRect(const WebRect&) { }
78
79 // Called to get the position of the root window containing the widget
80 // in screen coordinates.
81 virtual WebRect rootWindowRect() { return WebRect(); }
82
83 // Called to query information about the screen where this widget is
84 // displayed.
85 virtual WebScreenInfo screenInfo() { return WebScreenInfo(); }
86
87 // Called to get the scale factor of the display.
88 virtual float deviceScaleFactor() { return 1; }
89
68 // Editing ------------------------------------------------------------- 90 // Editing -------------------------------------------------------------
69 91
70 // This method is called in response to WebView's handleInputEvent() 92 // This method is called in response to WebView's handleInputEvent()
71 // when the default action for the current keyboard event is not 93 // when the default action for the current keyboard event is not
72 // suppressed by the page, to give the embedder a chance to handle 94 // suppressed by the page, to give the embedder a chance to handle
73 // the keyboard event specially. 95 // the keyboard event specially.
74 // 96 //
75 // Returns true if the keyboard event was handled by the embedder, 97 // Returns true if the keyboard event was handled by the embedder,
76 // indicating that the default action should be suppressed. 98 // indicating that the default action should be suppressed.
77 virtual bool handleCurrentKeyboardEvent() { return false; } 99 virtual bool handleCurrentKeyboardEvent() { return false; }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return WebPageVisibilityStateVisible; 162 return WebPageVisibilityStateVisible;
141 } 163 }
142 164
143 protected: 165 protected:
144 ~WebViewClient() { } 166 ~WebViewClient() { }
145 }; 167 };
146 168
147 } // namespace blink 169 } // namespace blink
148 170
149 #endif // SKY_ENGINE_PUBLIC_WEB_WEBVIEWCLIENT_H_ 171 #endif // SKY_ENGINE_PUBLIC_WEB_WEBVIEWCLIENT_H_
OLDNEW
« no previous file with comments | « sky/engine/public/web/WebTouchAction.h ('k') | sky/engine/public/web/WebWidgetClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698