| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTROLS_MENU_VIEWS_MENU_2_H_ | 5 #ifndef CONTROLS_MENU_VIEWS_MENU_2_H_ |
| 6 #define CONTROLS_MENU_VIEWS_MENU_2_H_ | 6 #define CONTROLS_MENU_VIEWS_MENU_2_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gfx/native_widget_types.h" | 10 #include "base/gfx/native_widget_types.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 explicit Menu2(Menu2Model* model); | 107 explicit Menu2(Menu2Model* model); |
| 108 virtual ~Menu2() {} | 108 virtual ~Menu2() {} |
| 109 | 109 |
| 110 // How the menu is aligned relative to the point it is shown at. | 110 // How the menu is aligned relative to the point it is shown at. |
| 111 enum Alignment { | 111 enum Alignment { |
| 112 ALIGN_TOPLEFT, | 112 ALIGN_TOPLEFT, |
| 113 ALIGN_TOPRIGHT | 113 ALIGN_TOPRIGHT |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 // Runs the menu at the specified point. This may or may not block, depending | 116 // Runs the menu at the specified point. This may or may not block, depending |
| 117 // on the platform and type of menu in use. | 117 // on the platform and type of menu in use. RunContextMenuAt is the same, but |
| 118 // the alignment is the default for a context menu. |
| 118 void RunMenuAt(const gfx::Point& point, Alignment alignment); | 119 void RunMenuAt(const gfx::Point& point, Alignment alignment); |
| 120 void RunContextMenuAt(const gfx::Point& point); |
| 119 | 121 |
| 120 // Cancels the active menu. | 122 // Cancels the active menu. |
| 121 void CancelMenu(); | 123 void CancelMenu(); |
| 122 | 124 |
| 123 // Called when the model supplying data to this menu has changed, and the menu | 125 // Called when the model supplying data to this menu has changed, and the menu |
| 124 // must be rebuilt. | 126 // must be rebuilt. |
| 125 void Rebuild(); | 127 void Rebuild(); |
| 126 | 128 |
| 127 // Called when the states of the menu items in the menu should be refreshed | 129 // Called when the states of the menu items in the menu should be refreshed |
| 128 // from the model. | 130 // from the model. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 139 | 141 |
| 140 // The object that actually implements the menu. | 142 // The object that actually implements the menu. |
| 141 MenuWrapper* wrapper_; | 143 MenuWrapper* wrapper_; |
| 142 | 144 |
| 143 DISALLOW_COPY_AND_ASSIGN(Menu2); | 145 DISALLOW_COPY_AND_ASSIGN(Menu2); |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 } // namespace views | 148 } // namespace views |
| 147 | 149 |
| 148 #endif // CONTROLS_MENU_VIEWS_MENU_2_H_ | 150 #endif // CONTROLS_MENU_VIEWS_MENU_2_H_ |
| OLD | NEW |