• ananta's avatar
    Ensure that mouse lock works correctly on Chrome ASH in Windows 8. · b306b1e6
    ananta authored
    The lock mouse operation invoked by plugins or pages hides the mouse cursor and ensures that the cursor stays within the bounds
    of the webpage. To ensure that the mouse stays within the bounds of the page, the SetCursorPos operation is executed by the host.
    In ASH, the SetCursorPos API is executed by the viewer process for historical reasons.
    
    As a result on Windows 8 there is a faint possibility that the user may move the mouse to the charms section of the OS, which causes the cursor to
    become visible.
    
    Fix for this is to track if the mouse changed from what was last set in the viewer process and restore it.
    
    The other change is in the RemoteWindowTreeHostWin class where the member ignore_mouse_moves_until_set_cursor_ack_ has been changed to a count
    from a bool flag. This is because the RemoteWindowTreeHostWin::MoveCursorToNative function can be called multiple times before the acks are received
    causing DCHECKs to fire on the ignore_mouse_moves_until_set_cursor_ack_ flag.
    
    BUG=398792
    
    Review URL: https://codereview.chromium.org/560633002
    
    Cr-Commit-Position: refs/heads/master@{#294274}
    b306b1e6
chrome_app_view_ash.cc 48.6 KB