| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 OnCursorVisibilityChanged(false)); | 125 OnCursorVisibilityChanged(false)); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool CursorManager::IsCursorVisible() const { | 129 bool CursorManager::IsCursorVisible() const { |
| 130 return current_state_->visible(); | 130 return current_state_->visible(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void CursorManager::SetCursorSet(ui::CursorSetType cursor_set) { | 133 void CursorManager::SetCursorSet(ui::CursorSetType cursor_set) { |
| 134 state_on_unlock_->set_cursor_set(cursor_set); | 134 state_on_unlock_->set_cursor_set(cursor_set); |
| 135 if (GetCursorSet() != state_on_unlock_->cursor_set()) | 135 if (GetCursorSet() != state_on_unlock_->cursor_set()) { |
| 136 delegate_->SetCursorSet(state_on_unlock_->cursor_set(), this); | 136 delegate_->SetCursorSet(state_on_unlock_->cursor_set(), this); |
| 137 FOR_EACH_OBSERVER(aura::client::CursorClientObserver, observers_, |
| 138 OnCursorSetChanged(cursor_set)); |
| 139 } |
| 137 } | 140 } |
| 138 | 141 |
| 139 ui::CursorSetType CursorManager::GetCursorSet() const { | 142 ui::CursorSetType CursorManager::GetCursorSet() const { |
| 140 return current_state_->cursor_set(); | 143 return current_state_->cursor_set(); |
| 141 } | 144 } |
| 142 | 145 |
| 143 void CursorManager::EnableMouseEvents() { | 146 void CursorManager::EnableMouseEvents() { |
| 144 state_on_unlock_->SetMouseEventsEnabled(true); | 147 state_on_unlock_->SetMouseEventsEnabled(true); |
| 145 if (cursor_lock_count_ == 0 && | 148 if (cursor_lock_count_ == 0 && |
| 146 IsMouseEventsEnabled() != state_on_unlock_->mouse_events_enabled()) { | 149 IsMouseEventsEnabled() != state_on_unlock_->mouse_events_enabled()) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 225 |
| 223 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { | 226 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { |
| 224 current_state_->set_cursor_set(cursor_set); | 227 current_state_->set_cursor_set(cursor_set); |
| 225 } | 228 } |
| 226 | 229 |
| 227 void CursorManager::CommitMouseEventsEnabled(bool enabled) { | 230 void CursorManager::CommitMouseEventsEnabled(bool enabled) { |
| 228 current_state_->SetMouseEventsEnabled(enabled); | 231 current_state_->SetMouseEventsEnabled(enabled); |
| 229 } | 232 } |
| 230 | 233 |
| 231 } // namespace wm | 234 } // namespace wm |
| OLD | NEW |