| OLD | NEW |
| 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" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // The visibility to set when mouse events are enabled. | 68 // The visibility to set when mouse events are enabled. |
| 69 bool visible_on_mouse_events_enabled_; | 69 bool visible_on_mouse_events_enabled_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(CursorState); | 71 DISALLOW_COPY_AND_ASSIGN(CursorState); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace internal | 74 } // namespace internal |
| 75 | 75 |
| 76 bool CursorManager::last_cursor_visibility_state_ = true; | 76 bool CursorManager::last_cursor_visibility_state_ = true; |
| 77 | 77 |
| 78 CursorManager::CursorManager(scoped_ptr<NativeCursorManager> delegate) | 78 CursorManager::CursorManager(std::unique_ptr<NativeCursorManager> delegate) |
| 79 : delegate_(std::move(delegate)), | 79 : delegate_(std::move(delegate)), |
| 80 cursor_lock_count_(0), | 80 cursor_lock_count_(0), |
| 81 current_state_(new internal::CursorState), | 81 current_state_(new internal::CursorState), |
| 82 state_on_unlock_(new internal::CursorState) { | 82 state_on_unlock_(new internal::CursorState) { |
| 83 // Restore the last cursor visibility state. | 83 // Restore the last cursor visibility state. |
| 84 current_state_->SetVisible(last_cursor_visibility_state_); | 84 current_state_->SetVisible(last_cursor_visibility_state_); |
| 85 } | 85 } |
| 86 | 86 |
| 87 CursorManager::~CursorManager() { | 87 CursorManager::~CursorManager() { |
| 88 } | 88 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { | 218 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { |
| 219 current_state_->set_cursor_set(cursor_set); | 219 current_state_->set_cursor_set(cursor_set); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void CursorManager::CommitMouseEventsEnabled(bool enabled) { | 222 void CursorManager::CommitMouseEventsEnabled(bool enabled) { |
| 223 current_state_->SetMouseEventsEnabled(enabled); | 223 current_state_->SetMouseEventsEnabled(enabled); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace wm | 226 } // namespace wm |
| OLD | NEW |