| 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 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 AccessibilityScrollToMakeVisible( | 225 virtual void AccessibilityScrollToMakeVisible( |
| 224 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; | 226 int acc_obj_id, gfx::Rect subfocus) OVERRIDE; |
| 225 virtual void AccessibilityScrollToPoint( | 227 virtual void AccessibilityScrollToPoint( |
| 226 int acc_obj_id, gfx::Point point) OVERRIDE; | 228 int acc_obj_id, gfx::Point point) OVERRIDE; |
| 227 virtual void AccessibilitySetTextSelection( | 229 virtual void AccessibilitySetTextSelection( |
| 228 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 230 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
| 229 | 231 |
| 232 virtual void SetTransparentRegion(SkRegion* region); |
| 233 |
| 230 protected: | 234 protected: |
| 231 friend class RenderWidgetHostView; | 235 friend class RenderWidgetHostView; |
| 232 | 236 |
| 233 // Should construct only via RenderWidgetHostView::CreateViewForWidget. | 237 // Should construct only via RenderWidgetHostView::CreateViewForWidget. |
| 234 // | 238 // |
| 235 // The view will associate itself with the given widget. | 239 // The view will associate itself with the given widget. |
| 236 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); | 240 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); |
| 237 | 241 |
| 238 // Windows Message Handlers | 242 // Windows Message Handlers |
| 239 LRESULT OnCreate(CREATESTRUCT* create_struct); | 243 LRESULT OnCreate(CREATESTRUCT* create_struct); |
| 240 void OnActivate(UINT, BOOL, HWND); | 244 void OnActivate(UINT, BOOL, HWND); |
| 241 void OnDestroy(); | 245 void OnDestroy(); |
| 242 void OnPaint(HDC unused_dc); | 246 void OnPaint(HDC unused_dc); |
| 243 void OnNCPaint(HRGN update_region); | 247 void OnNCPaint(HRGN update_region); |
| 248 LRESULT OnNCHitTest(const CPoint& pt); |
| 244 LRESULT OnEraseBkgnd(HDC dc); | 249 LRESULT OnEraseBkgnd(HDC dc); |
| 245 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id); | 250 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id); |
| 246 void OnSetFocus(HWND window); | 251 void OnSetFocus(HWND window); |
| 247 void OnKillFocus(HWND window); | 252 void OnKillFocus(HWND window); |
| 248 void OnCaptureChanged(HWND window); | 253 void OnCaptureChanged(HWND window); |
| 249 void OnCancelMode(); | 254 void OnCancelMode(); |
| 250 void OnInputLangChange(DWORD character_set, HKL input_language_id); | 255 void OnInputLangChange(DWORD character_set, HKL input_language_id); |
| 251 void OnThemeChanged(); | 256 void OnThemeChanged(); |
| 252 LRESULT OnNotify(int w_param, NMHDR* header); | 257 LRESULT OnNotify(int w_param, NMHDR* header); |
| 253 LRESULT OnImeSetContext( | 258 LRESULT OnImeSetContext( |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 544 |
| 540 // Set to true if we are in the context of a WM_POINTERDOWN message | 545 // Set to true if we are in the context of a WM_POINTERDOWN message |
| 541 bool pointer_down_context_; | 546 bool pointer_down_context_; |
| 542 | 547 |
| 543 // Set to true if the focus is currently on an editable field on the page. | 548 // Set to true if the focus is currently on an editable field on the page. |
| 544 bool focus_on_editable_field_; | 549 bool focus_on_editable_field_; |
| 545 | 550 |
| 546 // Set to true if we received a focus change after a WM_POINTERDOWN message. | 551 // Set to true if we received a focus change after a WM_POINTERDOWN message. |
| 547 bool received_focus_change_after_pointer_down_; | 552 bool received_focus_change_after_pointer_down_; |
| 548 | 553 |
| 554 // Region in which the view will be transparent to clicks. |
| 555 gfx::ScopedSkRegion transparent_region_; |
| 556 |
| 549 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 557 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
| 550 }; | 558 }; |
| 551 | 559 |
| 552 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 560 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
| OLD | NEW |