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

Side by Side Diff: ui/aura/cursor_manager.cc

Issue 10692170: Aura desktop: Show resize cursors again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 8 years, 4 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 | « ui/aura/cursor_manager.h ('k') | ui/aura/desktop/desktop_cursor_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/aura/cursor_manager.h"
6
7 #include "base/logging.h"
8 #include "ui/aura/cursor_delegate.h"
9 #include "ui/aura/env.h"
10
11 namespace aura {
12
13 CursorManager::CursorManager()
14 : delegate_(NULL),
15 cursor_lock_count_(0),
16 did_cursor_change_(false),
17 cursor_to_set_on_unlock_(0),
18 cursor_visible_(true) {
19 }
20
21 CursorManager::~CursorManager() {
22 }
23
24 void CursorManager::LockCursor() {
25 cursor_lock_count_++;
26 }
27
28 void CursorManager::UnlockCursor() {
29 cursor_lock_count_--;
30 DCHECK_GE(cursor_lock_count_, 0);
31 if (cursor_lock_count_ == 0) {
32 if (did_cursor_change_) {
33 did_cursor_change_ = false;
34 if (delegate_)
35 delegate_->SetCursor(cursor_to_set_on_unlock_);
36 }
37 did_cursor_change_ = false;
38 cursor_to_set_on_unlock_ = gfx::kNullCursor;
39 }
40 }
41
42 void CursorManager::SetCursor(gfx::NativeCursor cursor) {
43 if (cursor_lock_count_ == 0) {
44 if (delegate_)
45 delegate_->SetCursor(cursor);
46 } else {
47 cursor_to_set_on_unlock_ = cursor;
48 did_cursor_change_ = true;
49 }
50 }
51
52 void CursorManager::ShowCursor(bool show) {
53 cursor_visible_ = show;
54 if (delegate_)
55 delegate_->ShowCursor(show);
56 }
57
58 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/cursor_manager.h ('k') | ui/aura/desktop/desktop_cursor_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698