| 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/user_display_manager.h" | 5 #include "services/ui/ws/user_display_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "services/ui/ws/display.h" | 9 #include "services/ui/ws/display.h" |
| 10 #include "services/ui/ws/display_manager.h" | 10 #include "services/ui/ws/display_manager.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 mojo::InterfaceRequest<mojom::DisplayManager> request) { | 48 mojo::InterfaceRequest<mojom::DisplayManager> request) { |
| 49 display_manager_bindings_.AddBinding(this, std::move(request)); | 49 display_manager_bindings_.AddBinding(this, std::move(request)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void UserDisplayManager::OnWillDestroyDisplay(Display* display) { | 52 void UserDisplayManager::OnWillDestroyDisplay(Display* display) { |
| 53 if (!got_valid_frame_decorations_) | 53 if (!got_valid_frame_decorations_) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 display_manager_observers_.ForAllPtrs( | 56 display_manager_observers_.ForAllPtrs( |
| 57 [this, &display](mojom::DisplayManagerObserver* observer) { | 57 [this, &display](mojom::DisplayManagerObserver* observer) { |
| 58 observer->OnDisplayRemoved(display->id()); | 58 observer->OnDisplayRemoved(display->GetId()); |
| 59 }); | 59 }); |
| 60 if (test_observer_) | 60 if (test_observer_) |
| 61 test_observer_->OnDisplayRemoved(display->id()); | 61 test_observer_->OnDisplayRemoved(display->GetId()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void UserDisplayManager::OnMouseCursorLocationChanged(const gfx::Point& point) { | 64 void UserDisplayManager::OnMouseCursorLocationChanged(const gfx::Point& point) { |
| 65 current_cursor_location_ = | 65 current_cursor_location_ = |
| 66 static_cast<base::subtle::Atomic32>( | 66 static_cast<base::subtle::Atomic32>( |
| 67 (point.x() & 0xFFFF) << 16 | (point.y() & 0xFFFF)); | 67 (point.x() & 0xFFFF) << 16 | (point.y() & 0xFFFF)); |
| 68 if (cursor_location_memory()) { | 68 if (cursor_location_memory()) { |
| 69 base::subtle::NoBarrier_Store(cursor_location_memory(), | 69 base::subtle::NoBarrier_Store(cursor_location_memory(), |
| 70 current_cursor_location_); | 70 current_cursor_location_); |
| 71 } | 71 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 void UserDisplayManager::AddObserver( | 145 void UserDisplayManager::AddObserver( |
| 146 mojom::DisplayManagerObserverPtr observer) { | 146 mojom::DisplayManagerObserverPtr observer) { |
| 147 mojom::DisplayManagerObserver* observer_impl = observer.get(); | 147 mojom::DisplayManagerObserver* observer_impl = observer.get(); |
| 148 display_manager_observers_.AddPtr(std::move(observer)); | 148 display_manager_observers_.AddPtr(std::move(observer)); |
| 149 OnObserverAdded(observer_impl); | 149 OnObserverAdded(observer_impl); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace ws | 152 } // namespace ws |
| 153 } // namespace ui | 153 } // namespace ui |
| OLD | NEW |