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/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "content/browser/renderer_host/render_widget_host_view.h" | 15 #include "content/browser/renderer_host/render_widget_host_view.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
18 #include "views/controls/native/native_view_host.h" | 18 #include "views/controls/native/native_view_host.h" |
19 #include "views/events/event.h" | 19 #include "views/events/event.h" |
20 #include "views/ime/text_input_client.h" | 20 #include "views/ime/text_input_client.h" |
21 #include "views/view.h" | 21 #include "views/view.h" |
22 #include "webkit/glue/webcursor.h" | 22 #include "webkit/glue/webcursor.h" |
23 | 23 |
| 24 #if defined(TOUCH_UI) |
24 namespace ui { | 25 namespace ui { |
25 enum TouchStatus; | 26 enum TouchStatus; |
26 } | 27 } |
| 28 #endif |
27 | 29 |
28 class RenderWidgetHost; | 30 class RenderWidgetHost; |
29 struct NativeWebKeyboardEvent; | 31 struct NativeWebKeyboardEvent; |
30 | 32 |
31 // ----------------------------------------------------------------------------- | 33 // ----------------------------------------------------------------------------- |
32 // See comments in render_widget_host_view.h about this class and its members. | 34 // See comments in render_widget_host_view.h about this class and its members. |
33 // ----------------------------------------------------------------------------- | 35 // ----------------------------------------------------------------------------- |
34 class RenderWidgetHostViewViews : public RenderWidgetHostView, | 36 class RenderWidgetHostViewViews : public RenderWidgetHostView, |
35 public views::View, | 37 public views::View, |
36 public views::TextInputClient { | 38 public views::TextInputClient { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 virtual void RenderViewGone(base::TerminationStatus status, | 75 virtual void RenderViewGone(base::TerminationStatus status, |
74 int error_code) OVERRIDE; | 76 int error_code) OVERRIDE; |
75 virtual void Destroy() OVERRIDE; | 77 virtual void Destroy() OVERRIDE; |
76 virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) OVERRIDE {} | 78 virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) OVERRIDE {} |
77 virtual void SetTooltipText(const std::wstring& tooltip_text) OVERRIDE; | 79 virtual void SetTooltipText(const std::wstring& tooltip_text) OVERRIDE; |
78 virtual void SelectionChanged(const std::string& text, | 80 virtual void SelectionChanged(const std::string& text, |
79 const ui::Range& range) OVERRIDE; | 81 const ui::Range& range) OVERRIDE; |
80 virtual void ShowingContextMenu(bool showing) OVERRIDE; | 82 virtual void ShowingContextMenu(bool showing) OVERRIDE; |
81 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; | 83 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; |
82 virtual void SetBackground(const SkBitmap& background) OVERRIDE; | 84 virtual void SetBackground(const SkBitmap& background) OVERRIDE; |
| 85 #if defined(TOOLKIT_USES_GTK) |
83 virtual void CreatePluginContainer(gfx::PluginWindowHandle id) OVERRIDE; | 86 virtual void CreatePluginContainer(gfx::PluginWindowHandle id) OVERRIDE; |
84 virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) OVERRIDE; | 87 virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) OVERRIDE; |
| 88 #endif |
85 virtual void SetVisuallyDeemphasized(const SkColor* color, | 89 virtual void SetVisuallyDeemphasized(const SkColor* color, |
86 bool animate) OVERRIDE; | 90 bool animate) OVERRIDE; |
87 virtual bool ContainsNativeView(gfx::NativeView native_view) const OVERRIDE; | 91 virtual bool ContainsNativeView(gfx::NativeView native_view) const OVERRIDE; |
| 92 #if defined(TOOLKIT_USES_GTK) |
88 virtual void AcceleratedCompositingActivated(bool activated) OVERRIDE; | 93 virtual void AcceleratedCompositingActivated(bool activated) OVERRIDE; |
| 94 #endif |
| 95 #if defined(OS_WIN) |
| 96 virtual void WillWmDestroy() OVERRIDE; |
| 97 virtual void ShowCompositorHostWindow(bool show) OVERRIDE; |
| 98 #endif |
89 virtual gfx::PluginWindowHandle GetCompositingSurface() OVERRIDE; | 99 virtual gfx::PluginWindowHandle GetCompositingSurface() OVERRIDE; |
90 | 100 |
91 // On some systems, there can be two native views, where an outer native view | 101 // On some systems, there can be two native views, where an outer native view |
92 // contains the inner native view (e.g. when using GTK+). This returns the | 102 // contains the inner native view (e.g. when using GTK+). This returns the |
93 // inner view. This can return NULL when it's not attached to a view. | 103 // inner view. This can return NULL when it's not attached to a view. |
94 gfx::NativeView GetInnerNativeView() const; | 104 gfx::NativeView GetInnerNativeView() const; |
95 | 105 |
96 // Overridden from views::View. | 106 // Overridden from views::View. |
97 virtual std::string GetClassName() const OVERRIDE; | 107 virtual std::string GetClassName() const OVERRIDE; |
98 virtual gfx::NativeCursor GetCursor(const views::MouseEvent& event) OVERRIDE; | 108 virtual gfx::NativeCursor GetCursor(const views::MouseEvent& event) OVERRIDE; |
99 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 109 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
100 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | 110 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; |
101 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | 111 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
102 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE; | 112 virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE; |
103 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; | 113 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
104 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; | 114 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
| 115 #if defined(TOUCH_UI) |
105 virtual ui::TouchStatus OnTouchEvent(const views::TouchEvent& event) OVERRIDE; | 116 virtual ui::TouchStatus OnTouchEvent(const views::TouchEvent& event) OVERRIDE; |
| 117 #endif |
106 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | 118 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
107 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE; | 119 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE; |
108 virtual bool OnMouseWheel(const views::MouseWheelEvent& event) OVERRIDE; | 120 virtual bool OnMouseWheel(const views::MouseWheelEvent& event) OVERRIDE; |
109 virtual views::TextInputClient* GetTextInputClient() OVERRIDE; | 121 virtual views::TextInputClient* GetTextInputClient() OVERRIDE; |
110 | 122 |
111 // Overridden from TextInputClient: | 123 // Overridden from TextInputClient: |
112 virtual void SetCompositionText( | 124 virtual void SetCompositionText( |
113 const ui::CompositionText& composition) OVERRIDE; | 125 const ui::CompositionText& composition) OVERRIDE; |
114 virtual void ConfirmCompositionText() OVERRIDE; | 126 virtual void ConfirmCompositionText() OVERRIDE; |
115 virtual void ClearCompositionText() OVERRIDE; | 127 virtual void ClearCompositionText() OVERRIDE; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // The current caret bounds. | 224 // The current caret bounds. |
213 gfx::Rect caret_bounds_; | 225 gfx::Rect caret_bounds_; |
214 | 226 |
215 // Indicates if there is onging composition text. | 227 // Indicates if there is onging composition text. |
216 bool has_composition_text_; | 228 bool has_composition_text_; |
217 | 229 |
218 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewViews); | 230 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewViews); |
219 }; | 231 }; |
220 | 232 |
221 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ | 233 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ |
OLD | NEW |