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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
7 | 7 |
8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
10 #endif | 10 #endif |
11 | 11 |
12 #if defined(TOOLKIT_GTK) | 12 #if defined(TOOLKIT_GTK) |
13 #include <gdk/gdk.h> | 13 #include <gdk/gdk.h> |
14 #endif | 14 #endif |
15 | 15 |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/callback_forward.h" | 20 #include "base/callback_forward.h" |
21 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
22 #include "content/port/browser/render_widget_host_view_port.h" | 22 #include "content/port/browser/render_widget_host_view_port.h" |
23 #include "ui/base/range/range.h" | |
24 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
| 24 #include "ui/gfx/range/range.h" |
25 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
29 class RenderWidgetHostImpl; | 29 class RenderWidgetHostImpl; |
30 | 30 |
31 // Basic implementation shared by concrete RenderWidgetHostView | 31 // Basic implementation shared by concrete RenderWidgetHostView |
32 // subclasses. | 32 // subclasses. |
33 // | 33 // |
34 // Note that nothing should use this class, except concrete subclasses | 34 // Note that nothing should use this class, except concrete subclasses |
35 // that are deriving from it, and code that is written specifically to | 35 // that are deriving from it, and code that is written specifically to |
36 // use one of these concrete subclasses (i.e. platform-specific code). | 36 // use one of these concrete subclasses (i.e. platform-specific code). |
37 // | 37 // |
38 // To enable embedders that add ports, everything else in content/ | 38 // To enable embedders that add ports, everything else in content/ |
39 // should use the RenderWidgetHostViewPort interface. | 39 // should use the RenderWidgetHostViewPort interface. |
40 // | 40 // |
41 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 41 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
42 class CONTENT_EXPORT RenderWidgetHostViewBase | 42 class CONTENT_EXPORT RenderWidgetHostViewBase |
43 : public RenderWidgetHostViewPort { | 43 : public RenderWidgetHostViewPort { |
44 public: | 44 public: |
45 virtual ~RenderWidgetHostViewBase(); | 45 virtual ~RenderWidgetHostViewBase(); |
46 | 46 |
47 // RenderWidgetHostViewPort implementation. | 47 // RenderWidgetHostViewPort implementation. |
48 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 48 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
49 virtual void SelectionChanged(const string16& text, | 49 virtual void SelectionChanged(const string16& text, |
50 size_t offset, | 50 size_t offset, |
51 const ui::Range& range) OVERRIDE; | 51 const gfx::Range& range) OVERRIDE; |
52 virtual void SetBackground(const SkBitmap& background) OVERRIDE; | 52 virtual void SetBackground(const SkBitmap& background) OVERRIDE; |
53 virtual const SkBitmap& GetBackground() OVERRIDE; | 53 virtual const SkBitmap& GetBackground() OVERRIDE; |
54 virtual gfx::Size GetPhysicalBackingSize() const OVERRIDE; | 54 virtual gfx::Size GetPhysicalBackingSize() const OVERRIDE; |
55 virtual float GetOverdrawBottomHeight() const OVERRIDE; | 55 virtual float GetOverdrawBottomHeight() const OVERRIDE; |
56 virtual bool IsShowingContextMenu() const OVERRIDE; | 56 virtual bool IsShowingContextMenu() const OVERRIDE; |
57 virtual void SetShowingContextMenu(bool showing_menu) OVERRIDE; | 57 virtual void SetShowingContextMenu(bool showing_menu) OVERRIDE; |
58 virtual string16 GetSelectedText() const OVERRIDE; | 58 virtual string16 GetSelectedText() const OVERRIDE; |
59 virtual bool IsMouseLocked() OVERRIDE; | 59 virtual bool IsMouseLocked() OVERRIDE; |
60 virtual void UnhandledWheelEvent( | 60 virtual void UnhandledWheelEvent( |
61 const WebKit::WebMouseWheelEvent& event) OVERRIDE; | 61 const WebKit::WebMouseWheelEvent& event) OVERRIDE; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 bool showing_context_menu_; | 137 bool showing_context_menu_; |
138 | 138 |
139 // A buffer containing the text inside and around the current selection range. | 139 // A buffer containing the text inside and around the current selection range. |
140 string16 selection_text_; | 140 string16 selection_text_; |
141 | 141 |
142 // The offset of the text stored in |selection_text_| relative to the start of | 142 // The offset of the text stored in |selection_text_| relative to the start of |
143 // the web page. | 143 // the web page. |
144 size_t selection_text_offset_; | 144 size_t selection_text_offset_; |
145 | 145 |
146 // The current selection range relative to the start of the web page. | 146 // The current selection range relative to the start of the web page. |
147 ui::Range selection_range_; | 147 gfx::Range selection_range_; |
148 | 148 |
149 protected: | 149 protected: |
150 // The scale factor of the display the renderer is currently on. | 150 // The scale factor of the display the renderer is currently on. |
151 float current_device_scale_factor_; | 151 float current_device_scale_factor_; |
152 | 152 |
153 private: | 153 private: |
154 // Manager of the tree representation of the WebKit render tree. | 154 // Manager of the tree representation of the WebKit render tree. |
155 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; | 155 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; |
156 | 156 |
157 gfx::Rect current_display_area_; | 157 gfx::Rect current_display_area_; |
158 | 158 |
159 uint32 renderer_frame_number_; | 159 uint32 renderer_frame_number_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 161 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace content | 164 } // namespace content |
165 | 165 |
166 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 166 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
OLD | NEW |