Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: components/exo/pointer.cc

Issue 2127263002: Keep the SystemModalContainerEventHandler added (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ignore touch/pointer events on Arc windows if modal open Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698