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

Side by Side Diff: ash/wm/cursor_manager.cc

Issue 10965020: Fix cursor getting invisible after moving a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « ash/wm/cursor_manager.h ('k') | ash/wm/cursor_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ash/wm/cursor_manager.h" 5 #include "ash/wm/cursor_manager.h"
6 6
7 #include "ash/wm/cursor_delegate.h" 7 #include "ash/wm/cursor_delegate.h"
8 #include "ash/wm/image_cursors.h" 8 #include "ash/wm/image_cursors.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 18 matching lines...) Expand all
29 cursor_lock_count_++; 29 cursor_lock_count_++;
30 } 30 }
31 31
32 void CursorManager::UnlockCursor() { 32 void CursorManager::UnlockCursor() {
33 cursor_lock_count_--; 33 cursor_lock_count_--;
34 DCHECK_GE(cursor_lock_count_, 0); 34 DCHECK_GE(cursor_lock_count_, 0);
35 if (cursor_lock_count_ == 0) { 35 if (cursor_lock_count_ == 0) {
36 if (did_cursor_change_) { 36 if (did_cursor_change_) {
37 did_cursor_change_ = false; 37 did_cursor_change_ = false;
38 if (delegate_) 38 if (delegate_)
39 delegate_->SetCursor(cursor_to_set_on_unlock_); 39 SetCursorInternal(cursor_to_set_on_unlock_);
40 } 40 }
41 did_cursor_change_ = false; 41 did_cursor_change_ = false;
42 cursor_to_set_on_unlock_ = gfx::kNullCursor; 42 cursor_to_set_on_unlock_ = gfx::kNullCursor;
43 } 43 }
44 } 44 }
45 45
46 void CursorManager::SetCursor(gfx::NativeCursor cursor) { 46 void CursorManager::SetCursor(gfx::NativeCursor cursor) {
47 if (cursor_lock_count_ == 0) { 47 if (cursor_lock_count_ == 0) {
48 if (delegate_) 48 if (delegate_)
49 SetCursorInternal(cursor); 49 SetCursorInternal(cursor);
(...skipping 23 matching lines...) Expand all
73 void CursorManager::SetCursorInternal(gfx::NativeCursor cursor) { 73 void CursorManager::SetCursorInternal(gfx::NativeCursor cursor) {
74 DCHECK(delegate_); 74 DCHECK(delegate_);
75 current_cursor_ = cursor; 75 current_cursor_ = cursor;
76 image_cursors_->SetPlatformCursor(&current_cursor_); 76 image_cursors_->SetPlatformCursor(&current_cursor_);
77 current_cursor_.set_device_scale_factor( 77 current_cursor_.set_device_scale_factor(
78 image_cursors_->GetDeviceScaleFactor()); 78 image_cursors_->GetDeviceScaleFactor());
79 delegate_->SetCursor(current_cursor_); 79 delegate_->SetCursor(current_cursor_);
80 } 80 }
81 81
82 } // namespace ash 82 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/cursor_manager.h ('k') | ash/wm/cursor_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698