| 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/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
| 10 #include "components/exo/pointer_delegate.h" | 10 #include "components/exo/pointer_delegate.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 gfx::NativeCursor Pointer::GetCursor() { | 133 gfx::NativeCursor Pointer::GetCursor() { |
| 134 return cursor_; | 134 return cursor_; |
| 135 } | 135 } |
| 136 | 136 |
| 137 //////////////////////////////////////////////////////////////////////////////// | 137 //////////////////////////////////////////////////////////////////////////////// |
| 138 // ui::EventHandler overrides: | 138 // ui::EventHandler overrides: |
| 139 | 139 |
| 140 void Pointer::OnMouseEvent(ui::MouseEvent* event) { | 140 void Pointer::OnMouseEvent(ui::MouseEvent* event) { |
| 141 Surface* target = GetEffectiveTargetForEvent(event); | 141 Surface* target = GetEffectiveTargetForEvent(event); |
| 142 | 142 |
| 143 if (event->flags() & ui::EF_TOUCH_ACCESSIBILITY) | |
| 144 return; | |
| 145 | |
| 146 // If target is different than the current pointer focus then we need to | 143 // If target is different than the current pointer focus then we need to |
| 147 // generate enter and leave events. | 144 // generate enter and leave events. |
| 148 if (target != focus_) { | 145 if (target != focus_) { |
| 149 // First generate a leave event if we currently have a target in focus. | 146 // First generate a leave event if we currently have a target in focus. |
| 150 if (focus_) { | 147 if (focus_) { |
| 151 delegate_->OnPointerLeave(focus_); | 148 delegate_->OnPointerLeave(focus_); |
| 152 focus_->RemoveSurfaceObserver(this); | 149 focus_->RemoveSurfaceObserver(this); |
| 153 // Require SetCursor() to be called and cursor to be re-defined in | 150 // Require SetCursor() to be called and cursor to be re-defined in |
| 154 // response to each OnPointerEnter() call. | 151 // response to each OnPointerEnter() call. |
| 155 focus_->UnregisterCursorProvider(this); | 152 focus_->UnregisterCursorProvider(this); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 void Pointer::UpdateCursor() { | 377 void Pointer::UpdateCursor() { |
| 381 DCHECK(focus_); | 378 DCHECK(focus_); |
| 382 | 379 |
| 383 aura::client::CursorClient* cursor_client = | 380 aura::client::CursorClient* cursor_client = |
| 384 aura::client::GetCursorClient(focus_->window()->GetRootWindow()); | 381 aura::client::GetCursorClient(focus_->window()->GetRootWindow()); |
| 385 if (cursor_client) | 382 if (cursor_client) |
| 386 cursor_client->SetCursor(cursor_); | 383 cursor_client->SetCursor(cursor_); |
| 387 } | 384 } |
| 388 | 385 |
| 389 } // namespace exo | 386 } // namespace exo |
| OLD | NEW |