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

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

Issue 23503086: Move DropTargetEvent back to ui/base for the time being as it depends on OSExchangeData which I don… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows bustage Created 7 years, 2 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 | « ui/events/event.h ('k') | ui/events/event_unittest.cc » ('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/events/event.h" 5 #include "ui/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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 flags, 671 flags,
672 false) { 672 false) {
673 } 673 }
674 674
675 void TranslatedKeyEvent::ConvertToKeyEvent() { 675 void TranslatedKeyEvent::ConvertToKeyEvent() {
676 SetType(type() == ET_TRANSLATED_KEY_PRESS ? 676 SetType(type() == ET_TRANSLATED_KEY_PRESS ?
677 ET_KEY_PRESSED : ET_KEY_RELEASED); 677 ET_KEY_PRESSED : ET_KEY_RELEASED);
678 } 678 }
679 679
680 //////////////////////////////////////////////////////////////////////////////// 680 ////////////////////////////////////////////////////////////////////////////////
681 // DropTargetEvent
682
683 DropTargetEvent::DropTargetEvent(const OSExchangeData& data,
684 const gfx::Point& location,
685 const gfx::Point& root_location,
686 int source_operations)
687 : LocatedEvent(ET_DROP_TARGET_EVENT,
688 location,
689 root_location,
690 EventTimeForNow(),
691 0),
692 data_(data),
693 source_operations_(source_operations) {
694 }
695
696 ////////////////////////////////////////////////////////////////////////////////
697 // ScrollEvent 681 // ScrollEvent
698 682
699 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) 683 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event)
700 : MouseEvent(native_event) { 684 : MouseEvent(native_event) {
701 if (type() == ET_SCROLL) { 685 if (type() == ET_SCROLL) {
702 GetScrollOffsets(native_event, 686 GetScrollOffsets(native_event,
703 &x_offset_, &y_offset_, 687 &x_offset_, &y_offset_,
704 &x_offset_ordinal_, &y_offset_ordinal_, 688 &x_offset_ordinal_, &y_offset_ordinal_,
705 &finger_count_); 689 &finger_count_);
706 } else if (type() == ET_SCROLL_FLING_START || 690 } else if (type() == ET_SCROLL_FLING_START ||
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 int GestureEvent::GetLowestTouchId() const { 762 int GestureEvent::GetLowestTouchId() const {
779 if (touch_ids_bitfield_ == 0) 763 if (touch_ids_bitfield_ == 0)
780 return -1; 764 return -1;
781 int i = -1; 765 int i = -1;
782 // Find the index of the least significant 1 bit 766 // Find the index of the least significant 1 bit
783 while (!(1 << ++i & touch_ids_bitfield_)); 767 while (!(1 << ++i & touch_ids_bitfield_));
784 return i; 768 return i;
785 } 769 }
786 770
787 } // namespace ui 771 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698