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

Side by Side Diff: ui/base/events/event.cc

Issue 10911256: Change the way the ToplevelEventHandler is hooked up. It is now both a pre- and post-target event h… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « ash/wm/workspace/workspace_event_handler.cc ('k') | ui/base/events/event_constants.h » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/base/events/event.h" 5 #include "ui/base/events/event.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #endif 9 #endif
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 float calibrated_y = 46 float calibrated_y =
47 static_cast<float>(point.y()) * to.height() / from.height(); 47 static_cast<float>(point.y()) * to.height() / from.height();
48 return gfx::Point(static_cast<int>(floorf(calibrated_x + 0.5f)), 48 return gfx::Point(static_cast<int>(floorf(calibrated_x + 0.5f)),
49 static_cast<int>(floorf(calibrated_y + 0.5f))); 49 static_cast<int>(floorf(calibrated_y + 0.5f)));
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 namespace ui { 54 namespace ui {
55 55
56 bool EventCanceledDefaultHandling(const ui::Event& event) {
57 return event.phase() == EP_POSTTARGET && event.result() != ER_UNHANDLED;
sadrul 2012/09/12 18:19:33 Right now, the default handler triggers event if o
Ben Goodger (Google) 2012/09/12 18:39:53 But this function won't even be called if event.re
sadrul 2012/09/12 18:47:36 Ah yes. For CONSUMED, this wouldn't be called at a
58 }
59
56 //////////////////////////////////////////////////////////////////////////////// 60 ////////////////////////////////////////////////////////////////////////////////
57 // Event 61 // Event
58 62
59 Event::~Event() { 63 Event::~Event() {
60 #if defined(USE_X11) 64 #if defined(USE_X11)
61 if (delete_native_event_) 65 if (delete_native_event_)
62 delete native_event_; 66 delete native_event_;
63 #endif 67 #endif
64 } 68 }
65 69
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 int GestureEvent::GetLowestTouchId() const { 519 int GestureEvent::GetLowestTouchId() const {
516 if (touch_ids_bitfield_ == 0) 520 if (touch_ids_bitfield_ == 0)
517 return -1; 521 return -1;
518 int i = -1; 522 int i = -1;
519 // Find the index of the least significant 1 bit 523 // Find the index of the least significant 1 bit
520 while (!(1 << ++i & touch_ids_bitfield_)); 524 while (!(1 << ++i & touch_ids_bitfield_));
521 return i; 525 return i;
522 } 526 }
523 527
524 } // namespace ui 528 } // namespace ui
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_event_handler.cc ('k') | ui/base/events/event_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698