OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
31 namespace gfx { | 31 namespace gfx { |
32 class Size; | 32 class Size; |
33 } | 33 } |
34 | 34 |
35 namespace webkit { | 35 namespace webkit { |
36 struct WebPluginInfo; | 36 struct WebPluginInfo; |
37 } | 37 } |
38 | 38 |
39 namespace content { | 39 namespace content { |
40 | 40 |
41 class ContextMenuClient; | |
42 struct ContextMenuParams; | |
jam
2012/10/10 04:01:43
nit: put the struct after class RenderViewVistor
| |
41 class RenderViewVisitor; | 43 class RenderViewVisitor; |
42 | 44 |
43 class CONTENT_EXPORT RenderView : public IPC::Sender { | 45 class CONTENT_EXPORT RenderView : public IPC::Sender { |
44 public: | 46 public: |
45 // Returns the RenderView containing the given WebView. | 47 // Returns the RenderView containing the given WebView. |
46 static RenderView* FromWebView(WebKit::WebView* webview); | 48 static RenderView* FromWebView(WebKit::WebView* webview); |
47 | 49 |
48 // Visit all RenderViews with a live WebView (i.e., RenderViews that have | 50 // Visit all RenderViews with a live WebView (i.e., RenderViews that have |
49 // been closed but not yet destroyed are excluded). | 51 // been closed but not yet destroyed are excluded). |
50 static void ForEach(RenderViewVisitor* visitor); | 52 static void ForEach(RenderViewVisitor* visitor); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 virtual int GetEnabledBindings() const = 0; | 103 virtual int GetEnabledBindings() const = 0; |
102 | 104 |
103 // Whether content state (such as form state, scroll position and page | 105 // Whether content state (such as form state, scroll position and page |
104 // contents) should be sent to the browser immediately. This is normally | 106 // contents) should be sent to the browser immediately. This is normally |
105 // false, but set to true by some tests. | 107 // false, but set to true by some tests. |
106 virtual bool GetContentStateImmediately() const = 0; | 108 virtual bool GetContentStateImmediately() const = 0; |
107 | 109 |
108 // Filtered time per frame based on UpdateRect messages. | 110 // Filtered time per frame based on UpdateRect messages. |
109 virtual float GetFilteredTimePerFrame() const = 0; | 111 virtual float GetFilteredTimePerFrame() const = 0; |
110 | 112 |
111 // Shows a context menu with commands relevant to a specific element on | 113 // Shows a context menu with the given information. The given client will |
112 // the given frame. Additional context data is supplied. | 114 // be called with the result. The client pointer is owned by the caller and |
113 virtual void ShowContextMenu(WebKit::WebFrame* frame, | 115 // must remain valid as long as the RenderView is alive. |
114 const WebKit::WebContextMenuData& data) = 0; | 116 // |
117 // The request ID will be returned by this function. This is passed to the | |
118 // client functions for identification. | |
119 // | |
120 // Note: if you end up having clients outliving the RenderView, we should add | |
121 // a CancelContextMenuCallback function that takes a request id. | |
122 virtual int ShowContextMenu(ContextMenuClient* client, | |
123 const ContextMenuParams& params) = 0; | |
115 | 124 |
116 // Returns the current visibility of the WebView. | 125 // Returns the current visibility of the WebView. |
117 virtual WebKit::WebPageVisibilityState GetVisibilityState() const = 0; | 126 virtual WebKit::WebPageVisibilityState GetVisibilityState() const = 0; |
118 | 127 |
119 // Displays a modal alert dialog containing the given message. Returns | 128 // Displays a modal alert dialog containing the given message. Returns |
120 // once the user dismisses the dialog. | 129 // once the user dismisses the dialog. |
121 virtual void RunModalAlertDialog(WebKit::WebFrame* frame, | 130 virtual void RunModalAlertDialog(WebKit::WebFrame* frame, |
122 const WebKit::WebString& message) = 0; | 131 const WebKit::WebString& message) = 0; |
123 | 132 |
124 // The client should handle the navigation externally. | 133 // The client should handle the navigation externally. |
125 virtual void LoadURLExternally( | 134 virtual void LoadURLExternally( |
126 WebKit::WebFrame* frame, | 135 WebKit::WebFrame* frame, |
127 const WebKit::WebURLRequest& request, | 136 const WebKit::WebURLRequest& request, |
128 WebKit::WebNavigationPolicy policy) = 0; | 137 WebKit::WebNavigationPolicy policy) = 0; |
129 | 138 |
130 // Notifies the renderer that a paint is to be generated for the size | 139 // Notifies the renderer that a paint is to be generated for the size |
131 // passed in. | 140 // passed in. |
132 virtual void Repaint(const gfx::Size& size) = 0; | 141 virtual void Repaint(const gfx::Size& size) = 0; |
133 | 142 |
134 protected: | 143 protected: |
135 virtual ~RenderView() {} | 144 virtual ~RenderView() {} |
136 }; | 145 }; |
137 | 146 |
138 } // namespace content | 147 } // namespace content |
139 | 148 |
140 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_ | 149 #endif // CONTENT_PUBLIC_RENDERER_RENDER_VIEW_H_ |
OLD | NEW |