summaryrefslogtreecommitdiffstats
path: root/views/controls/menu/menu_2.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 16:03:57 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 16:03:57 +0000
commit46dc31a6bdc4e2d3f382d3829c91ec25a22f4497 (patch)
tree6a0ffd97e06b2acb1db15f69717d4f58ec2c9533 /views/controls/menu/menu_2.h
parent872fe72140111fd090dd20c08f16ac132c340263 (diff)
downloadchromium_src-46dc31a6bdc4e2d3f382d3829c91ec25a22f4497.zip
chromium_src-46dc31a6bdc4e2d3f382d3829c91ec25a22f4497.tar.gz
chromium_src-46dc31a6bdc4e2d3f382d3829c91ec25a22f4497.tar.bz2
Fixes crash in disabling browser action from context menu on
views/gtk. The crash occurred because on views we dispatch the menu action immediately (well, after the nested message loop exits), but on windows the action is posted after a delay. The code wasn't written to deal with immediate dispatch, so I changed the gtk code to post a task to dispatch activation. I've also added a warning that menu2 won't work on the stack, which has always been the case, just not stated. BUG=33619 TEST=see bug report. Review URL: http://codereview.chromium.org/557065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/menu/menu_2.h')
-rw-r--r--views/controls/menu/menu_2.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/views/controls/menu/menu_2.h b/views/controls/menu/menu_2.h
index 416c949..1000d86 100644
--- a/views/controls/menu/menu_2.h
+++ b/views/controls/menu/menu_2.h
@@ -18,6 +18,10 @@ namespace views {
class NativeMenuGtk;
// A menu. Populated from a model, and relies on a delegate to execute commands.
+//
+// WARNING: do NOT create and use Menu2 on the stack. Menu2 notifies the model
+// of selection AFTER a delay. This means that if use a Menu2 on the stack
+// ActivatedAt is never invoked.
class Menu2 {
public:
// Creates a new menu populated with the contents of |model|.