diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 18:05:25 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 18:05:25 +0000 |
commit | ca70609833412dd0cdc758724a92681474d62ee2 (patch) | |
tree | 3f101230764f644cd1c0a2b7cb52aa556991aa82 /ui/base | |
parent | cb3221b804cdad65aaade7faff1f612644dee4a3 (diff) | |
download | chromium_src-ca70609833412dd0cdc758724a92681474d62ee2.zip chromium_src-ca70609833412dd0cdc758724a92681474d62ee2.tar.gz chromium_src-ca70609833412dd0cdc758724a92681474d62ee2.tar.bz2 |
Convert Aura to use ui::Event.
http://crbug.com/125937
TEST=existing
Review URL: https://chromiumcodereview.appspot.com/10827145
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/event.cc | 11 | ||||
-rw-r--r-- | ui/base/event.h | 9 |
2 files changed, 14 insertions, 6 deletions
diff --git a/ui/base/event.cc b/ui/base/event.cc index 1433f02..b25c09a 100644 --- a/ui/base/event.cc +++ b/ui/base/event.cc @@ -106,6 +106,12 @@ LocatedEvent::LocatedEvent(EventType type, root_location_(root_location) { } +LocatedEvent::LocatedEvent(const LocatedEvent& model) + : Event(model), + location_(model.location_), + root_location_(model.root_location_) { +} + void LocatedEvent::UpdateForRootTransform(const Transform& root_transform) { // Transform has to be done at root level. DCHECK_EQ(root_location_.x(), location_.x()); @@ -168,7 +174,7 @@ int MouseEvent::GetRepeatCount(const MouseEvent& event) { click_count = last_click_event_->GetClickCount() + 1; delete last_click_event_; } - last_click_event_ = new MouseEvent(event.native_event()); + last_click_event_ = new MouseEvent(event); if (click_count > 3) click_count = 3; last_click_event_->SetClickCount(click_count); @@ -215,6 +221,9 @@ void MouseEvent::SetClickCount(int click_count) { set_flags(f); } +MouseEvent::MouseEvent(const MouseEvent& model) : LocatedEvent(model) { +} + TouchEventImpl::TouchEventImpl(const base::NativeEvent& native_event) : LocatedEvent(native_event), touch_id_(ui::GetTouchId(native_event)), diff --git a/ui/base/event.h b/ui/base/event.h index 1e20fa1..86d5488 100644 --- a/ui/base/event.h +++ b/ui/base/event.h @@ -132,12 +132,11 @@ class UI_EXPORT LocatedEvent : public Event { const gfx::Point& root_location, int flags); + LocatedEvent(const LocatedEvent& model); + gfx::Point location_; gfx::Point root_location_; - - private: - DISALLOW_COPY_AND_ASSIGN(LocatedEvent); }; class UI_EXPORT MouseEvent : public LocatedEvent { @@ -183,14 +182,14 @@ class UI_EXPORT MouseEvent : public LocatedEvent { void SetClickCount(int click_count); private: + explicit MouseEvent(const MouseEvent& model); + gfx::Point root_location_; static MouseEvent* last_click_event_; // Returns the repeat count based on the previous mouse click, if it is // recent enough and within a small enough distance. static int GetRepeatCount(const MouseEvent& click_event); - - DISALLOW_COPY_AND_ASSIGN(MouseEvent); }; // TODO(beng): rename to TouchEvent after conversion is complete. |