Chromium Code Reviews| 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_recognizer.h" | |
| 28 #include "ui/base/gestures/gesture_types.h" | |
| 27 #include "ui/base/win/ime_input.h" | 29 #include "ui/base/win/ime_input.h" |
| 28 #include "ui/gfx/native_widget_types.h" | 30 #include "ui/gfx/native_widget_types.h" |
| 29 #include "ui/gfx/point.h" | 31 #include "ui/gfx/point.h" |
| 30 #include "ui/gfx/surface/accelerated_surface_win.h" | 32 #include "ui/gfx/surface/accelerated_surface_win.h" |
| 31 #include "ui/gfx/sys_color_change_listener.h" | 33 #include "ui/gfx/sys_color_change_listener.h" |
| 32 #include "webkit/glue/webcursor.h" | 34 #include "webkit/glue/webcursor.h" |
| 33 | 35 |
| 34 class BackingStore; | 36 class BackingStore; |
| 35 class SkRegion; | 37 class SkRegion; |
| 36 | 38 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after 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(ui::EventType type, | |
| 256 const gfx::Point& location, | |
| 257 int flags, | |
| 258 const base::Time time, | |
| 259 float param_first, | |
| 260 float param_second, | |
| 261 unsigned int touch_id_bitfield) OVERRIDE; | |
| 262 virtual ui::TouchEvent* CreateTouchEvent(ui::EventType type, | |
| 263 const gfx::Point& location, | |
| 264 int touch_id, | |
| 265 base::TimeDelta time_stamp) OVERRIDE; | |
| 266 virtual bool DispatchLongPressGestureEvent(ui::GestureEvent* event) OVERRIDE; | |
| 267 virtual bool DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; | |
| 268 | |
| 251 protected: | 269 protected: |
| 252 friend class content::RenderWidgetHostView; | 270 friend class content::RenderWidgetHostView; |
| 253 | 271 |
| 254 // Should construct only via RenderWidgetHostView::CreateViewForWidget. | 272 // Should construct only via RenderWidgetHostView::CreateViewForWidget. |
| 255 // | 273 // |
| 256 // The view will associate itself with the given widget. | 274 // The view will associate itself with the given widget. |
| 257 explicit RenderWidgetHostViewWin(content::RenderWidgetHost* widget); | 275 explicit RenderWidgetHostViewWin(content::RenderWidgetHost* widget); |
| 258 | 276 |
| 259 // Windows Message Handlers | 277 // Windows Message Handlers |
| 260 LRESULT OnCreate(CREATESTRUCT* create_struct); | 278 LRESULT OnCreate(CREATESTRUCT* create_struct); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 463 | 481 |
| 464 WebKit::WebTouchEvent touch_event_; | 482 WebKit::WebTouchEvent touch_event_; |
| 465 const CWindowImpl* const window_; | 483 const CWindowImpl* const window_; |
| 466 }; | 484 }; |
| 467 | 485 |
| 468 // The touch-state. Its touch-points are updated as necessary. A new | 486 // The touch-state. Its touch-points are updated as necessary. A new |
| 469 // touch-point is added from an TOUCHEVENTF_DOWN message, and a touch-point | 487 // touch-point is added from an TOUCHEVENTF_DOWN message, and a touch-point |
| 470 // is removed from the list on an TOUCHEVENTF_UP message. | 488 // is removed from the list on an TOUCHEVENTF_UP message. |
| 471 WebTouchState touch_state_; | 489 WebTouchState touch_state_; |
| 472 | 490 |
| 491 ui::GestureRecognizer * gesture_recognizer_; | |
|
sky
2012/05/03 23:22:39
This leaks now. I'm saying declare it by value:
ui
tfarina
2012/05/03 23:25:26
If you use scoped_ptr here, you can forward declar
| |
| 492 | |
| 473 // True if we're in the midst of a paint operation and should respond to | 493 // True if we're in the midst of a paint operation and should respond to |
| 474 // DidPaintRect() notifications by merely invalidating. See comments on | 494 // DidPaintRect() notifications by merely invalidating. See comments on |
| 475 // render_widget_host_view.h:DidPaintRect(). | 495 // render_widget_host_view.h:DidPaintRect(). |
| 476 bool about_to_validate_and_paint_; | 496 bool about_to_validate_and_paint_; |
| 477 | 497 |
| 478 // true if the View should be closed when its HWND is deactivated (used to | 498 // true if the View should be closed when its HWND is deactivated (used to |
| 479 // support SELECT popups which are closed when they are deactivated). | 499 // support SELECT popups which are closed when they are deactivated). |
| 480 bool close_on_deactivate_; | 500 bool close_on_deactivate_; |
| 481 | 501 |
| 482 // Whether Destroy() has been called. Used to detect a crasher | 502 // Whether Destroy() has been called. Used to detect a crasher |
| (...skipping 91 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 |