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

Issue 26350003: OLD: reland "views: change WrenchMenu to use each model's command ID's when creating MenuItemView's" (Closed)

Created:
7 years, 2 months ago by kuan
Modified:
7 years, 2 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

OLD: reland "views: change WrenchMenu to use each model's command ID's when creating MenuItemView's" the original cl (hhttps://codereview.chromium.org/25667005/) was reverted because of crash in bug 304756, this cl relands it with the fixes. this is in preparation for dynamic recent tabs model and menu: * WrenchMenu: - for each menu item, MenuItemView::GetCommand() used to be separate and different from MenuModel::GetCommandIdAt(model_index); they are the same now. - different range of command id's are reserved for recent tabs and bookmarks. - command id's of all items in the wrench menu and all its submenus can't clash, except for separator and IDC_SHOW_HISTORY, the latter of which is in both wrench menu and recent tabs submenu. * RecentTabsSubMenuModel: - make all command ids within range, use different ids among device name headers. * BookmarkMenuDelegate - makes sure only maximum number of menu items allowed is created. - add test. BUG=256750 TEST=wrench menu and all its submenus still work.

Patch Set 1 #

Total comments: 2

Patch Set 2 : fix integer overflow w/ kint32max, add test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -153 lines) Patch
M chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h View 2 chunks +5 lines, -8 lines 0 comments Download
M chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc View 8 chunks +21 lines, -11 lines 0 comments Download
M chrome/browser/ui/toolbar/wrench_menu_model.h View 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h View 1 4 chunks +13 lines, -1 line 1 comment Download
M chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc View 1 7 chunks +20 lines, -5 lines 1 comment Download
M chrome/browser/ui/views/bookmarks/bookmark_menu_delegate_unittest.cc View 1 6 chunks +127 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/wrench_menu.h View 6 chunks +20 lines, -35 lines 0 comments Download
M chrome/browser/ui/views/wrench_menu.cc View 20 chunks +99 lines, -87 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
kuan
hi scott, this relands the cl with fixes for the crash triggered from BookmarkMenuDelegate. the ...
7 years, 2 months ago (2013-10-08 09:53:31 UTC) #1
kuan
hi scott, the cl is now ready for review; the new changes (as compared to ...
7 years, 2 months ago (2013-10-08 15:02:39 UTC) #2
sky
7 years, 2 months ago (2013-10-08 15:55:04 UTC) #3
Two comments, only looked at diffs.

https://codereview.chromium.org/26350003/diff/5001/chrome/browser/ui/views/bo...
File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc (right):

https://codereview.chromium.org/26350003/diff/5001/chrome/browser/ui/views/bo...
chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc:492: return
!(menu_id >= min_menu_id_ && menu_id <= max_menu_id_);
nit: negatives are harder to read, compare to:
menu_id < min_menu_id || menu_id > max_menu_id_

https://codereview.chromium.org/26350003/diff/5001/chrome/browser/ui/views/bo...
File chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h (right):

https://codereview.chromium.org/26350003/diff/5001/chrome/browser/ui/views/bo...
chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h:202: int
min_menu_id_;
Make both of these (min/max) const.

Powered by Google App Engine
This is Rietveld 408576698