Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Issue 6880201: Scrap WNDCLASSEX.hCursor, update GetCursorForPoint, etc. (Closed)

Created:
9 years, 8 months ago by msw
Modified:
9 years, 7 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, nkostylev+cc_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

Scrap WNDCLASSEX.hCursor, update GetCursorForPoint. Default to Win arrow in View::GetCursorForPoint & RootView::UpdateCursor. Simplify WidgetWin::SetCursor, avoid sending NULL. Only SetCuror on client events (DWM handles non-client). RIP TextButtonWithHandCursorOver (r57652 through r64531). RIP WindowWin::InitClass & |resize_cursors_|. Add OVERRIDE specifiers liberally. BUG=35356 TEST=Cursor styles shown in Win & Linux toolkit_views. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=83123

Patch Set 1 #

Patch Set 2 : Nix WindowWin cursors; only SetCuror on client events; add RootView::UpdateCursor Win arrow default. #

Total comments: 8

Patch Set 3 : Use brace style struct init for WNDCLASSEX |class_ex|, fix comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -144 lines) Patch
M chrome/browser/chromeos/login/background_view.cc View 1 2 1 chunk +0 lines, -24 lines 0 comments Download
M chrome/browser/chromeos/login/shutdown_button.h View 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/login/shutdown_button.cc View 2 chunks +4 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/login/user_view.h View 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/user_view.cc View 4 chunks +7 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/login/username_view.h View 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/login/username_view.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/content_setting_bubble_contents.cc View 3 chunks +1 line, -10 lines 0 comments Download
M ui/base/win/window_impl.cc View 1 2 1 chunk +16 lines, -13 lines 0 comments Download
M views/controls/link.h View 1 chunk +3 lines, -3 lines 0 comments Download
M views/controls/link.cc View 3 chunks +4 lines, -9 lines 0 comments Download
M views/controls/resize_area.cc View 2 chunks +1 line, -6 lines 0 comments Download
M views/controls/textfield/native_textfield_views.h View 1 chunk +1 line, -1 line 0 comments Download
M views/view.h View 1 2 1 chunk +5 lines, -6 lines 0 comments Download
M views/view.cc View 1 chunk +6 lines, -1 line 0 comments Download
M views/widget/root_view.cc View 1 2 chunks +11 lines, -4 lines 0 comments Download
M views/widget/widget_win.h View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M views/widget/widget_win.cc View 1 2 2 chunks +1 line, -7 lines 0 comments Download
M views/window/window_win.h View 1 2 1 chunk +0 lines, -7 lines 0 comments Download
M views/window/window_win.cc View 1 2 3 chunks +0 lines, -15 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
msw
Hey Peter, can you review this? Should I include anyone else? It might be beneficial ...
9 years, 8 months ago (2011-04-26 22:08:39 UTC) #1
Peter Kasting
LGTM http://codereview.chromium.org/6880201/diff/2001/ui/base/win/window_impl.cc File ui/base/win/window_impl.cc (right): http://codereview.chromium.org/6880201/diff/2001/ui/base/win/window_impl.cc#newcode201 ui/base/win/window_impl.cc:201: WNDCLASSEX class_ex; Nit: Does it make sense to ...
9 years, 8 months ago (2011-04-27 00:22:12 UTC) #2
msw
9 years, 8 months ago (2011-04-27 01:58:03 UTC) #3
Thanks, comments addressed; landing after clean try.

http://codereview.chromium.org/6880201/diff/2001/ui/base/win/window_impl.cc
File ui/base/win/window_impl.cc (right):

http://codereview.chromium.org/6880201/diff/2001/ui/base/win/window_impl.cc#n...
ui/base/win/window_impl.cc:201: WNDCLASSEX class_ex;
On 2011/04/27 00:22:12, Peter Kasting wrote:
> Nit: Does it make sense to use array initializer style (= {...}) here?

Done. Seems like no comments is the most comment pattern.

http://codereview.chromium.org/6880201/diff/2001/views/controls/link.h
File views/controls/link.h (right):

http://codereview.chromium.org/6880201/diff/2001/views/controls/link.h#newcode47
views/controls/link.h:47: virtual void SetEnabled(bool flag) OVERRIDE;
On 2011/04/27 00:22:12, Peter Kasting wrote:
> Nit: |flag | is better than |f|.  |enabled| might be even better.

I'm following the base definition; I think that's optimal, short of changing all
occurrences to |enabled|.

http://codereview.chromium.org/6880201/diff/2001/views/view.h
File views/view.h (left):

http://codereview.chromium.org/6880201/diff/2001/views/view.h#oldcode586
views/view.h:586: // Return the cursor that should be used for this view or NULL
if
On 2011/04/27 00:22:12, Peter Kasting wrote:
> Nit: This still can return NULL in some cases.  Should this sentence have been
> left as-is?

With native cursor types, NULL should be used explicitly to mean:
WIN: "the cursor is removed from the screen"
http://msdn.microsoft.com/en-us/library/ms648393(v=vs.85).aspx
GDK: "use the cursor of its parent window"
http://developer.gnome.org/gdk/stable/gdk-Windows.html#gdk-window-set-cursor

I nixed the behavior that replaced NULL with default/|previous_cursor_| from
WidgetWin, and WidgetGtk seemingly already uses the native behavior.

We ought to eventually create a cross platform cursor type/enum.

http://codereview.chromium.org/6880201/diff/2001/views/view.h
File views/view.h (right):

http://codereview.chromium.org/6880201/diff/2001/views/view.h#newcode590
views/view.h:590: //shared resource but Gtk destroys the returned cursor after
setting it.
On 2011/04/27 00:22:12, Peter Kasting wrote:
> Nit: Initial space; comma after "resource"

Done.

Powered by Google App Engine
This is Rietveld 408576698