OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
6 #define VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // If set and the menu_item has a submenu, the submenu is shown. | 124 // If set and the menu_item has a submenu, the submenu is shown. |
125 SELECTION_OPEN_SUBMENU = 1 << 1, | 125 SELECTION_OPEN_SUBMENU = 1 << 1, |
126 | 126 |
127 // SetSelection is being invoked as the result exiting or cancelling the | 127 // SetSelection is being invoked as the result exiting or cancelling the |
128 // menu. This is used for debugging. | 128 // menu. This is used for debugging. |
129 SELECTION_EXIT = 1 << 2, | 129 SELECTION_EXIT = 1 << 2, |
130 }; | 130 }; |
131 | 131 |
132 // Tracks selection information. | 132 // Tracks selection information. |
133 struct State { | 133 struct State { |
134 State() : item(NULL), submenu_open(false) {} | 134 State(); |
| 135 ~State(); |
135 | 136 |
136 // The selected menu item. | 137 // The selected menu item. |
137 MenuItemView* item; | 138 MenuItemView* item; |
138 | 139 |
139 // If item has a submenu this indicates if the submenu is showing. | 140 // If item has a submenu this indicates if the submenu is showing. |
140 bool submenu_open; | 141 bool submenu_open; |
141 | 142 |
142 // Bounds passed to the run menu. Used for positioning the first menu. | 143 // Bounds passed to the run menu. Used for positioning the first menu. |
143 gfx::Rect initial_bounds; | 144 gfx::Rect initial_bounds; |
144 | 145 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // If non-null mouse drag events are forwarded to this view. See | 480 // If non-null mouse drag events are forwarded to this view. See |
480 // UpdateActiveMouseView for details. | 481 // UpdateActiveMouseView for details. |
481 View* active_mouse_view_; | 482 View* active_mouse_view_; |
482 | 483 |
483 DISALLOW_COPY_AND_ASSIGN(MenuController); | 484 DISALLOW_COPY_AND_ASSIGN(MenuController); |
484 }; | 485 }; |
485 | 486 |
486 } // namespace views | 487 } // namespace views |
487 | 488 |
488 #endif // VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 489 #endif // VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |