summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 02:15:08 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 02:15:08 +0000
commit0be241219a6cecb753ae4fdfb049f75530353771 (patch)
tree74eef3fce4d24a8ab40724d1d5243482d07dfdbd /ui
parent244f2b3b9ff0cc85d5c94f33006c417fc8f3220e (diff)
downloadchromium_src-0be241219a6cecb753ae4fdfb049f75530353771.zip
chromium_src-0be241219a6cecb753ae4fdfb049f75530353771.tar.gz
chromium_src-0be241219a6cecb753ae4fdfb049f75530353771.tar.bz2
Don't send ViewMsg_ContextMenuClosed to the renderer process for submenus.
Note: currently SimpleMenuModel::Delegate doesn't receive the same notifications on all platforms. On Windows and CrOS, MenuWillShow and MenuClosed are sent for all menus (including submenus); while these notifications are not sent for submenus on Linux (haven't tested Mac). This CL makes sure that on Windows and CrOS no ViewMsg_ContextMenuClosed messages are generated for submenus, but it doesn't unify the behavior of SimpleMenuModel::Delegate. I have filed a bug (http://code.google.com/p/chromium/issues/detail?id=90732) to track that issue. BUG=None TEST= - make sure you are running Pepper Flash on either CrOS or Windows; - go to www.hulu.com; - open context menu on the flash content; - move the cursor onto the Quality item to open a submenu; - move the cursor away; - the renderer process shouldn't crash. Review URL: http://codereview.chromium.org/7492054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/base/models/simple_menu_model.cc8
-rw-r--r--ui/base/models/simple_menu_model.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index 57f6ec3e..6434850 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -46,10 +46,10 @@ bool SimpleMenuModel::Delegate::GetIconForCommandId(
void SimpleMenuModel::Delegate::CommandIdHighlighted(int command_id) {
}
-void SimpleMenuModel::Delegate::MenuWillShow() {
+void SimpleMenuModel::Delegate::MenuWillShow(SimpleMenuModel* /*source*/) {
}
-void SimpleMenuModel::Delegate::MenuClosed() {
+void SimpleMenuModel::Delegate::MenuClosed(SimpleMenuModel* /*source*/) {
}
////////////////////////////////////////////////////////////////////////////////
@@ -296,7 +296,7 @@ MenuModel* SimpleMenuModel::GetSubmenuModelAt(int index) const {
void SimpleMenuModel::MenuWillShow() {
if (delegate_)
- delegate_->MenuWillShow();
+ delegate_->MenuWillShow(this);
}
void SimpleMenuModel::MenuClosed() {
@@ -315,7 +315,7 @@ void SimpleMenuModel::SetMenuModelDelegate(
void SimpleMenuModel::OnMenuClosed() {
if (delegate_)
- delegate_->MenuClosed();
+ delegate_->MenuClosed(this);
}
int SimpleMenuModel::FlipIndex(int index) const {
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
index de233fd..9f7136d 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -50,10 +50,10 @@ class UI_API SimpleMenuModel : public MenuModel {
virtual void ExecuteCommand(int command_id) = 0;
// Notifies the delegate that the menu is about to show.
- virtual void MenuWillShow();
+ virtual void MenuWillShow(SimpleMenuModel* source);
// Notifies the delegate that the menu has closed.
- virtual void MenuClosed();
+ virtual void MenuClosed(SimpleMenuModel* source);
protected:
virtual ~Delegate() {}