OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "base/task.h" | 16 #include "base/task.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "content/browser/renderer_host/render_widget_host_view.h" | 18 #include "content/browser/renderer_host/render_widget_host_view.h" |
19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
22 #include "ui/base/ime/text_input_client.h" | |
23 #include "ui/gfx/compositor/compositor_observer.h" | 22 #include "ui/gfx/compositor/compositor_observer.h" |
24 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
25 #include "views/controls/native/native_view_host.h" | 24 #include "views/controls/native/native_view_host.h" |
26 #include "views/events/event.h" | 25 #include "views/events/event.h" |
| 26 #include "views/ime/text_input_client.h" |
27 #include "views/touchui/touch_selection_controller.h" | 27 #include "views/touchui/touch_selection_controller.h" |
28 #include "views/view.h" | 28 #include "views/view.h" |
29 #include "webkit/glue/webcursor.h" | 29 #include "webkit/glue/webcursor.h" |
30 | 30 |
31 #if defined(TOUCH_UI) | 31 #if defined(TOUCH_UI) |
32 namespace ui { | 32 namespace ui { |
33 enum TouchStatus; | 33 enum TouchStatus; |
34 } | 34 } |
35 #endif | 35 #endif |
36 | 36 |
37 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 37 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
38 class AcceleratedSurfaceContainerLinux; | 38 class AcceleratedSurfaceContainerLinux; |
39 #endif | 39 #endif |
40 | 40 |
41 class RenderWidgetHost; | 41 class RenderWidgetHost; |
42 struct NativeWebKeyboardEvent; | 42 struct NativeWebKeyboardEvent; |
43 | 43 |
44 // ----------------------------------------------------------------------------- | 44 // ----------------------------------------------------------------------------- |
45 // See comments in render_widget_host_view.h about this class and its members. | 45 // See comments in render_widget_host_view.h about this class and its members. |
46 // ----------------------------------------------------------------------------- | 46 // ----------------------------------------------------------------------------- |
47 class RenderWidgetHostViewViews : public RenderWidgetHostView, | 47 class RenderWidgetHostViewViews : public RenderWidgetHostView, |
48 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 48 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
49 public ui::CompositorObserver, | 49 public ui::CompositorObserver, |
50 #endif | 50 #endif |
51 public views::TouchSelectionClientView, | 51 public views::TouchSelectionClientView, |
52 public ui::TextInputClient, | 52 public views::TextInputClient, |
53 public content::NotificationObserver { | 53 public content::NotificationObserver { |
54 public: | 54 public: |
55 // Internal class name. | 55 // Internal class name. |
56 static const char kViewClassName[]; | 56 static const char kViewClassName[]; |
57 | 57 |
58 explicit RenderWidgetHostViewViews(RenderWidgetHost* widget); | 58 explicit RenderWidgetHostViewViews(RenderWidgetHost* widget); |
59 virtual ~RenderWidgetHostViewViews(); | 59 virtual ~RenderWidgetHostViewViews(); |
60 | 60 |
61 // Initialize this object for use as a drawing area. | 61 // Initialize this object for use as a drawing area. |
62 void InitAsChild(); | 62 void InitAsChild(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | 150 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
151 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE; | 151 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE; |
152 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; | 152 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
153 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; | 153 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
154 #if defined(TOUCH_UI) | 154 #if defined(TOUCH_UI) |
155 virtual ui::TouchStatus OnTouchEvent(const views::TouchEvent& event) OVERRIDE; | 155 virtual ui::TouchStatus OnTouchEvent(const views::TouchEvent& event) OVERRIDE; |
156 #endif | 156 #endif |
157 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | 157 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
158 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE; | 158 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE; |
159 virtual bool OnMouseWheel(const views::MouseWheelEvent& event) OVERRIDE; | 159 virtual bool OnMouseWheel(const views::MouseWheelEvent& event) OVERRIDE; |
160 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 160 virtual views::TextInputClient* GetTextInputClient() OVERRIDE; |
161 virtual bool GetTooltipText(const gfx::Point& p, | 161 virtual bool GetTooltipText(const gfx::Point& p, |
162 string16* tooltip) const OVERRIDE; | 162 string16* tooltip) const OVERRIDE; |
163 | 163 |
164 // Overridden from ui::TextInputClient: | 164 // Overridden from TextInputClient: |
165 virtual void SetCompositionText( | 165 virtual void SetCompositionText( |
166 const ui::CompositionText& composition) OVERRIDE; | 166 const ui::CompositionText& composition) OVERRIDE; |
167 virtual void ConfirmCompositionText() OVERRIDE; | 167 virtual void ConfirmCompositionText() OVERRIDE; |
168 virtual void ClearCompositionText() OVERRIDE; | 168 virtual void ClearCompositionText() OVERRIDE; |
169 virtual void InsertText(const string16& text) OVERRIDE; | 169 virtual void InsertText(const string16& text) OVERRIDE; |
170 virtual void InsertChar(char16 ch, int flags) OVERRIDE; | 170 virtual void InsertChar(char16 ch, int flags) OVERRIDE; |
171 virtual ui::TextInputType GetTextInputType() const OVERRIDE; | 171 virtual ui::TextInputType GetTextInputType() const OVERRIDE; |
172 virtual gfx::Rect GetCaretBounds() OVERRIDE; | 172 virtual gfx::Rect GetCaretBounds() OVERRIDE; |
173 virtual bool HasCompositionText() OVERRIDE; | 173 virtual bool HasCompositionText() OVERRIDE; |
174 virtual bool GetTextRange(ui::Range* range) OVERRIDE; | 174 virtual bool GetTextRange(ui::Range* range) OVERRIDE; |
175 virtual bool GetCompositionTextRange(ui::Range* range) OVERRIDE; | 175 virtual bool GetCompositionTextRange(ui::Range* range) OVERRIDE; |
176 virtual bool GetSelectionRange(ui::Range* range) OVERRIDE; | 176 virtual bool GetSelectionRange(ui::Range* range) OVERRIDE; |
177 virtual bool SetSelectionRange(const ui::Range& range) OVERRIDE; | 177 virtual bool SetSelectionRange(const ui::Range& range) OVERRIDE; |
178 virtual bool DeleteRange(const ui::Range& range) OVERRIDE; | 178 virtual bool DeleteRange(const ui::Range& range) OVERRIDE; |
179 virtual bool GetTextFromRange(const ui::Range& range, | 179 virtual bool GetTextFromRange(const ui::Range& range, |
180 string16* text) OVERRIDE; | 180 string16* text) OVERRIDE; |
181 virtual void OnInputMethodChanged() OVERRIDE; | 181 virtual void OnInputMethodChanged() OVERRIDE; |
182 virtual bool ChangeTextDirectionAndLayoutAlignment( | 182 virtual bool ChangeTextDirectionAndLayoutAlignment( |
183 base::i18n::TextDirection direction) OVERRIDE; | 183 base::i18n::TextDirection direction) OVERRIDE; |
| 184 virtual views::View* GetOwnerViewOfTextInputClient() OVERRIDE; |
184 | 185 |
185 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 186 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
186 virtual void AcceleratedSurfaceNew( | 187 virtual void AcceleratedSurfaceNew( |
187 int32 width, | 188 int32 width, |
188 int32 height, | 189 int32 height, |
189 uint64* surface_id, | 190 uint64* surface_id, |
190 TransportDIB::Handle* surface_handle) OVERRIDE; | 191 TransportDIB::Handle* surface_handle) OVERRIDE; |
191 virtual void AcceleratedSurfaceBuffersSwapped( | 192 virtual void AcceleratedSurfaceBuffersSwapped( |
192 uint64 surface_id, | 193 uint64 surface_id, |
193 int32 route_id, | 194 int32 route_id, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 313 |
313 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 314 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
314 std::map<uint64, scoped_refptr<AcceleratedSurfaceContainerLinux> > | 315 std::map<uint64, scoped_refptr<AcceleratedSurfaceContainerLinux> > |
315 accelerated_surface_containers_; | 316 accelerated_surface_containers_; |
316 #endif | 317 #endif |
317 | 318 |
318 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewViews); | 319 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewViews); |
319 }; | 320 }; |
320 | 321 |
321 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ | 322 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ |
OLD | NEW |