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

Side by Side Diff: views/widget/root_view.cc

Issue 7540002: Fix a few issues with touch-events and views-desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « views/widget/native_widget_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/widget/root_view.h" 5 #include "views/widget/root_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 MouseWheelEvent e(event, this); 360 MouseWheelEvent e(event, this);
361 bool consumed = false; 361 bool consumed = false;
362 View* v = GetFocusManager()->GetFocusedView(); 362 View* v = GetFocusManager()->GetFocusedView();
363 for (; v && v != this && !consumed; v = v->parent()) 363 for (; v && v != this && !consumed; v = v->parent())
364 consumed = v->OnMouseWheel(e); 364 consumed = v->OnMouseWheel(e);
365 return consumed; 365 return consumed;
366 } 366 }
367 367
368 ui::TouchStatus RootView::OnTouchEvent(const TouchEvent& event) { 368 ui::TouchStatus RootView::OnTouchEvent(const TouchEvent& event) {
369 TouchEvent e(event, this); 369 TouchEvent e(event, this);
370 if (capture_view_) {
371 TouchEvent ce(e, this, capture_view_);
372 return capture_view_->OnTouchEvent(ce);
373 }
370 374
371 // If touch_pressed_handler_ is non null, we are currently processing 375 // If touch_pressed_handler_ is non null, we are currently processing
372 // a touch down on the screen situation. In that case we send the 376 // a touch down on the screen situation. In that case we send the
373 // event to touch_pressed_handler_ 377 // event to touch_pressed_handler_
374 ui::TouchStatus status = ui::TOUCH_STATUS_UNKNOWN; 378 ui::TouchStatus status = ui::TOUCH_STATUS_UNKNOWN;
375 379
376 if (touch_pressed_handler_) { 380 if (touch_pressed_handler_) {
377 TouchEvent touch_event(e, this, touch_pressed_handler_); 381 TouchEvent touch_event(e, this, touch_pressed_handler_);
378 status = touch_pressed_handler_->ProcessTouchEvent(touch_event); 382 status = touch_pressed_handler_->ProcessTouchEvent(touch_event);
379 if (gesture_manager_->ProcessTouchEventForGesture(e, this, status)) 383 if (gesture_manager_->ProcessTouchEventForGesture(e, this, status))
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 500
497 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) { 501 void RootView::SetMouseLocationAndFlags(const MouseEvent& event) {
498 last_mouse_event_flags_ = event.flags(); 502 last_mouse_event_flags_ = event.flags();
499 last_mouse_event_x_ = event.x(); 503 last_mouse_event_x_ = event.x();
500 last_mouse_event_y_ = event.y(); 504 last_mouse_event_y_ = event.y();
501 } 505 }
502 506
503 } // namespace internal 507 } // namespace internal
504 } // namespace views 508 } // namespace views
505 509
OLDNEW
« no previous file with comments | « views/widget/native_widget_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698