Revert 227675 "reland "views: change WrenchMenu to use each mode..."
> 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. > > Review URL: https://codereview.chromium.org/26455004 The new test has memory leaks. When the previous menu delegate is freed it doesn't free the menu it creates in Init, I suspect this normally is handled by the views system itself. Example of leaks: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28valgrind%29%286%29/builds/21625 You can reproduce the leaks by building for chromeos and running under valgrind: http://www.chromium.org/developers/how-tos/using-valgrind TBR=kuan@chromium.org Review URL: https://codereview.chromium.org/26546004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227699 0039d316-1c4b-4281-b951-d872f2087c98
Showing
This diff is collapsed.
Please register or sign in to comment