OLD | NEW |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 MenuAnchorPosition position, | 85 MenuAnchorPosition position, |
86 bool context_menu, | 86 bool context_menu, |
87 int* event_flags); | 87 int* event_flags); |
88 | 88 |
89 // Whether or not Run blocks. | 89 // Whether or not Run blocks. |
90 bool IsBlockingRun() const { return blocking_run_; } | 90 bool IsBlockingRun() const { return blocking_run_; } |
91 | 91 |
92 // Whether or not drag operation is in progress. | 92 // Whether or not drag operation is in progress. |
93 bool drag_in_progress() const { return drag_in_progress_; } | 93 bool drag_in_progress() const { return drag_in_progress_; } |
94 | 94 |
| 95 // Since general Views and MenuItemViews have different mechanisms for |
| 96 // implementing drag, it is possible that a child view will want to use |
| 97 // its own dragging, in which case it needs to notify the controller that |
| 98 // a drag is in progress to avoid closing the active menu. |
| 99 void set_drag_in_progress(bool drag_in_progress) { |
| 100 drag_in_progress_ = drag_in_progress; |
| 101 } |
| 102 |
95 // Returns the owner of child windows. | 103 // Returns the owner of child windows. |
96 // WARNING: this may be NULL. | 104 // WARNING: this may be NULL. |
97 Widget* owner() { return owner_; } | 105 Widget* owner() { return owner_; } |
98 | 106 |
99 // Get the anchor position wich is used to show this menu. | 107 // Get the anchor position wich is used to show this menu. |
100 MenuAnchorPosition GetAnchorPosition() { return state_.anchor; } | 108 MenuAnchorPosition GetAnchorPosition() { return state_.anchor; } |
101 | 109 |
102 // Cancels the current Run. See ExitType for a description of what happens | 110 // Cancels the current Run. See ExitType for a description of what happens |
103 // with the various parameters. | 111 // with the various parameters. |
104 void Cancel(ExitType type); | 112 void Cancel(ExitType type); |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 bool item_selected_by_touch_; | 612 bool item_selected_by_touch_; |
605 | 613 |
606 scoped_ptr<MenuMessageLoop> message_loop_; | 614 scoped_ptr<MenuMessageLoop> message_loop_; |
607 | 615 |
608 DISALLOW_COPY_AND_ASSIGN(MenuController); | 616 DISALLOW_COPY_AND_ASSIGN(MenuController); |
609 }; | 617 }; |
610 | 618 |
611 } // namespace views | 619 } // namespace views |
612 | 620 |
613 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 621 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |