From ab996e66a8149ec52caddd510ef620a5ec8fe758 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Thu, 11 Nov 2010 00:33:14 +0000 Subject: Add ActivatedAtWithDisposition to MenuModel. Also, use it in MenuGtk, and implement it in BackForwardMenuModel. BUG=38452 TEST=manual Review URL: http://codereview.chromium.org/4780001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65739 0039d316-1c4b-4281-b951-d872f2087c98 --- app/menus/menu_model.cc | 5 +++++ app/menus/menu_model.h | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'app/menus') diff --git a/app/menus/menu_model.cc b/app/menus/menu_model.cc index cbce228..c8b7835 100644 --- a/app/menus/menu_model.cc +++ b/app/menus/menu_model.cc @@ -29,4 +29,9 @@ bool MenuModel::GetModelAndIndexForCommandId(int command_id, return false; } +// Default implementation ignores the disposition. +void MenuModel::ActivatedAtWithDisposition(int index, int disposition) { + ActivatedAt(index); +} + } // namespace diff --git a/app/menus/menu_model.h b/app/menus/menu_model.h index 1cb356a..78b92a7 100644 --- a/app/menus/menu_model.h +++ b/app/menus/menu_model.h @@ -107,6 +107,10 @@ class MenuModel { // Called when the item at the specified index has been activated. virtual void ActivatedAt(int index) = 0; + // Called when the item has been activated with a given disposition (for the + // case where the activation involves a navigation). + virtual void ActivatedAtWithDisposition(int index, int disposition); + // Called when the menu is about to be shown. virtual void MenuWillShow() {} -- cgit v1.1