Chromium Code Reviews| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 | 82 |
| 83 // A child view is performing a drag-and-drop operation, so the menu should | 83 // A child view is performing a drag-and-drop operation, so the menu should |
| 84 // stay open (even if it doesn't receive drag updated events). In this case, | 84 // stay open (even if it doesn't receive drag updated events). In this case, |
| 85 // the caller is responsible for closing the menu upon completion of the | 85 // the caller is responsible for closing the menu upon completion of the |
| 86 // drag-and-drop. | 86 // drag-and-drop. |
| 87 NESTED_DRAG = 1 << 5, | 87 NESTED_DRAG = 1 << 5, |
| 88 | 88 |
| 89 // Menu with fixed anchor position, so |MenuRunner| will not attempt to | 89 // Menu with fixed anchor position, so |MenuRunner| will not attempt to |
| 90 // adjust the anchor point. For example the context menu of shelf item. | 90 // adjust the anchor point. For example the context menu of shelf item. |
| 91 FIXED_ANCHOR = 1 << 6, | 91 FIXED_ANCHOR = 1 << 6, |
| 92 | |
| 93 #if !defined(OS_MACOSX) | |
| 94 // Owner of the menu can be dragged after menu is created. For example the | |
|
msw
2017/05/17 23:03:30
This is weird to me, I'd like to see it in action.
minch1
2017/05/18 17:42:57
Yes, dragging will close the menu.
| |
| 95 // shelf item can be dragged when the context menu of the item is opened. | |
| 96 OWNER_NEEDS_DRAG = 1 << 7, | |
|
msw
2017/05/17 23:03:30
nit: SEND_UNHANDLED_GESTURES_TO_OWNER or similar?
minch1
2017/05/26 23:01:15
Done.
| |
| 97 #endif | |
| 92 }; | 98 }; |
| 93 | 99 |
| 94 // Creates a new MenuRunner, which may use a native menu if available. | 100 // Creates a new MenuRunner, which may use a native menu if available. |
| 95 // |run_types| is a bitmask of RunTypes. If provided, | 101 // |run_types| is a bitmask of RunTypes. If provided, |
| 96 // |on_menu_closed_callback| is invoked when the menu is closed. | 102 // |on_menu_closed_callback| is invoked when the menu is closed. |
| 97 // Note that with a native menu (e.g. on Mac), the ASYNC flag in |run_types| | 103 // Note that with a native menu (e.g. on Mac), the ASYNC flag in |run_types| |
| 98 // may be ignored. See http://crbug.com/682544. | 104 // may be ignored. See http://crbug.com/682544. |
| 99 MenuRunner(ui::MenuModel* menu_model, | 105 MenuRunner(ui::MenuModel* menu_model, |
| 100 int32_t run_types, | 106 int32_t run_types, |
| 101 const base::Closure& on_menu_closed_callback = base::Closure()); | 107 const base::Closure& on_menu_closed_callback = base::Closure()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 | 164 |
| 159 protected: | 165 protected: |
| 160 DisplayChangeListener() {} | 166 DisplayChangeListener() {} |
| 161 }; | 167 }; |
| 162 | 168 |
| 163 } // namespace internal | 169 } // namespace internal |
| 164 | 170 |
| 165 } // namespace views | 171 } // namespace views |
| 166 | 172 |
| 167 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ | 173 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_H_ |
| OLD | NEW |