| 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_RUNNER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Indicates RunMenuAt is returning because the MenuRunner was deleted. | 101 // Indicates RunMenuAt is returning because the MenuRunner was deleted. |
| 102 MENU_DELETED, | 102 MENU_DELETED, |
| 103 | 103 |
| 104 // Indicates RunMenuAt returned and MenuRunner was not deleted. | 104 // Indicates RunMenuAt returned and MenuRunner was not deleted. |
| 105 NORMAL_EXIT | 105 NORMAL_EXIT |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 // Creates a new MenuRunner, which may use a native menu if available. | 108 // Creates a new MenuRunner, which may use a native menu if available. |
| 109 // |run_types| is a bitmask of RunTypes. If provided, | 109 // |run_types| is a bitmask of RunTypes. If provided, |
| 110 // |on_menu_closed_callback| is invoked when the menu is closed. | 110 // |on_menu_closed_callback| is invoked when the menu is closed. |
| 111 // Note that with a native menu (e.g. on Mac), the ASYNC flag in |run_types| |
| 112 // may be ignored. See http://crbug.com/682544. |
| 111 MenuRunner(ui::MenuModel* menu_model, | 113 MenuRunner(ui::MenuModel* menu_model, |
| 112 int32_t run_types, | 114 int32_t run_types, |
| 113 const base::Closure& on_menu_closed_callback = base::Closure()); | 115 const base::Closure& on_menu_closed_callback = base::Closure()); |
| 114 | 116 |
| 115 // Creates a runner for a custom-created toolkit-views menu. | 117 // Creates a runner for a custom-created toolkit-views menu. |
| 116 MenuRunner(MenuItemView* menu, int32_t run_types); | 118 MenuRunner(MenuItemView* menu, int32_t run_types); |
| 117 ~MenuRunner(); | 119 ~MenuRunner(); |
| 118 | 120 |
| 119 // Runs the menu. If this returns MENU_DELETED the method is returning | 121 // Runs the menu. If this returns MENU_DELETED the method is returning |
| 120 // because the MenuRunner was deleted. | 122 // because the MenuRunner was deleted. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 175 |
| 174 protected: | 176 protected: |
| 175 DisplayChangeListener() {} | 177 DisplayChangeListener() {} |
| 176 }; | 178 }; |
| 177 | 179 |
| 178 } // namespace internal | 180 } // namespace internal |
| 179 | 181 |
| 180 } // namespace views | 182 } // namespace views |
| 181 | 183 |
| 182 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ | 184 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
| OLD | NEW |