| 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/display/display_info.h" | 7 #include "ash/common/display/display_info.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 cursor_client->SetCursor( | 118 cursor_client->SetCursor( |
| 119 focus_->window()->GetCursor(gfx::ToFlooredPoint(location_))); | 119 focus_->window()->GetCursor(gfx::ToFlooredPoint(location_))); |
| 120 } | 120 } |
| 121 | 121 |
| 122 //////////////////////////////////////////////////////////////////////////////// | 122 //////////////////////////////////////////////////////////////////////////////// |
| 123 // ui::EventHandler overrides: | 123 // ui::EventHandler overrides: |
| 124 | 124 |
| 125 void Pointer::OnMouseEvent(ui::MouseEvent* event) { | 125 void Pointer::OnMouseEvent(ui::MouseEvent* event) { |
| 126 Surface* target = GetEffectiveTargetForEvent(event); | 126 Surface* target = GetEffectiveTargetForEvent(event); |
| 127 | 127 |
| 128 if (!ash::Shell::GetInstance()->CanWindowReceiveEvents( |
| 129 static_cast<aura::Window*>(event->target()))) { |
| 130 event->StopPropagation(); |
| 131 return; |
| 132 } |
| 133 |
| 128 // If target is different than the current pointer focus then we need to | 134 // If target is different than the current pointer focus then we need to |
| 129 // generate enter and leave events. | 135 // generate enter and leave events. |
| 130 if (target != focus_) { | 136 if (target != focus_) { |
| 131 // First generate a leave event if we currently have a target in focus. | 137 // First generate a leave event if we currently have a target in focus. |
| 132 if (focus_) { | 138 if (focus_) { |
| 133 delegate_->OnPointerLeave(focus_); | 139 delegate_->OnPointerLeave(focus_); |
| 134 focus_->RemoveSurfaceObserver(this); | 140 focus_->RemoveSurfaceObserver(this); |
| 135 // Require SetCursor() to be called and cursor to be re-defined in | 141 // Require SetCursor() to be called and cursor to be re-defined in |
| 136 // response to each OnPointerEnter() call. | 142 // response to each OnPointerEnter() call. |
| 137 focus_->UnregisterCursorProvider(this); | 143 focus_->UnregisterCursorProvider(this); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 320 |
| 315 if (ui_scale != cursor_scale_) { | 321 if (ui_scale != cursor_scale_) { |
| 316 gfx::Transform transform; | 322 gfx::Transform transform; |
| 317 transform.Scale(ui_scale, ui_scale); | 323 transform.Scale(ui_scale, ui_scale); |
| 318 widget_->GetNativeWindow()->SetTransform(transform); | 324 widget_->GetNativeWindow()->SetTransform(transform); |
| 319 cursor_scale_ = ui_scale; | 325 cursor_scale_ = ui_scale; |
| 320 } | 326 } |
| 321 } | 327 } |
| 322 | 328 |
| 323 } // namespace exo | 329 } // namespace exo |
| OLD | NEW |