| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 delegate_->SetMouseEventsEnabled(state_on_unlock_->mouse_events_enabled(), | 158 delegate_->SetMouseEventsEnabled(state_on_unlock_->mouse_events_enabled(), |
| 159 this); | 159 this); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool CursorManager::IsMouseEventsEnabled() const { | 163 bool CursorManager::IsMouseEventsEnabled() const { |
| 164 return current_state_->mouse_events_enabled(); | 164 return current_state_->mouse_events_enabled(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void CursorManager::SetDisplay(const display::Display& display) { | 167 void CursorManager::SetDisplay(const display::Display& display) { |
| 168 display_ = display; |
| 169 for (auto& observer : observers_) |
| 170 observer.OnCursorDisplayChanged(display); |
| 171 |
| 168 delegate_->SetDisplay(display, this); | 172 delegate_->SetDisplay(display, this); |
| 169 } | 173 } |
| 170 | 174 |
| 175 const display::Display& CursorManager::GetDisplay() const { |
| 176 return display_; |
| 177 } |
| 178 |
| 171 void CursorManager::LockCursor() { | 179 void CursorManager::LockCursor() { |
| 172 cursor_lock_count_++; | 180 cursor_lock_count_++; |
| 173 } | 181 } |
| 174 | 182 |
| 175 void CursorManager::UnlockCursor() { | 183 void CursorManager::UnlockCursor() { |
| 176 cursor_lock_count_--; | 184 cursor_lock_count_--; |
| 177 DCHECK_GE(cursor_lock_count_, 0); | 185 DCHECK_GE(cursor_lock_count_, 0); |
| 178 if (cursor_lock_count_ > 0) | 186 if (cursor_lock_count_ > 0) |
| 179 return; | 187 return; |
| 180 | 188 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 232 |
| 225 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { | 233 void CursorManager::CommitCursorSet(ui::CursorSetType cursor_set) { |
| 226 current_state_->set_cursor_set(cursor_set); | 234 current_state_->set_cursor_set(cursor_set); |
| 227 } | 235 } |
| 228 | 236 |
| 229 void CursorManager::CommitMouseEventsEnabled(bool enabled) { | 237 void CursorManager::CommitMouseEventsEnabled(bool enabled) { |
| 230 current_state_->SetMouseEventsEnabled(enabled); | 238 current_state_->SetMouseEventsEnabled(enabled); |
| 231 } | 239 } |
| 232 | 240 |
| 233 } // namespace wm | 241 } // namespace wm |
| OLD | NEW |