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

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)

Created:
3 years, 8 months ago by Elliot Glaysher
Modified:
3 years, 8 months ago
Reviewers:
Tom Sepez, jam, sky
CC:
chromium-reviews, rjkroege, chromium-apps-reviews_chromium.org, sadrul, yusukes+watch_chromium.org, extensions-reviews_chromium.org, shuchen+watch_chromium.org, chromoting-reviews_chromium.org, jam, dcheng, jbauman+watch_chromium.org, nona+watch_chromium.org, tfarina, darin-cc_chromium.org, oshima+watch_chromium.org, piman+watch_chromium.org, kalyank, danakj+watch_chromium.org, James Su, ozone-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Change ui cursor identifiers to an enum class. ui::Cursor used to use ints across the codebase to identify cursors. This patch changes that to an enum class, changes all usages of these constants in chrome, and then creates an EnumTraits mapping of this new enum to the mojo transport enum. This means cursor enums are now validated when they previously were just assumed to be correct. BUG=705037 R=sky,tsepez TBR=jam Review-Url: https://codereview.chromium.org/2833163002 Cr-Commit-Position: refs/heads/master@{#467047} Committed: https://chromium.googlesource.com/chromium/src/+/eeba7c6297fb07e155f3fef779a6ea448be621bd

Patch Set 1 #

Patch Set 2 : And now for something other than chromeos #

Patch Set 3 : unordered_map -> map #

Patch Set 4 : try again #

Patch Set 5 : and again #

Patch Set 6 : and AGAIN #

Patch Set 7 : more changes to cursor_loader_x11.cc #

Patch Set 8 : more #

Patch Set 9 : fix chromeos side of ifdef. #

Patch Set 10 : Fix chromeos x11 tests #

Patch Set 11 : Remove extranious ::ui:: #

Total comments: 6

Patch Set 12 : sky comments / Does this break on mac? #

