Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.h

Issue 9391024: Custom frame UI for platform apps on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 int gpu_host_id) OVERRIDE; 206 int gpu_host_id) OVERRIDE;
205 virtual void AcceleratedSurfacePostSubBuffer( 207 virtual void AcceleratedSurfacePostSubBuffer(
206 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, 208 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
207 int gpu_host_id) OVERRIDE; 209 int gpu_host_id) OVERRIDE;
208 virtual void AcceleratedSurfaceSuspend() OVERRIDE; 210 virtual void AcceleratedSurfaceSuspend() OVERRIDE;
209 virtual void OnAccessibilityNotifications( 211 virtual void OnAccessibilityNotifications(
210 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params 212 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params
211 ) OVERRIDE; 213 ) OVERRIDE;
212 virtual bool LockMouse() OVERRIDE; 214 virtual bool LockMouse() OVERRIDE;
213 virtual void UnlockMouse() OVERRIDE; 215 virtual void UnlockMouse() OVERRIDE;
216 virtual void SetTransparentRegion(SkRegion* region) OVERRIDE;
214 217
215 // Implementation of content::NotificationObserver: 218 // Implementation of content::NotificationObserver:
216 virtual void Observe(int type, 219 virtual void Observe(int type,
217 const content::NotificationSource& source, 220 const content::NotificationSource& source,
218 const content::NotificationDetails& details) OVERRIDE; 221 const content::NotificationDetails& details) OVERRIDE;
219 222
220 // Implementation of BrowserAccessibilityDelegate: 223 // Implementation of BrowserAccessibilityDelegate:
221 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; 224 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE;
222 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; 225 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE;
223 virtual void AccessibilityScrollToMakeVisible( 226 virtual void AccessibilityScrollToMakeVisible(
(...skipping 10 matching lines...) Expand all
234 // 237 //
235 // The view will associate itself with the given widget. 238 // The view will associate itself with the given widget.
236 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); 239 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget);
237 240
238 // Windows Message Handlers 241 // Windows Message Handlers
239 LRESULT OnCreate(CREATESTRUCT* create_struct); 242 LRESULT OnCreate(CREATESTRUCT* create_struct);
240 void OnActivate(UINT, BOOL, HWND); 243 void OnActivate(UINT, BOOL, HWND);
241 void OnDestroy(); 244 void OnDestroy();
242 void OnPaint(HDC unused_dc); 245 void OnPaint(HDC unused_dc);
243 void OnNCPaint(HRGN update_region); 246 void OnNCPaint(HRGN update_region);
247 LRESULT OnNCHitTest(const CPoint& pt);
244 LRESULT OnEraseBkgnd(HDC dc); 248 LRESULT OnEraseBkgnd(HDC dc);
245 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id); 249 LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT mouse_message_id);
246 void OnSetFocus(HWND window); 250 void OnSetFocus(HWND window);
247 void OnKillFocus(HWND window); 251 void OnKillFocus(HWND window);
248 void OnCaptureChanged(HWND window); 252 void OnCaptureChanged(HWND window);
249 void OnCancelMode(); 253 void OnCancelMode();
250 void OnInputLangChange(DWORD character_set, HKL input_language_id); 254 void OnInputLangChange(DWORD character_set, HKL input_language_id);
251 void OnThemeChanged(); 255 void OnThemeChanged();
252 LRESULT OnNotify(int w_param, NMHDR* header); 256 LRESULT OnNotify(int w_param, NMHDR* header);
253 LRESULT OnImeSetContext( 257 LRESULT OnImeSetContext(
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 543
540 // Set to true if we are in the context of a WM_POINTERDOWN message 544 // Set to true if we are in the context of a WM_POINTERDOWN message
541 bool pointer_down_context_; 545 bool pointer_down_context_;
542 546
543 // Set to true if the focus is currently on an editable field on the page. 547 // Set to true if the focus is currently on an editable field on the page.
544 bool focus_on_editable_field_; 548 bool focus_on_editable_field_;
545 549
546 // Set to true if we received a focus change after a WM_POINTERDOWN message. 550 // Set to true if we received a focus change after a WM_POINTERDOWN message.
547 bool received_focus_change_after_pointer_down_; 551 bool received_focus_change_after_pointer_down_;
548 552
553 // Region in which the view will be transparent to clicks.
554 gfx::ScopedSkRegion transparent_region_;
555
549 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); 556 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin);
550 }; 557 };
551 558
552 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ 559 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698