| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 } | 231 } |
| 232 | 232 |
| 233 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { | 233 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { |
| 234 OnMouseEvent(event); | 234 OnMouseEvent(event); |
| 235 } | 235 } |
| 236 | 236 |
| 237 //////////////////////////////////////////////////////////////////////////////// | 237 //////////////////////////////////////////////////////////////////////////////// |
| 238 // SurfaceDelegate overrides: | 238 // SurfaceDelegate overrides: |
| 239 | 239 |
| 240 void Pointer::OnSurfaceCommit() { | 240 void Pointer::OnSurfaceCommit() { |
| 241 surface_->CheckForCommittingToNewSurface(); |
| 241 surface_->CommitSurfaceHierarchy(); | 242 surface_->CommitSurfaceHierarchy(); |
| 242 surface_->SetBounds(gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(), | 243 surface_->SetBounds(gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(), |
| 243 surface_->layer()->size())); | 244 surface_->layer()->size())); |
| 244 } | 245 } |
| 245 | 246 |
| 246 bool Pointer::IsSurfaceSynchronized() const { | 247 bool Pointer::IsSurfaceSynchronized() const { |
| 247 // A pointer surface is always desynchronized. | 248 // A pointer surface is always desynchronized. |
| 248 return false; | 249 return false; |
| 249 } | 250 } |
| 250 | 251 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const { | 285 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const { |
| 285 Surface* target = | 286 Surface* target = |
| 286 Surface::AsSurface(static_cast<aura::Window*>(event->target())); | 287 Surface::AsSurface(static_cast<aura::Window*>(event->target())); |
| 287 if (!target) | 288 if (!target) |
| 288 return nullptr; | 289 return nullptr; |
| 289 | 290 |
| 290 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr; | 291 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr; |
| 291 } | 292 } |
| 292 | 293 |
| 293 } // namespace exo | 294 } // namespace exo |
| OLD | NEW |