diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 21:56:13 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-24 21:56:13 +0000 |
commit | 1aaa601fcf5c6199dbc32c8c7488ba1b55c7d81c (patch) | |
tree | a5ea9976c982289323ba344331bc85c480144e20 /chrome | |
parent | d2faab5a2a86a29787a8a3420e85a58e4739000e (diff) | |
download | chromium_src-1aaa601fcf5c6199dbc32c8c7488ba1b55c7d81c.zip chromium_src-1aaa601fcf5c6199dbc32c8c7488ba1b55c7d81c.tar.gz chromium_src-1aaa601fcf5c6199dbc32c8c7488ba1b55c7d81c.tar.bz2 |
Porting POINT to gfx::Point for automation provider
BUG=None
TEST=None
Patch by tfarina
Original Review: http://codereview.chromium.org/155888
Review URL: http://codereview.chromium.org/160088
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21588 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 16 | ||||
-rw-r--r-- | chrome/browser/automation/automation_provider.h | 9 |
2 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 1ce2c87..52ef8e9 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1479,8 +1479,7 @@ void AutomationProvider::WindowGetViewBounds(int handle, int view_id, #endif } -#if defined(OS_WIN) -// TODO(port): Use portable replacement for POINT. +#if defined(TOOLKIT_VIEWS) // 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. @@ -1488,20 +1487,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); ::SetCursorPos(screen_location.x(), screen_location.y()); switch (type_) { @@ -1525,7 +1524,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); @@ -1533,12 +1532,13 @@ 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) + +#endif // defined(TOOLKIT_VIEWS) // This task just adds another task to the event queue. This is useful if // you want to ensure that any tasks added to the event queue after this one diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index c28cb1c..abba77a 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -17,6 +17,7 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" +#include "base/gfx/point.h" #include "chrome/browser/automation/automation_autocomplete_edit_tracker.h" #include "chrome/browser/automation/automation_browser_tracker.h" #include "chrome/browser/automation/automation_resource_message_filter.h" @@ -219,13 +220,13 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, void SetFilteredInet(const IPC::Message& message, bool enabled); void SetProxyConfig(const std::string& new_proxy_config); -#if defined(OS_WIN) - // TODO(port): Replace POINT. +#if defined(TOOLKIT_VIEWS) void ScheduleMouseEvent(views::View* view, views::Event::EventType type, - POINT point, + const gfx::Point& point, int flags); -#endif // defined(OS_WIN) +#endif // defined(TOOLKIT_VIEWS) + void GetFocusedViewID(int handle, int* view_id); // Helper function to find the browser window that contains a given |