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

Side by Side Diff: ash/wm/immersive_fullscreen_controller.cc

Issue 2256343003: Update ui::PointerEvent to support mouse wheel and capture change events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/wm/immersive_fullscreen_controller.h" 5 #include "ash/wm/immersive_fullscreen_controller.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "ash/common/ash_constants.h" 9 #include "ash/common/ash_constants.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 break; 268 break;
269 default: 269 default:
270 break; 270 break;
271 } 271 }
272 } 272 }
273 273
274 void ImmersiveFullscreenController::OnPointerEventObserved( 274 void ImmersiveFullscreenController::OnPointerEventObserved(
275 const ui::PointerEvent& event, 275 const ui::PointerEvent& event,
276 const gfx::Point& location_in_screen, 276 const gfx::Point& location_in_screen,
277 views::Widget* target) { 277 views::Widget* target) {
278 if (event.IsMousePointerEvent()) { 278 if (event.type() == ui::ET_POINTER_CAPTURE_CHANGED) {
279 const ui::MouseEvent event(ui::ET_MOUSE_CAPTURE_CHANGED, gfx::Point(),
280 gfx::Point(), ui::EventTimeForNow(), 0, 0);
281 OnMouseEvent(event, display::Screen::GetScreen()->GetCursorScreenPoint(),
282 nullptr);
sadrul 2016/08/19 04:18:27 Do you need this special block? You have already u
riajiang 2016/08/19 16:19:39 Removed. I was not getting the right target and lo
283 } else if (event.IsMousePointerEvent()) {
279 const ui::MouseEvent mouse_event(event); 284 const ui::MouseEvent mouse_event(event);
280 OnMouseEvent(mouse_event, location_in_screen, target); 285 OnMouseEvent(mouse_event, location_in_screen, target);
281 } else { 286 } else {
282 DCHECK(event.IsTouchPointerEvent()); 287 DCHECK(event.IsTouchPointerEvent());
283 const ui::TouchEvent touch_event(event); 288 const ui::TouchEvent touch_event(event);
284 OnTouchEvent(touch_event, location_in_screen); 289 OnTouchEvent(touch_event, location_in_screen);
285 } 290 }
286 } 291 }
287 292
288 void ImmersiveFullscreenController::OnMouseCaptureChanged() {
289 const ui::MouseEvent event(ui::ET_MOUSE_CAPTURE_CHANGED, gfx::Point(),
290 gfx::Point(), ui::EventTimeForNow(), 0, 0);
291 OnMouseEvent(event, display::Screen::GetScreen()->GetCursorScreenPoint(),
292 nullptr);
293 }
294
295 //////////////////////////////////////////////////////////////////////////////// 293 ////////////////////////////////////////////////////////////////////////////////
296 // views::WidgetObserver overrides: 294 // views::WidgetObserver overrides:
297 295
298 void ImmersiveFullscreenController::OnWidgetDestroying(views::Widget* widget) { 296 void ImmersiveFullscreenController::OnWidgetDestroying(views::Widget* widget) {
299 EnableWindowObservers(false); 297 EnableWindowObservers(false);
300 widget_window_ = nullptr; 298 widget_window_ = nullptr;
301 299
302 // Set |enabled_| to false such that any calls to MaybeStartReveal() and 300 // Set |enabled_| to false such that any calls to MaybeStartReveal() and
303 // MaybeEndReveal() have no effect. 301 // MaybeEndReveal() have no effect.
304 enabled_ = false; 302 enabled_ = false;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 // another screen in an extended desktop). 677 // another screen in an extended desktop).
680 gfx::Rect screen_bounds = 678 gfx::Rect screen_bounds =
681 display::Screen::GetScreen()->GetDisplayNearestPoint(location).bounds(); 679 display::Screen::GetScreen()->GetDisplayNearestPoint(location).bounds();
682 return (!screen_bounds.Contains(location) && 680 return (!screen_bounds.Contains(location) &&
683 location.y() < hit_bounds_in_screen.y() && 681 location.y() < hit_bounds_in_screen.y() &&
684 location.x() >= hit_bounds_in_screen.x() && 682 location.x() >= hit_bounds_in_screen.x() &&
685 location.x() < hit_bounds_in_screen.right()); 683 location.x() < hit_bounds_in_screen.right());
686 } 684 }
687 685
688 } // namespace ash 686 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698