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_WIN_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlapp.h> | 10 #include <atlapp.h> |
11 #include <atlcrack.h> | 11 #include <atlcrack.h> |
12 #include <atlmisc.h> | 12 #include <atlmisc.h> |
13 #include <peninputpanel.h> | 13 #include <peninputpanel.h> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/time.h" | 20 #include "base/time.h" |
21 #include "base/win/scoped_comptr.h" | 21 #include "base/win/scoped_comptr.h" |
22 #include "content/browser/accessibility/browser_accessibility_manager.h" | 22 #include "content/browser/accessibility/browser_accessibility_manager.h" |
23 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
24 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
25 #include "content/public/browser/notification_observer.h" | 25 #include "content/public/browser/notification_observer.h" |
26 #include "content/public/browser/notification_registrar.h" | 26 #include "content/public/browser/notification_registrar.h" |
| 27 #include "ui/base/gestures/gesture_types.h" |
27 #include "ui/base/win/ime_input.h" | 28 #include "ui/base/win/ime_input.h" |
28 #include "ui/gfx/native_widget_types.h" | 29 #include "ui/gfx/native_widget_types.h" |
29 #include "ui/gfx/point.h" | 30 #include "ui/gfx/point.h" |
30 #include "ui/gfx/surface/accelerated_surface_win.h" | 31 #include "ui/gfx/surface/accelerated_surface_win.h" |
31 #include "ui/gfx/sys_color_change_listener.h" | 32 #include "ui/gfx/sys_color_change_listener.h" |
32 #include "webkit/glue/webcursor.h" | 33 #include "webkit/glue/webcursor.h" |
33 | 34 |
34 class BackingStore; | 35 class BackingStore; |
35 class SkRegion; | 36 class SkRegion; |
36 | 37 |
37 namespace content { | 38 namespace content { |
38 class RenderWidgetHost; | 39 class RenderWidgetHost; |
39 } | 40 } |
40 | 41 |
41 namespace gfx { | 42 namespace gfx { |
42 class Size; | 43 class Size; |
43 class Rect; | 44 class Rect; |
44 } | 45 } |
45 | 46 |
46 namespace IPC { | 47 namespace IPC { |
47 class Message; | 48 class Message; |
48 } | 49 } |
49 | 50 |
50 namespace ui { | 51 namespace ui { |
| 52 class GestureRecognizer; |
51 class ViewProp; | 53 class ViewProp; |
52 } | 54 } |
53 | 55 |
54 typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0> | 56 typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0> |
55 RenderWidgetHostHWNDTraits; | 57 RenderWidgetHostHWNDTraits; |
56 | 58 |
57 CONTENT_EXPORT extern const wchar_t kRenderWidgetHostHWNDClass[]; | 59 CONTENT_EXPORT extern const wchar_t kRenderWidgetHostHWNDClass[]; |
58 | 60 |
59 // TODO(ananta) | 61 // TODO(ananta) |
60 // This should be removed once we have the new windows SDK which defines these | 62 // This should be removed once we have the new windows SDK which defines these |
(...skipping 26 matching lines...) Expand all Loading... |
87 // references to it must become NULL." | 89 // references to it must become NULL." |
88 // | 90 // |
89 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 91 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
90 class RenderWidgetHostViewWin | 92 class RenderWidgetHostViewWin |
91 : public CWindowImpl<RenderWidgetHostViewWin, | 93 : public CWindowImpl<RenderWidgetHostViewWin, |
92 CWindow, | 94 CWindow, |
93 RenderWidgetHostHWNDTraits>, | 95 RenderWidgetHostHWNDTraits>, |
94 public content::RenderWidgetHostViewBase, | 96 public content::RenderWidgetHostViewBase, |
95 public content::NotificationObserver, | 97 public content::NotificationObserver, |
96 public BrowserAccessibilityDelegate, | 98 public BrowserAccessibilityDelegate, |
97 public gfx::SysColorChangeListener { | 99 public gfx::SysColorChangeListener, |
| 100 public ui::GestureEventHelper { |
98 public: | 101 public: |
99 virtual ~RenderWidgetHostViewWin(); | 102 virtual ~RenderWidgetHostViewWin(); |
100 | 103 |
101 CONTENT_EXPORT void CreateWnd(HWND parent); | 104 CONTENT_EXPORT void CreateWnd(HWND parent); |
102 | 105 |
103 void ScheduleComposite(); | 106 void ScheduleComposite(); |
104 | 107 |
105 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); | 108 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); |
106 | 109 |
107 BEGIN_MSG_MAP(RenderWidgetHostHWND) | 110 BEGIN_MSG_MAP(RenderWidgetHostHWND) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 virtual void AccessibilityScrollToMakeVisible( | 244 virtual void AccessibilityScrollToMakeVisible( |
242 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; | 245 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; |
243 virtual void AccessibilityScrollToPoint( | 246 virtual void AccessibilityScrollToPoint( |
244 int acc_obj_id, gfx::Point point) OVERRIDE; | 247 int acc_obj_id, gfx::Point point) OVERRIDE; |
245 virtual void AccessibilitySetTextSelection( | 248 virtual void AccessibilitySetTextSelection( |
246 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 249 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
247 | 250 |
248 // Implementation of SysColorChangeListener: | 251 // Implementation of SysColorChangeListener: |
249 virtual void OnSysColorChange() OVERRIDE; | 252 virtual void OnSysColorChange() OVERRIDE; |
250 | 253 |
| 254 // Overridden from ui::GestureEventHelper. |
| 255 virtual ui::GestureEvent* CreateGestureEvent( |
| 256 ui::EventType type, |
| 257 const gfx::Point& location, |
| 258 int flags, |
| 259 base::Time time, |
| 260 float param_first, |
| 261 float param_second, |
| 262 unsigned int touch_id_bitfield) OVERRIDE; |
| 263 virtual ui::TouchEvent* CreateTouchEvent( |
| 264 ui::EventType type, |
| 265 const gfx::Point& location, |
| 266 int touch_id, |
| 267 base::TimeDelta time_stamp) OVERRIDE; |
| 268 virtual bool DispatchLongPressGestureEvent(ui::GestureEvent* event) OVERRIDE; |
| 269 virtual bool DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; |
| 270 |
251 protected: | 271 protected: |
252 friend class content::RenderWidgetHostView; | 272 friend class content::RenderWidgetHostView; |
253 | 273 |
254 // Should construct only via RenderWidgetHostView::CreateViewForWidget. | 274 // Should construct only via RenderWidgetHostView::CreateViewForWidget. |
255 // | 275 // |
256 // The view will associate itself with the given widget. | 276 // The view will associate itself with the given widget. |
257 explicit RenderWidgetHostViewWin(content::RenderWidgetHost* widget); | 277 explicit RenderWidgetHostViewWin(content::RenderWidgetHost* widget); |
258 | 278 |
259 // Windows Message Handlers | 279 // Windows Message Handlers |
260 LRESULT OnCreate(CREATESTRUCT* create_struct); | 280 LRESULT OnCreate(CREATESTRUCT* create_struct); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 594 |
575 // Are touch events currently enabled? | 595 // Are touch events currently enabled? |
576 bool touch_events_enabled_; | 596 bool touch_events_enabled_; |
577 | 597 |
578 gfx::ScopedSysColorChangeListener sys_color_change_listener_; | 598 gfx::ScopedSysColorChangeListener sys_color_change_listener_; |
579 | 599 |
580 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 600 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
581 }; | 601 }; |
582 | 602 |
583 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 603 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
OLD | NEW |