Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: ui/views/controls/menu/menu_controller.h

Issue 284903002: Only dispatch menu events if they have a valid target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test MenuControllerTest.EventTargeter Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <list> 10 #include <list>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 MenuAnchorPosition position, 84 MenuAnchorPosition position,
85 bool context_menu, 85 bool context_menu,
86 int* event_flags); 86 int* event_flags);
87 87
88 // Whether or not Run blocks. 88 // Whether or not Run blocks.
89 bool IsBlockingRun() const { return blocking_run_; } 89 bool IsBlockingRun() const { return blocking_run_; }
90 90
91 // Whether or not drag operation is in progress. 91 // Whether or not drag operation is in progress.
92 bool drag_in_progress() const { return drag_in_progress_; } 92 bool drag_in_progress() const { return drag_in_progress_; }
93 93
94 // Returns the owner of child windows.
95 // WARNING: this may be NULL.
96 Widget* owner() { return owner_; }
97
94 // Get the anchor position wich is used to show this menu. 98 // Get the anchor position wich is used to show this menu.
95 MenuAnchorPosition GetAnchorPosition() { return state_.anchor; } 99 MenuAnchorPosition GetAnchorPosition() { return state_.anchor; }
96 100
97 // Cancels the current Run. See ExitType for a description of what happens 101 // Cancels the current Run. See ExitType for a description of what happens
98 // with the various parameters. 102 // with the various parameters.
99 void Cancel(ExitType type); 103 void Cancel(ExitType type);
100 104
101 // An alternative to Cancel(EXIT_ALL) that can be used with a OneShotTimer. 105 // An alternative to Cancel(EXIT_ALL) that can be used with a OneShotTimer.
102 void CancelAll() { Cancel(EXIT_ALL); } 106 void CancelAll() { Cancel(EXIT_ALL); }
103 107
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 bool item_selected_by_touch_; 603 bool item_selected_by_touch_;
600 604
601 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; 605 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_;
602 606
603 DISALLOW_COPY_AND_ASSIGN(MenuController); 607 DISALLOW_COPY_AND_ASSIGN(MenuController);
604 }; 608 };
605 609
606 } // namespace views 610 } // namespace views
607 611
608 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 612 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698