diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 01:22:58 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 01:22:58 +0000 |
commit | 0e80dfe1bc81e7f13f56f6812a25c04b7947a698 (patch) | |
tree | 96e3a7d8ee07dbc8ca1c586872d8a01d73f4ae2b /chrome/browser/automation | |
parent | 60f1f37451c18b9b0e86264144300da8adb63f65 (diff) | |
download | chromium_src-0e80dfe1bc81e7f13f56f6812a25c04b7947a698.zip chromium_src-0e80dfe1bc81e7f13f56f6812a25c04b7947a698.tar.gz chromium_src-0e80dfe1bc81e7f13f56f6812a25c04b7947a698.tar.bz2 |
Porting POINT to gfx::Point.
Patch from thiago.farnia at gmail.com. Original review url:
http://codereview.chromium.org/155888
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/164121
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 12 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index a8e9004..00fdd13 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1502,7 +1502,6 @@ void AutomationProvider::WindowGetViewBounds(int handle, int view_id, } #if defined(OS_WIN) -// TODO(port): Use portable replacement for POINT. // This task enqueues a mouse event on the event loop, so that the view // that it's being sent to can do the requisite post-processing. @@ -1510,20 +1509,20 @@ class MouseEventTask : public Task { public: MouseEventTask(views::View* view, views::Event::EventType type, - POINT point, + const gfx::Point& point, int flags) : view_(view), type_(type), point_(point), flags_(flags) {} virtual ~MouseEventTask() {} virtual void Run() { - views::MouseEvent event(type_, point_.x, point_.y, flags_); + views::MouseEvent event(type_, point_.x(), point_.y(), flags_); // We need to set the cursor position before we process the event because // some code (tab dragging, for instance) queries the actual cursor location // rather than the location of the mouse event. Note that the reason why // the drag code moved away from using mouse event locations was because // our conversion to screen location doesn't work well with multiple // monitors, so this only works reliably in a single monitor setup. - gfx::Point screen_location(point_.x, point_.y); + gfx::Point screen_location(point_.x(), point_.y()); view_->ConvertPointToScreen(view_, &screen_location); MoveMouse(screen_location.ToPOINT()); switch (type_) { @@ -1547,7 +1546,7 @@ class MouseEventTask : public Task { private: views::View* view_; views::Event::EventType type_; - POINT point_; + gfx::Point point_; int flags_; DISALLOW_COPY_AND_ASSIGN(MouseEventTask); @@ -1555,11 +1554,12 @@ class MouseEventTask : public Task { void AutomationProvider::ScheduleMouseEvent(views::View* view, views::Event::EventType type, - POINT point, + const gfx::Point& point, int flags) { MessageLoop::current()->PostTask(FROM_HERE, new MouseEventTask(view, type, point, flags)); } + #endif // defined(OS_WIN) // This task just adds another task to the event queue. This is useful if diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index 0d9b08c..8a48476 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -46,6 +46,10 @@ class ExternalTabContainer; class ExtensionPortContainer; struct AutocompleteMatchData; +namespace gfx { +class Point; +} + class AutomationProvider : public base::RefCounted<AutomationProvider>, public IPC::Channel::Listener, public IPC::Message::Sender { @@ -221,12 +225,12 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, void SetProxyConfig(const std::string& new_proxy_config); #if defined(OS_WIN) - // TODO(port): Replace POINT. void ScheduleMouseEvent(views::View* view, views::Event::EventType type, - POINT point, + const gfx::Point& point, int flags); #endif // defined(OS_WIN) + void GetFocusedViewID(int handle, int* view_id); // Helper function to find the browser window that contains a given |