Patch Set 13 : OK, it can't be explicit for mac. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1120 lines, -770 lines) Patch
M ash/display/cursor_window_controller.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M ash/display/cursor_window_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -4 lines 0 comments Download
M ash/display/cursor_window_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +5 lines, -3 lines 0 comments Download
M ash/display/mirror_window_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +8 lines, -8 lines 0 comments Download
M ash/drag_drop/drag_drop_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -6 lines 0 comments Download
M ash/extended_desktop_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -5 lines 0 comments Download
M ash/mus/move_event_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +9 lines, -9 lines 0 comments Download
M ash/shell.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M ash/test/mirror_window_test_api.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -1 line 0 comments Download
M ash/test/mirror_window_test_api.cc View 1 chunk +1 line, -1 line 0 comments Download
M ash/utility/screenshot_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +5 lines, -5 lines 0 comments Download
M ash/wm/ash_native_cursor_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -4 lines 0 comments Download
M ash/wm/ash_native_cursor_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +12 lines, -10 lines 0 comments Download
M ash/wm/resize_shadow_and_cursor_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +18 lines, -18 lines 0 comments Download
M ash/wm/toplevel_window_event_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M ash/wm/window_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +14 lines, -10 lines 0 comments Download
M components/exo/pointer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +5 lines, -5 lines 0 comments Download
M components/exo/shell_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -9 lines 0 comments Download
M components/exo/surface.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M components/exo/surface.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -3 lines 0 comments Download
M content/common/cursors/webcursor_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +44 lines, -44 lines 0 comments Download
M extensions/shell/browser/shell_desktop_controller_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -2 lines 0 comments Download
M mash/simple_wm/move_event_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +9 lines, -9 lines 0 comments Download
M remoting/host/chromeos/mouse_cursor_monitor_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -3 lines 0 comments Download
M services/ui/public/interfaces/cursor/cursor.mojom View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +47 lines, -47 lines 0 comments Download
M services/ui/public/interfaces/cursor/cursor_struct_traits.h View 1 chunk +8 lines, -2 lines 0 comments Download
M services/ui/public/interfaces/cursor/cursor_struct_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +261 lines, -3 lines 0 comments Download
M services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -3 lines 0 comments Download
M services/ui/ws/cursor_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +35 lines, -35 lines 0 comments Download
M services/ui/ws/display.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -2 lines 0 comments Download
M services/ui/ws/drag_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -4 lines 0 comments Download
M services/ui/ws/drag_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +11 lines, -11 lines 0 comments Download
M services/ui/ws/event_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M services/ui/ws/platform_display_default.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -3 lines 0 comments Download
M services/ui/ws/server_window.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -3 lines 0 comments Download
M services/ui/ws/test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M services/ui/ws/window_manager_state_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M services/ui/ws/window_tree_client_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M services/ui/ws/window_tree_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +28 lines, -28 lines 0 comments Download
M ui/aura/mus/window_port_mus.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/test/test_cursor_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/window_tree_host.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M ui/aura/window_tree_host_platform.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -2 lines 0 comments Download
M ui/aura/window_tree_host_x11.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M ui/base/cursor/cursor.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +62 lines, -61 lines 0 comments Download
M ui/base/cursor/cursor.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -14 lines 0 comments Download
M ui/base/cursor/cursor_data.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +5 lines, -4 lines 0 comments Download
M ui/base/cursor/cursor_data.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -4 lines 0 comments Download
M ui/base/cursor/cursor_loader.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M ui/base/cursor/cursor_loader_ozone.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -3 lines 0 comments Download
M ui/base/cursor/cursor_loader_ozone.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -4 lines 0 comments Download
M ui/base/cursor/cursor_loader_win.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download
M ui/base/cursor/cursor_loader_win.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +48 lines, -48 lines 0 comments Download
M ui/base/cursor/cursor_loader_x11.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -8 lines 0 comments Download
M ui/base/cursor/cursor_loader_x11.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +94 lines, -90 lines 0 comments Download
M ui/base/cursor/cursors_aura.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -5 lines 0 comments Download
M ui/base/cursor/cursors_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +156 lines, -94 lines 0 comments Download
M ui/base/cursor/image_cursors.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +35 lines, -37 lines 0 comments Download
M ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -3 lines 0 comments Download
M ui/base/cursor/ozone/bitmap_cursor_factory_ozone.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -6 lines 0 comments Download
M ui/base/cursor/ozone/cursor_data_factory_ozone.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -3 lines 0 comments Download
M ui/base/cursor/ozone/cursor_data_factory_ozone.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M ui/gfx/native_widget_types.h View 2 chunks +2 lines, -1 line 0 comments Download
M ui/ozone/platform/x11/x11_cursor_factory_ozone.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -4 lines 0 comments Download
M ui/ozone/platform/x11/x11_cursor_factory_ozone.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +6 lines, -6 lines 0 comments Download
M ui/ozone/public/cursor_factory_ozone.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/public/cursor_factory_ozone.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/native/native_view_host_aura_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -3 lines 0 comments Download
M ui/views/mus/desktop_window_tree_host_mus.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M ui/views/native_cursor_aura.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -5 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -8 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_cursor_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -6 lines 0 comments Download
M ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -3 lines 0 comments Download
M ui/wm/core/compound_event_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +9 lines, -9 lines 0 comments Download
M ui/wm/core/cursor_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -3 lines 0 comments Download
M ui/wm/core/cursor_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 63 (55 generated)
Elliot Glaysher
tsepez: cursor_struct_traits.cc. we're now doing validation on the incoming cursor id while we weren't previously. ...
3 years, 8 months ago (2017-04-24 19:53:43 UTC) #41
Tom Sepez
lgtm https://codereview.chromium.org/2833163002/diff/200001/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc File services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc (right): https://codereview.chromium.org/2833163002/diff/200001/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc#newcode50 services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc:50: for (int i = 0; i < 43; ...
3 years, 8 months ago (2017-04-24 20:06:45 UTC) #42
sky
Sorry to bring up the style thing here given how much code you're touching:( https://codereview.chromium.org/2833163002/diff/200001/ui/base/cursor/cursor.h ...
3 years, 8 months ago (2017-04-24 20:12:44 UTC) #43
Elliot Glaysher
https://codereview.chromium.org/2833163002/diff/200001/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc File services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc (right): https://codereview.chromium.org/2833163002/diff/200001/services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc#newcode50 services/ui/public/interfaces/cursor/cursor_struct_traits_unittest.cc:50: for (int i = 0; i < 43; ++i) ...
3 years, 8 months ago (2017-04-25 17:16:46 UTC) #52
sky
LGTM
3 years, 8 months ago (2017-04-25 17:50:44 UTC) #53
Elliot Glaysher
tbring jam because all the changes in content/ and components/ are simple renames of constants; ...
3 years, 8 months ago (2017-04-25 17:55:59 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2833163002/240001
3 years, 8 months ago (2017-04-25 17:56:37 UTC) #59
commit-bot: I haz the power
3 years, 8 months ago (2017-04-25 18:06:55 UTC) #63
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/eeba7c6297fb07e155f3fef779a6...

Powered by Google App Engine
This is Rietveld 408576698