| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/ws/window_manager_state.h" | 5 #include "services/ui/ws/window_manager_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 const ui::KeyEvent& event) const { | 124 const ui::KeyEvent& event) const { |
| 125 return key_code == event.key_code() && | 125 return key_code == event.key_code() && |
| 126 event_flags == (kAcceleratorEventFlags & event.flags()) && | 126 event_flags == (kAcceleratorEventFlags & event.flags()) && |
| 127 !event.is_char(); | 127 !event.is_char(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 WindowManagerState::QueuedEvent::QueuedEvent() {} | 130 WindowManagerState::QueuedEvent::QueuedEvent() {} |
| 131 WindowManagerState::QueuedEvent::~QueuedEvent() {} | 131 WindowManagerState::QueuedEvent::~QueuedEvent() {} |
| 132 | 132 |
| 133 WindowManagerState::WindowManagerState(WindowTree* window_tree) | 133 WindowManagerState::WindowManagerState(WindowTree* window_tree) |
| 134 : window_tree_(window_tree), event_dispatcher_(this) { | 134 : window_tree_(window_tree), |
| 135 event_dispatcher_(this), |
| 136 cursor_state_(window_tree_->display_manager()) { |
| 135 frame_decoration_values_ = mojom::FrameDecorationValues::New(); | 137 frame_decoration_values_ = mojom::FrameDecorationValues::New(); |
| 136 frame_decoration_values_->max_title_bar_button_width = 0u; | 138 frame_decoration_values_->max_title_bar_button_width = 0u; |
| 137 | 139 |
| 138 AddDebugAccelerators(); | 140 AddDebugAccelerators(); |
| 139 } | 141 } |
| 140 | 142 |
| 141 WindowManagerState::~WindowManagerState() { | 143 WindowManagerState::~WindowManagerState() { |
| 142 for (auto& display_root : window_manager_display_roots_) | 144 for (auto& display_root : window_manager_display_roots_) |
| 143 display_root->display()->OnWillDestroyTree(window_tree_); | 145 display_root->display()->OnWillDestroyTree(window_tree_); |
| 144 | 146 |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 // TODO(sky): maybe abstract this away so that DCHECK can be added? | 596 // TODO(sky): maybe abstract this away so that DCHECK can be added? |
| 595 if (!platform_display_with_capture_) | 597 if (!platform_display_with_capture_) |
| 596 return; | 598 return; |
| 597 | 599 |
| 598 platform_display_with_capture_->ReleaseCapture(); | 600 platform_display_with_capture_->ReleaseCapture(); |
| 599 platform_display_with_capture_ = nullptr; | 601 platform_display_with_capture_ = nullptr; |
| 600 } | 602 } |
| 601 | 603 |
| 602 void WindowManagerState::UpdateNativeCursorFromDispatcher() { | 604 void WindowManagerState::UpdateNativeCursorFromDispatcher() { |
| 603 const ui::CursorData cursor = event_dispatcher_.GetCurrentMouseCursor(); | 605 const ui::CursorData cursor = event_dispatcher_.GetCurrentMouseCursor(); |
| 604 for (Display* display : display_manager()->displays()) | 606 cursor_state_.SetCurrentWindowCursor(cursor); |
| 605 display->UpdateNativeCursor(cursor); | |
| 606 } | 607 } |
| 607 | 608 |
| 608 void WindowManagerState::OnCaptureChanged(ServerWindow* new_capture, | 609 void WindowManagerState::OnCaptureChanged(ServerWindow* new_capture, |
| 609 ServerWindow* old_capture) { | 610 ServerWindow* old_capture) { |
| 610 window_server()->ProcessCaptureChanged(new_capture, old_capture); | 611 window_server()->ProcessCaptureChanged(new_capture, old_capture); |
| 611 } | 612 } |
| 612 | 613 |
| 613 void WindowManagerState::OnMouseCursorLocationChanged(const gfx::Point& point) { | 614 void WindowManagerState::OnMouseCursorLocationChanged(const gfx::Point& point) { |
| 614 window_server() | 615 window_server() |
| 615 ->display_manager() | 616 ->display_manager() |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 window->RemoveObserver(this); | 713 window->RemoveObserver(this); |
| 713 orphaned_window_manager_display_roots_.erase(iter); | 714 orphaned_window_manager_display_roots_.erase(iter); |
| 714 return; | 715 return; |
| 715 } | 716 } |
| 716 } | 717 } |
| 717 NOTREACHED(); | 718 NOTREACHED(); |
| 718 } | 719 } |
| 719 | 720 |
| 720 } // namespace ws | 721 } // namespace ws |
| 721 } // namespace ui | 722 } // namespace ui |
| OLD | NEW |