| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/pointer.h" | 5 #include "components/exo/pointer.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
| 8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 233 } |
| 234 | 234 |
| 235 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { | 235 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { |
| 236 OnMouseEvent(event); | 236 OnMouseEvent(event); |
| 237 } | 237 } |
| 238 | 238 |
| 239 //////////////////////////////////////////////////////////////////////////////// | 239 //////////////////////////////////////////////////////////////////////////////// |
| 240 // SurfaceDelegate overrides: | 240 // SurfaceDelegate overrides: |
| 241 | 241 |
| 242 void Pointer::OnSurfaceCommit() { | 242 void Pointer::OnSurfaceCommit() { |
| 243 surface_->CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces(); |
| 243 surface_->CommitSurfaceHierarchy(); | 244 surface_->CommitSurfaceHierarchy(); |
| 244 surface_->window()->SetBounds( | 245 surface_->window()->SetBounds( |
| 245 gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(), | 246 gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(), |
| 246 surface_->window()->layer()->size())); | 247 surface_->window()->layer()->size())); |
| 247 } | 248 } |
| 248 | 249 |
| 249 bool Pointer::IsSurfaceSynchronized() const { | 250 bool Pointer::IsSurfaceSynchronized() const { |
| 250 // A pointer surface is always desynchronized. | 251 // A pointer surface is always desynchronized. |
| 251 return false; | 252 return false; |
| 252 } | 253 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const { | 288 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const { |
| 288 Surface* target = | 289 Surface* target = |
| 289 Surface::AsSurface(static_cast<aura::Window*>(event->target())); | 290 Surface::AsSurface(static_cast<aura::Window*>(event->target())); |
| 290 if (!target) | 291 if (!target) |
| 291 return nullptr; | 292 return nullptr; |
| 292 | 293 |
| 293 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr; | 294 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr; |
| 294 } | 295 } |
| 295 | 296 |
| 296 } // namespace exo | 297 } // namespace exo |
| OLD | NEW |