diff options
-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 |