diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 05:41:09 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 05:41:09 +0000 |
commit | a52ca4671f27eb2eae418eecea0e5db58ff7bf08 (patch) | |
tree | c1a1c922e2eba3ee67750b6a62837741ac5311b3 /views/widget | |
parent | 848cd2743e2c4135976acf975b15e6f3c18edf8c (diff) | |
download | chromium_src-a52ca4671f27eb2eae418eecea0e5db58ff7bf08.zip chromium_src-a52ca4671f27eb2eae418eecea0e5db58ff7bf08.tar.gz chromium_src-a52ca4671f27eb2eae418eecea0e5db58ff7bf08.tar.bz2 |
Implement some basic functionality in RootView and View.
Review URL: http://codereview.chromium.org/119231
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17714 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r-- | views/widget/root_view.cc | 11 | ||||
-rw-r--r-- | views/widget/root_view_gtk.cc | 4 | ||||
-rw-r--r-- | views/widget/root_view_win.cc | 17 |
3 files changed, 11 insertions, 21 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc index 08b7e6e..df11d3e 100644 --- a/views/widget/root_view.cc +++ b/views/widget/root_view.cc @@ -408,6 +408,17 @@ bool RootView::ConvertPointToMouseHandler(const gfx::Point& l, return true; } +void RootView::UpdateCursor(const MouseEvent& e) { + gfx::NativeCursor cursor = NULL; + View* v = GetViewForPoint(e.location()); + if (v && v != this) { + gfx::Point l(e.location()); + View::ConvertPointToView(this, v, &l); + cursor = v->GetCursorForPoint(e.GetType(), l.x(), l.y()); + } + SetActiveCursor(cursor); +} + bool RootView::OnMouseDragged(const MouseEvent& e) { UpdateCursor(e); diff --git a/views/widget/root_view_gtk.cc b/views/widget/root_view_gtk.cc index 9010960..5c02a71 100644 --- a/views/widget/root_view_gtk.cc +++ b/views/widget/root_view_gtk.cc @@ -12,10 +12,6 @@ namespace views { -void RootView::UpdateCursor(const MouseEvent& e) { - NOTIMPLEMENTED(); -} - void RootView::OnPaint(GdkEventExpose* event) { gfx::CanvasPaint canvas(event); diff --git a/views/widget/root_view_win.cc b/views/widget/root_view_win.cc index 14ca68a6..f5b315cb 100644 --- a/views/widget/root_view_win.cc +++ b/views/widget/root_view_win.cc @@ -12,23 +12,6 @@ namespace views { -void RootView::UpdateCursor(const MouseEvent& e) { - View *v = GetViewForPoint(e.location()); - - if (v && v != this) { - gfx::Point l(e.location()); - View::ConvertPointToView(this, v, &l); - HCURSOR cursor = v->GetCursorForPoint(e.GetType(), l.x(), l.y()); - if (cursor) { - ::SetCursor(cursor); - return; - } - } - if (previous_cursor_) { - SetCursor(previous_cursor_); - } -} - void RootView::OnPaint(HWND hwnd) { gfx::Rect original_dirty_region = GetScheduledPaintRectConstrainedToSize(); if (!original_dirty_region.IsEmpty()) { |