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

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

Issue 8791001: Fix mouse lock perf issue on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 // Whether the window should be activated. 329 // Whether the window should be activated.
330 bool IsActivatable() const; 330 bool IsActivatable() const;
331 331
332 // Do initialization needed by both InitAsPopup() and InitAsFullscreen(). 332 // Do initialization needed by both InitAsPopup() and InitAsFullscreen().
333 void DoPopupOrFullscreenInit(HWND parent_hwnd, 333 void DoPopupOrFullscreenInit(HWND parent_hwnd,
334 const gfx::Rect& pos, 334 const gfx::Rect& pos,
335 DWORD ex_style); 335 DWORD ex_style);
336 336
337 CPoint GetClientCenter() const; 337 CPoint GetClientCenter() const;
338 void MoveCursorToCenter() const; 338 // In mouse lock mode, moves the mouse cursor to the center of the view if it
339 // is too close to the border.
340 void MoveCursorToCenterIfNecessary();
339 341
340 void HandleLockedMouseEvent(UINT message, WPARAM wparam, LPARAM lparam); 342 void HandleLockedMouseEvent(UINT message, WPARAM wparam, LPARAM lparam);
341 343
342 LRESULT OnDocumentFeed(RECONVERTSTRING* reconv); 344 LRESULT OnDocumentFeed(RECONVERTSTRING* reconv);
343 LRESULT OnReconvertString(RECONVERTSTRING* reconv); 345 LRESULT OnReconvertString(RECONVERTSTRING* reconv);
344 346
345 // The associated Model. While |this| is being Destroyed, 347 // The associated Model. While |this| is being Destroyed,
346 // |render_widget_host_| is NULL and the Windows message loop is run one last 348 // |render_widget_host_| is NULL and the Windows message loop is run one last
347 // time. Message handlers must check for a NULL |render_widget_host_|. 349 // time. Message handlers must check for a NULL |render_widget_host_|.
348 RenderWidgetHost* render_widget_host_; 350 RenderWidgetHost* render_widget_host_;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 // Stores the current text input type received by TextInputStateChanged() 474 // Stores the current text input type received by TextInputStateChanged()
473 // method. 475 // method.
474 ui::TextInputType text_input_type_; 476 ui::TextInputType text_input_type_;
475 477
476 ScopedVector<ui::ViewProp> props_; 478 ScopedVector<ui::ViewProp> props_;
477 479
478 // Is the widget fullscreen? 480 // Is the widget fullscreen?
479 bool is_fullscreen_; 481 bool is_fullscreen_;
480 482
481 // Used to record the last position of the mouse. 483 // Used to record the last position of the mouse.
482 // While the mouse is locked, they store the last known position just as mouse 484 struct {
483 // lock was entered. 485 // While the mouse is locked, |unlocked| and |unlocked_global| store the
484 // Relative to the upper-left corner of the view. 486 // last known position just as mouse lock was entered.
485 gfx::Point last_mouse_position_; 487 // Relative to the upper-left corner of the view.
486 // Relative to the upper-left corner of the screen. 488 gfx::Point unlocked;
487 gfx::Point last_global_mouse_position_; 489 // Relative to the upper-left corner of the screen.
490 gfx::Point unlocked_global;
491
492 // Only valid while the mouse is locked.
493 gfx::Point locked_global;
494 } last_mouse_position_;
495
496 // When the mouse cursor is moved to the center of the view by
497 // MoveCursorToCenterIfNecessary(), we ignore the resulting WM_MOUSEMOVE
498 // message.
499 struct {
500 bool pending;
501 // Relative to the upper-left corner of the screen.
502 gfx::Point target;
503 } move_to_center_request_;
488 504
489 // In the case of the mouse being moved away from the view and then moved 505 // In the case of the mouse being moved away from the view and then moved
490 // back, we regard the mouse movement as (0, 0). 506 // back, we regard the mouse movement as (0, 0).
491 bool ignore_mouse_movement_; 507 bool ignore_mouse_movement_;
492 508
493 ui::Range composition_range_; 509 ui::Range composition_range_;
494 510
495 // Set to true if the next lbutton down message is to be ignored. Set by the 511 // Set to true if the next lbutton down message is to be ignored. Set by the
496 // WM_POINTERXX handler. We do this to ensure that we don't send out 512 // WM_POINTERXX handler. We do this to ensure that we don't send out
497 // duplicate lbutton down messages to the renderer. 513 // duplicate lbutton down messages to the renderer.
498 bool ignore_next_lbutton_message_at_same_location; 514 bool ignore_next_lbutton_message_at_same_location;
499 // The location of the last WM_POINTERDOWN message. We ignore the subsequent 515 // The location of the last WM_POINTERDOWN message. We ignore the subsequent
500 // lbutton down only if the locations match. 516 // lbutton down only if the locations match.
501 LPARAM last_pointer_down_location_; 517 LPARAM last_pointer_down_location_;
502 518
503 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); 519 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin);
504 }; 520 };
505 521
506 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ 522 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698