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_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "third_party/skia/include/core/SkRegion.h" | 13 #include "third_party/skia/include/core/SkRegion.h" |
14 #include "third_party/WebKit/public/web/WebInputEvent.h" | 14 #include "third_party/WebKit/public/web/WebInputEvent.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace gfx { | 19 namespace gfx { |
20 class Rect; | 20 class Rect; |
21 class Size; | 21 class Size; |
22 } | 22 } |
23 | 23 |
| 24 namespace ui { |
| 25 class TextInputClient; |
| 26 } |
| 27 |
24 namespace content { | 28 namespace content { |
25 | 29 |
26 class RenderWidgetHost; | 30 class RenderWidgetHost; |
27 class RenderWidgetHostViewFrameSubscriber; | 31 class RenderWidgetHostViewFrameSubscriber; |
28 | 32 |
29 // RenderWidgetHostView is an interface implemented by an object that acts as | 33 // RenderWidgetHostView is an interface implemented by an object that acts as |
30 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its | 34 // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its |
31 // associated RenderProcessHost own the "Model" in this case which is the | 35 // associated RenderProcessHost own the "Model" in this case which is the |
32 // child renderer process. The View is responsible for receiving events from | 36 // child renderer process. The View is responsible for receiving events from |
33 // the surrounding environment and passing them to the RenderWidgetHost, and | 37 // the surrounding environment and passing them to the RenderWidgetHost, and |
(...skipping 22 matching lines...) Expand all Loading... |
56 // Tells the View to size and move itself to the specified size and point in | 60 // Tells the View to size and move itself to the specified size and point in |
57 // screen space. | 61 // screen space. |
58 virtual void SetBounds(const gfx::Rect& rect) = 0; | 62 virtual void SetBounds(const gfx::Rect& rect) = 0; |
59 | 63 |
60 // Retrieves the native view used to contain plugins and identify the | 64 // Retrieves the native view used to contain plugins and identify the |
61 // renderer in IPC messages. | 65 // renderer in IPC messages. |
62 virtual gfx::NativeView GetNativeView() const = 0; | 66 virtual gfx::NativeView GetNativeView() const = 0; |
63 virtual gfx::NativeViewId GetNativeViewId() const = 0; | 67 virtual gfx::NativeViewId GetNativeViewId() const = 0; |
64 virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0; | 68 virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0; |
65 | 69 |
| 70 // Returns a ui::TextInputClient to support text input or NULL if this RWHV |
| 71 // doesn't support text input. |
| 72 // Note: Not all the platforms use ui::InputMethod and ui::TextInputClient for |
| 73 // text input. Some platforms (Mac and Android for example) use their own |
| 74 // text input system. |
| 75 virtual ui::TextInputClient* GetTextInputClient() = 0; |
| 76 |
66 // Set focus to the associated View component. | 77 // Set focus to the associated View component. |
67 virtual void Focus() = 0; | 78 virtual void Focus() = 0; |
68 // Returns true if the View currently has the focus. | 79 // Returns true if the View currently has the focus. |
69 virtual bool HasFocus() const = 0; | 80 virtual bool HasFocus() const = 0; |
70 // Returns true is the current display surface is available. | 81 // Returns true is the current display surface is available. |
71 virtual bool IsSurfaceAvailableForCopy() const = 0; | 82 virtual bool IsSurfaceAvailableForCopy() const = 0; |
72 | 83 |
73 // Shows/hides the view. These must always be called together in pairs. | 84 // Shows/hides the view. These must always be called together in pairs. |
74 // It is not legal to call Hide() multiple times in a row. | 85 // It is not legal to call Hide() multiple times in a row. |
75 virtual void Show() = 0; | 86 virtual void Show() = 0; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // Returns |true| if text is currently being spoken by Mac OS X. | 162 // Returns |true| if text is currently being spoken by Mac OS X. |
152 virtual bool IsSpeaking() const = 0; | 163 virtual bool IsSpeaking() const = 0; |
153 // Stops speaking, if it is currently in progress. | 164 // Stops speaking, if it is currently in progress. |
154 virtual void StopSpeaking() = 0; | 165 virtual void StopSpeaking() = 0; |
155 #endif // defined(OS_MACOSX) | 166 #endif // defined(OS_MACOSX) |
156 }; | 167 }; |
157 | 168 |
158 } // namespace content | 169 } // namespace content |
159 | 170 |
160 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ | 171 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_VIEW_H_ |
OLD | NEW |