| 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.h" | 23 #include "content/browser/renderer_host/render_widget_host_view.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/win/ime_input.h" | 27 #include "ui/base/win/ime_input.h" |
| 28 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
| 29 #include "ui/gfx/point.h" | 29 #include "ui/gfx/point.h" |
| 30 #include "ui/gfx/scoped_sk_region.h" |
| 30 #include "ui/gfx/surface/accelerated_surface_win.h" | 31 #include "ui/gfx/surface/accelerated_surface_win.h" |
| 31 #include "webkit/glue/webcursor.h" | 32 #include "webkit/glue/webcursor.h" |
| 32 | 33 |
| 33 class BackingStore; | 34 class BackingStore; |
| 34 class RenderWidgetHost; | 35 class RenderWidgetHost; |
| 35 | 36 |
| 36 namespace gfx { | 37 namespace gfx { |
| 37 class Size; | 38 class Size; |
| 38 class Rect; | 39 class Rect; |
| 39 } | 40 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 CONTENT_EXPORT IAccessible* GetIAccessible(); | 101 CONTENT_EXPORT IAccessible* GetIAccessible(); |
| 101 | 102 |
| 102 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); | 103 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); |
| 103 | 104 |
| 104 BEGIN_MSG_MAP(RenderWidgetHostHWND) | 105 BEGIN_MSG_MAP(RenderWidgetHostHWND) |
| 105 MSG_WM_CREATE(OnCreate) | 106 MSG_WM_CREATE(OnCreate) |
| 106 MSG_WM_ACTIVATE(OnActivate) | 107 MSG_WM_ACTIVATE(OnActivate) |
| 107 MSG_WM_DESTROY(OnDestroy) | 108 MSG_WM_DESTROY(OnDestroy) |
| 108 MSG_WM_PAINT(OnPaint) | 109 MSG_WM_PAINT(OnPaint) |
| 109 MSG_WM_NCPAINT(OnNCPaint) | 110 MSG_WM_NCPAINT(OnNCPaint) |
| 111 MSG_WM_NCHITTEST(OnNCHitTest) |
| 110 MSG_WM_ERASEBKGND(OnEraseBkgnd) | 112 MSG_WM_ERASEBKGND(OnEraseBkgnd) |
| 111 MSG_WM_SETCURSOR(OnSetCursor) | 113 MSG_WM_SETCURSOR(OnSetCursor) |
| 112 MSG_WM_SETFOCUS(OnSetFocus) | 114 MSG_WM_SETFOCUS(OnSetFocus) |
| 113 MSG_WM_KILLFOCUS(OnKillFocus) | 115 MSG_WM_KILLFOCUS(OnKillFocus) |
| 114 MSG_WM_CAPTURECHANGED(OnCaptureChanged) | 116 MSG_WM_CAPTURECHANGED(OnCaptureChanged) |
| 115 MSG_WM_CANCELMODE(OnCancelMode) | 117 MSG_WM_CANCELMODE(OnCancelMode) |
| 116 MSG_WM_INPUTLANGCHANGE(OnInputLangChange) | 118 MSG_WM_INPUTLANGCHANGE(OnInputLangChange) |
| 117 MSG_WM_THEMECHANGED(OnThemeChanged) | 119 MSG_WM_THEMECHANGED(OnThemeChanged) |
| 118 MSG_WM_NOTIFY(OnNotify) | 120 MSG_WM_NOTIFY(OnNotify) |
| 119 MESSAGE_HANDLER(WM_IME_SETCONTEXT, OnImeSetContext) | 121 MESSAGE_HANDLER(WM_IME_SETCONTEXT, OnImeSetContext) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 const content::NotificationDetails& details) OVERRIDE; | 220 const content::NotificationDetails& details) OVERRIDE; |
| 219 | 221 |
| 220 // Implementation of BrowserAccessibilityDelegate: | 222 // Implementation of BrowserAccessibilityDelegate: |
| 221 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; | 223 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; |
| 222 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; | 224 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; |
| 223 virtual void AccessibilityChangeScrollPosition( | 225 virtual void AccessibilityChangeScrollPosition( |
| 224 int acc_obj_id, int scroll_x, int scroll_y) OVERRIDE; | 226 int acc_obj_id, int scroll_x, int scroll_y) OVERRIDE; |
| 225 virtual void AccessibilitySetTextSelection( | 227 virtual void AccessibilitySetTextSelection( |
| 226 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 228 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
| 227 | 229 |
| 230 virtual void SetTransparentRegion(SkRegion* region); |
| 231 |
| 228 protected: | 232 protected: |
| 229 // Windows Message Handlers | 233 // Windows Message Handlers |
| 230 LRESULT OnCreate(CREATESTRUCT* create_struct); | 234 LRESULT OnCreate(CREATESTRUCT* create_struct); |
| 231 void OnActivate(UINT, BOOL, HWND); | 235 void OnActivate(UINT, BOOL, HWND); |
| 232 void OnDestroy(); | 236 void OnDestroy(); |
| 233 void OnPaint(HDC unused_dc); | 237 void OnPaint(HDC unused_dc); |
| 234 void OnNCPaint(HRGN update_region); | 238 void OnNCPaint(HRGN update_region); |
| 239 LRESULT OnNCHitTest(const CPoint& pt); |
| 235 LRESULT OnEraseBkgnd(HDC dc); | 240 LRESULT OnEraseBkgnd(HDC dc); |
| 236 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id); | 241 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id); |
| 237 void OnSetFocus(HWND window); | 242 void OnSetFocus(HWND window); |
| 238 void OnKillFocus(HWND window); | 243 void OnKillFocus(HWND window); |
| 239 void OnCaptureChanged(HWND window); | 244 void OnCaptureChanged(HWND window); |
| 240 void OnCancelMode(); | 245 void OnCancelMode(); |
| 241 void OnInputLangChange(DWORD character_set, HKL input_language_id); | 246 void OnInputLangChange(DWORD character_set, HKL input_language_id); |
| 242 void OnThemeChanged(); | 247 void OnThemeChanged(); |
| 243 LRESULT OnNotify(int w_param, NMHDR* header); | 248 LRESULT OnNotify(int w_param, NMHDR* header); |
| 244 LRESULT OnImeSetContext( | 249 LRESULT OnImeSetContext( |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 535 |
| 531 // Set to true if we are in the context of a WM_POINTERDOWN message | 536 // Set to true if we are in the context of a WM_POINTERDOWN message |
| 532 bool pointer_down_context_; | 537 bool pointer_down_context_; |
| 533 | 538 |
| 534 // Set to true if the focus is currently on an editable field on the page. | 539 // Set to true if the focus is currently on an editable field on the page. |
| 535 bool focus_on_editable_field_; | 540 bool focus_on_editable_field_; |
| 536 | 541 |
| 537 // Set to true if we received a focus change after a WM_POINTERDOWN message. | 542 // Set to true if we received a focus change after a WM_POINTERDOWN message. |
| 538 bool received_focus_change_after_pointer_down_; | 543 bool received_focus_change_after_pointer_down_; |
| 539 | 544 |
| 545 // Region in which the view will be transparent to clicks. |
| 546 gfx::ScopedSkRegion transparent_region_; |
| 547 |
| 540 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 548 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
| 541 }; | 549 }; |
| 542 | 550 |
| 543 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 551 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
| OLD | NEW |