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

Side by Side Diff: ui/wm/core/cursor_manager.cc

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)
Patch Set: OK, it can't be explicit for mac. Created 3 years, 7 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
« no previous file with comments | « ui/wm/core/compound_event_filter.cc ('k') | ui/wm/core/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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/wm/core/cursor_manager.h" 5 #include "ui/wm/core/cursor_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/aura/client/cursor_client_observer.h" 11 #include "ui/aura/client/cursor_client_observer.h"
12 #include "ui/wm/core/native_cursor_manager.h" 12 #include "ui/wm/core/native_cursor_manager.h"
13 #include "ui/wm/core/native_cursor_manager_delegate.h" 13 #include "ui/wm/core/native_cursor_manager_delegate.h"
14 14
15 namespace wm { 15 namespace wm {
16 16
17 namespace internal { 17 namespace internal {
18 18
19 // Represents the cursor state which is composed of cursor type, visibility, and 19 // Represents the cursor state which is composed of cursor type, visibility, and
20 // mouse events enable state. When mouse events are disabled, the cursor is 20 // mouse events enable state. When mouse events are disabled, the cursor is
21 // always invisible. 21 // always invisible.
22 class CursorState { 22 class CursorState {
23 public: 23 public:
24 CursorState() 24 CursorState()
25 : cursor_(ui::kCursorNone), 25 : cursor_(ui::CursorType::kNone),
26 visible_(true), 26 visible_(true),
27 cursor_set_(ui::CURSOR_SET_NORMAL), 27 cursor_set_(ui::CURSOR_SET_NORMAL),
28 mouse_events_enabled_(true), 28 mouse_events_enabled_(true),
29 visible_on_mouse_events_enabled_(true) { 29 visible_on_mouse_events_enabled_(true) {}
30 }
31 30
32 gfx::NativeCursor cursor() const { return cursor_; } 31 gfx::NativeCursor cursor() const { return cursor_; }
33 void set_cursor(gfx::NativeCursor cursor) { cursor_ = cursor; } 32 void set_cursor(gfx::NativeCursor cursor) { cursor_ = cursor; }
34 33
35 bool visible() const { return visible_; } 34 bool visible() const { return visible_; }
36 void SetVisible(bool visible) { 35 void SetVisible(bool visible) {
37 if (mouse_events_enabled_) 36 if (mouse_events_enabled_)
38 visible_ = visible; 37 visible_ = visible;
39 // Ignores the call when mouse events disabled. 38 // Ignores the call when mouse events disabled.
40 } 39 }
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 224
226 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { 225 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) {
227 current_state_->set_cursor_set(cursor_set); 226 current_state_->set_cursor_set(cursor_set);
228 } 227 }
229 228
230 void CursorManager::CommitMouseEventsEnabled(bool enabled) { 229 void CursorManager::CommitMouseEventsEnabled(bool enabled) {
231 current_state_->SetMouseEventsEnabled(enabled); 230 current_state_->SetMouseEventsEnabled(enabled);
232 } 231 }
233 232
234 } // namespace wm 233 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/compound_event_filter.cc ('k') | ui/wm/core/cursor_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698