| 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/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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void ScheduleComposite(); | 97 void ScheduleComposite(); |
| 97 | 98 |
| 98 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); | 99 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); |
| 99 | 100 |
| 100 BEGIN_MSG_MAP(RenderWidgetHostHWND) | 101 BEGIN_MSG_MAP(RenderWidgetHostHWND) |
| 101 MSG_WM_CREATE(OnCreate) | 102 MSG_WM_CREATE(OnCreate) |
| 102 MSG_WM_ACTIVATE(OnActivate) | 103 MSG_WM_ACTIVATE(OnActivate) |
| 103 MSG_WM_DESTROY(OnDestroy) | 104 MSG_WM_DESTROY(OnDestroy) |
| 104 MSG_WM_PAINT(OnPaint) | 105 MSG_WM_PAINT(OnPaint) |
| 105 MSG_WM_NCPAINT(OnNCPaint) | 106 MSG_WM_NCPAINT(OnNCPaint) |
| 107 MSG_WM_NCHITTEST(OnNCHitTest) |
| 106 MSG_WM_ERASEBKGND(OnEraseBkgnd) | 108 MSG_WM_ERASEBKGND(OnEraseBkgnd) |
| 107 MSG_WM_SETCURSOR(OnSetCursor) | 109 MSG_WM_SETCURSOR(OnSetCursor) |
| 108 MSG_WM_SETFOCUS(OnSetFocus) | 110 MSG_WM_SETFOCUS(OnSetFocus) |
| 109 MSG_WM_KILLFOCUS(OnKillFocus) | 111 MSG_WM_KILLFOCUS(OnKillFocus) |
| 110 MSG_WM_CAPTURECHANGED(OnCaptureChanged) | 112 MSG_WM_CAPTURECHANGED(OnCaptureChanged) |
| 111 MSG_WM_CANCELMODE(OnCancelMode) | 113 MSG_WM_CANCELMODE(OnCancelMode) |
| 112 MSG_WM_INPUTLANGCHANGE(OnInputLangChange) | 114 MSG_WM_INPUTLANGCHANGE(OnInputLangChange) |
| 113 MSG_WM_THEMECHANGED(OnThemeChanged) | 115 MSG_WM_THEMECHANGED(OnThemeChanged) |
| 114 MSG_WM_NOTIFY(OnNotify) | 116 MSG_WM_NOTIFY(OnNotify) |
| 115 MESSAGE_HANDLER(WM_IME_SETCONTEXT, OnImeSetContext) | 117 MESSAGE_HANDLER(WM_IME_SETCONTEXT, OnImeSetContext) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 int gpu_host_id) OVERRIDE; | 208 int gpu_host_id) OVERRIDE; |
| 207 virtual void AcceleratedSurfacePostSubBuffer( | 209 virtual void AcceleratedSurfacePostSubBuffer( |
| 208 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 210 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
| 209 int gpu_host_id) OVERRIDE; | 211 int gpu_host_id) OVERRIDE; |
| 210 virtual void AcceleratedSurfaceSuspend() OVERRIDE; | 212 virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
| 211 virtual void OnAccessibilityNotifications( | 213 virtual void OnAccessibilityNotifications( |
| 212 const std::vector<AccessibilityHostMsg_NotificationParams>& params | 214 const std::vector<AccessibilityHostMsg_NotificationParams>& params |
| 213 ) OVERRIDE; | 215 ) OVERRIDE; |
| 214 virtual bool LockMouse() OVERRIDE; | 216 virtual bool LockMouse() OVERRIDE; |
| 215 virtual void UnlockMouse() OVERRIDE; | 217 virtual void UnlockMouse() OVERRIDE; |
| 218 virtual void SetClickthroughRegion(SkRegion* region) OVERRIDE; |
| 216 | 219 |
| 217 // Implementation of content::NotificationObserver: | 220 // Implementation of content::NotificationObserver: |
| 218 virtual void Observe(int type, | 221 virtual void Observe(int type, |
| 219 const content::NotificationSource& source, | 222 const content::NotificationSource& source, |
| 220 const content::NotificationDetails& details) OVERRIDE; | 223 const content::NotificationDetails& details) OVERRIDE; |
| 221 | 224 |
| 222 // Implementation of BrowserAccessibilityDelegate: | 225 // Implementation of BrowserAccessibilityDelegate: |
| 223 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; | 226 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; |
| 224 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; | 227 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; |
| 225 virtual void AccessibilityScrollToMakeVisible( | 228 virtual void AccessibilityScrollToMakeVisible( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 236 // | 239 // |
| 237 // The view will associate itself with the given widget. | 240 // The view will associate itself with the given widget. |
| 238 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); | 241 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); |
| 239 | 242 |
| 240 // Windows Message Handlers | 243 // Windows Message Handlers |
| 241 LRESULT OnCreate(CREATESTRUCT* create_struct); | 244 LRESULT OnCreate(CREATESTRUCT* create_struct); |
| 242 void OnActivate(UINT, BOOL, HWND); | 245 void OnActivate(UINT, BOOL, HWND); |
| 243 void OnDestroy(); | 246 void OnDestroy(); |
| 244 void OnPaint(HDC unused_dc); | 247 void OnPaint(HDC unused_dc); |
| 245 void OnNCPaint(HRGN update_region); | 248 void OnNCPaint(HRGN update_region); |
| 249 LRESULT OnNCHitTest(const CPoint& pt); |
| 246 LRESULT OnEraseBkgnd(HDC dc); | 250 LRESULT OnEraseBkgnd(HDC dc); |
| 247 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id); | 251 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id); |
| 248 void OnSetFocus(HWND window); | 252 void OnSetFocus(HWND window); |
| 249 void OnKillFocus(HWND window); | 253 void OnKillFocus(HWND window); |
| 250 void OnCaptureChanged(HWND window); | 254 void OnCaptureChanged(HWND window); |
| 251 void OnCancelMode(); | 255 void OnCancelMode(); |
| 252 void OnInputLangChange(DWORD character_set, HKL input_language_id); | 256 void OnInputLangChange(DWORD character_set, HKL input_language_id); |
| 253 void OnThemeChanged(); | 257 void OnThemeChanged(); |
| 254 LRESULT OnNotify(int w_param, NMHDR* header); | 258 LRESULT OnNotify(int w_param, NMHDR* header); |
| 255 LRESULT OnImeSetContext( | 259 LRESULT OnImeSetContext( |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 536 |
| 533 // Set to true if we are in the context of a WM_POINTERDOWN message | 537 // Set to true if we are in the context of a WM_POINTERDOWN message |
| 534 bool pointer_down_context_; | 538 bool pointer_down_context_; |
| 535 | 539 |
| 536 // Set to true if the focus is currently on an editable field on the page. | 540 // Set to true if the focus is currently on an editable field on the page. |
| 537 bool focus_on_editable_field_; | 541 bool focus_on_editable_field_; |
| 538 | 542 |
| 539 // Set to true if we received a focus change after a WM_POINTERDOWN message. | 543 // Set to true if we received a focus change after a WM_POINTERDOWN message. |
| 540 bool received_focus_change_after_pointer_down_; | 544 bool received_focus_change_after_pointer_down_; |
| 541 | 545 |
| 546 // Region in which the view will be transparent to clicks. |
| 547 gfx::ScopedSkRegion transparent_region_; |
| 548 |
| 542 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 549 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
| 543 }; | 550 }; |
| 544 | 551 |
| 545 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 552 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
| OLD | NEW |