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

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

Issue 7863003: Mouse lock implementation, including the renderer side and the Windows version of the browser side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove two tab chars. Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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>
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 const WebKit::WebMouseWheelEvent& event) OVERRIDE; 171 const WebKit::WebMouseWheelEvent& event) OVERRIDE;
172 virtual void SetHasHorizontalScrollbar( 172 virtual void SetHasHorizontalScrollbar(
173 bool has_horizontal_scrollbar) OVERRIDE; 173 bool has_horizontal_scrollbar) OVERRIDE;
174 virtual void SetScrollOffsetPinning( 174 virtual void SetScrollOffsetPinning(
175 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; 175 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE;
176 virtual gfx::PluginWindowHandle GetCompositingSurface() OVERRIDE; 176 virtual gfx::PluginWindowHandle GetCompositingSurface() OVERRIDE;
177 virtual void ShowCompositorHostWindow(bool show) OVERRIDE; 177 virtual void ShowCompositorHostWindow(bool show) OVERRIDE;
178 virtual void OnAccessibilityNotifications( 178 virtual void OnAccessibilityNotifications(
179 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params 179 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params
180 ) OVERRIDE; 180 ) OVERRIDE;
181 virtual bool LockMouse() OVERRIDE;
182 virtual void UnlockMouse() OVERRIDE;
181 183
182 // Implementation of NotificationObserver: 184 // Implementation of NotificationObserver:
183 virtual void Observe(int type, 185 virtual void Observe(int type,
184 const NotificationSource& source, 186 const NotificationSource& source,
185 const NotificationDetails& details) OVERRIDE; 187 const NotificationDetails& details) OVERRIDE;
186 188
187 // Implementation of BrowserAccessibilityDelegate: 189 // Implementation of BrowserAccessibilityDelegate:
188 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE; 190 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE;
189 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE; 191 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE;
190 192
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 void CleanupCompositorWindow(); 283 void CleanupCompositorWindow();
282 284
283 // Whether the window should be activated. 285 // Whether the window should be activated.
284 bool IsActivatable() const; 286 bool IsActivatable() const;
285 287
286 // Do initialization needed by both InitAsPopup() and InitAsFullscreen(). 288 // Do initialization needed by both InitAsPopup() and InitAsFullscreen().
287 void DoPopupOrFullscreenInit(HWND parent_hwnd, 289 void DoPopupOrFullscreenInit(HWND parent_hwnd,
288 const gfx::Rect& pos, 290 const gfx::Rect& pos,
289 DWORD ex_style); 291 DWORD ex_style);
290 292
293 CPoint GetClientCenter() const;
294 void MoveCursorToCenter() const;
295
296 void HandleLockedMouseEvent(UINT message, WPARAM wparam, LPARAM lparam);
297
291 // The associated Model. While |this| is being Destroyed, 298 // The associated Model. While |this| is being Destroyed,
292 // |render_widget_host_| is NULL and the Windows message loop is run one last 299 // |render_widget_host_| is NULL and the Windows message loop is run one last
293 // time. Message handlers must check for a NULL |render_widget_host_|. 300 // time. Message handlers must check for a NULL |render_widget_host_|.
294 RenderWidgetHost* render_widget_host_; 301 RenderWidgetHost* render_widget_host_;
295 302
296 // When we are doing accelerated compositing 303 // When we are doing accelerated compositing
297 HWND compositor_host_window_; 304 HWND compositor_host_window_;
298 305
299 // true if the compositor host window must be hidden after the 306 // true if the compositor host window must be hidden after the
300 // software renderered view is updated. 307 // software renderered view is updated.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 383
377 // Stores the current text input type received by ImeUpdateTextInputState() 384 // Stores the current text input type received by ImeUpdateTextInputState()
378 // method. 385 // method.
379 ui::TextInputType text_input_type_; 386 ui::TextInputType text_input_type_;
380 387
381 ScopedVector<ui::ViewProp> props_; 388 ScopedVector<ui::ViewProp> props_;
382 389
383 // Is the widget fullscreen? 390 // Is the widget fullscreen?
384 bool is_fullscreen_; 391 bool is_fullscreen_;
385 392
393 // Used to record the last position of the mouse.
394 // While the mouse is locked, they store the last known position just as mouse
395 // lock was entered.
396 // Relative to the upper-left corner of the view.
397 int last_x_;
brettw 2011/09/14 22:17:58 Can you use a gfx::Point for both of these cases?
yzshen1 2011/09/19 20:48:41 Done. (Didn't use end-of-line comments because I c
398 int last_y_;
399 // Relative to the upper-left corner of the screen.
400 int last_global_x_;
401 int last_global_y_;
402
403 // In the case of the mouse being moved away from the view and then moved
404 // back, we regard the mouse movement as (0, 0).
405 bool ignore_mouse_movement_;
406
386 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); 407 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin);
387 }; 408 };
388 409
389 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ 410 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698