OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/controls/menu/submenu_view.h" | 5 #include "views/controls/menu/submenu_view.h" |
6 | 6 |
7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "views/controls/menu/menu_controller.h" | 8 #include "views/controls/menu/menu_controller.h" |
9 #include "views/controls/menu/menu_scroll_view_container.h" | 9 #include "views/controls/menu/menu_scroll_view_container.h" |
10 #include "views/widget/root_view.h" | 10 #include "views/widget/root_view.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 bool SubmenuView::IsShowing() { | 215 bool SubmenuView::IsShowing() { |
216 return host_ && host_->IsVisible(); | 216 return host_ && host_->IsVisible(); |
217 } | 217 } |
218 | 218 |
219 void SubmenuView::ShowAt(gfx::NativeWindow parent, | 219 void SubmenuView::ShowAt(gfx::NativeWindow parent, |
220 const gfx::Rect& bounds, | 220 const gfx::Rect& bounds, |
221 bool do_capture) { | 221 bool do_capture) { |
222 if (host_) { | 222 if (host_) { |
223 host_->Show(); | 223 host_->Show(); |
| 224 if (do_capture) |
| 225 host_->DoCapture(); |
224 return; | 226 return; |
225 } | 227 } |
226 | 228 |
227 host_ = new MenuHost(this); | 229 host_ = new MenuHost(this); |
228 // Force construction of the scroll view container. | 230 // Force construction of the scroll view container. |
229 GetScrollViewContainer(); | 231 GetScrollViewContainer(); |
230 // Make sure the first row is visible. | 232 // Make sure the first row is visible. |
231 ScrollRectToVisible(0, 0, 1, 1); | 233 ScrollRectToVisible(0, 0, 1, 1); |
232 host_->Init(parent, bounds, scroll_view_container_, do_capture); | 234 host_->Init(parent, bounds, scroll_view_container_, do_capture); |
233 } | 235 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 item_bounds.set_height(kDropIndicatorHeight); | 327 item_bounds.set_height(kDropIndicatorHeight); |
326 return item_bounds; | 328 return item_bounds; |
327 | 329 |
328 default: | 330 default: |
329 // Don't render anything for on. | 331 // Don't render anything for on. |
330 return gfx::Rect(); | 332 return gfx::Rect(); |
331 } | 333 } |
332 } | 334 } |
333 | 335 |
334 } // namespace views | 336 } // namespace views |
OLD | NEW |