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 #include "ui/views/controls/menu/menu_delegate.h" | 5 #include "ui/views/controls/menu/menu_delegate.h" |
6 | 6 |
7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
8 #include "ui/views/controls/menu/menu_config.h" | 8 #include "ui/views/controls/menu/menu_config.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 void MenuDelegate::WriteDragData(MenuItemView* sender, OSExchangeData* data) { | 125 void MenuDelegate::WriteDragData(MenuItemView* sender, OSExchangeData* data) { |
126 NOTREACHED() << "If you override CanDrag, you must override this too."; | 126 NOTREACHED() << "If you override CanDrag, you must override this too."; |
127 } | 127 } |
128 | 128 |
129 int MenuDelegate::GetDragOperations(MenuItemView* sender) { | 129 int MenuDelegate::GetDragOperations(MenuItemView* sender) { |
130 NOTREACHED() << "If you override CanDrag, you must override this too."; | 130 NOTREACHED() << "If you override CanDrag, you must override this too."; |
131 return 0; | 131 return 0; |
132 } | 132 } |
133 | 133 |
| 134 bool MenuDelegate::ShouldCloseOnDragComplete() { |
| 135 return true; |
| 136 } |
| 137 |
134 MenuItemView* MenuDelegate::GetSiblingMenu(MenuItemView* menu, | 138 MenuItemView* MenuDelegate::GetSiblingMenu(MenuItemView* menu, |
135 const gfx::Point& screen_point, | 139 const gfx::Point& screen_point, |
136 MenuAnchorPosition* anchor, | 140 MenuAnchorPosition* anchor, |
137 bool* has_mnemonics, | 141 bool* has_mnemonics, |
138 MenuButton** button) { | 142 MenuButton** button) { |
139 return NULL; | 143 return NULL; |
140 } | 144 } |
141 | 145 |
142 int MenuDelegate::GetMaxWidthForMenu(MenuItemView* menu) { | 146 int MenuDelegate::GetMaxWidthForMenu(MenuItemView* menu) { |
143 // NOTE: this needs to be large enough to accommodate the wrench menu with | 147 // NOTE: this needs to be large enough to accommodate the wrench menu with |
(...skipping 13 matching lines...) Expand all Loading... |
157 int* right_margin) const { | 161 int* right_margin) const { |
158 *left_margin = 0; | 162 *left_margin = 0; |
159 *right_margin = 0; | 163 *right_margin = 0; |
160 } | 164 } |
161 | 165 |
162 bool MenuDelegate::ShouldReserveSpaceForSubmenuIndicator() const { | 166 bool MenuDelegate::ShouldReserveSpaceForSubmenuIndicator() const { |
163 return true; | 167 return true; |
164 } | 168 } |
165 | 169 |
166 } // namespace views | 170 } // namespace views |
OLD | NEW |