summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 00:33:14 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-11 00:33:14 +0000
commitab996e66a8149ec52caddd510ef620a5ec8fe758 (patch)
tree5d6186a3b19b806c90ce6187319e8f5a33277beb /app
parentb02a1f687526c0d012b4a8f4215cfd0056f0718f (diff)
downloadchromium_src-ab996e66a8149ec52caddd510ef620a5ec8fe758.zip
chromium_src-ab996e66a8149ec52caddd510ef620a5ec8fe758.tar.gz
chromium_src-ab996e66a8149ec52caddd510ef620a5ec8fe758.tar.bz2
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
Diffstat (limited to 'app')
-rw-r--r--app/menus/menu_model.cc5
-rw-r--r--app/menus/menu_model.h4
2 files changed, 9 insertions, 0 deletions
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() {}