| 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/submenu_view.h" | 5 #include "ui/views/controls/menu/submenu_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 : parent_menu_item_(parent), | 40 : parent_menu_item_(parent), |
| 41 host_(NULL), | 41 host_(NULL), |
| 42 drop_item_(NULL), | 42 drop_item_(NULL), |
| 43 drop_position_(MenuDelegate::DROP_NONE), | 43 drop_position_(MenuDelegate::DROP_NONE), |
| 44 scroll_view_container_(NULL), | 44 scroll_view_container_(NULL), |
| 45 max_minor_text_width_(0), | 45 max_minor_text_width_(0), |
| 46 minimum_preferred_width_(0), | 46 minimum_preferred_width_(0), |
| 47 resize_open_menu_(false), | 47 resize_open_menu_(false), |
| 48 scroll_animator_(new ScrollAnimator(this)), | 48 scroll_animator_(new ScrollAnimator(this)), |
| 49 roundoff_error_(0), | 49 roundoff_error_(0), |
| 50 prefix_selector_(this) { | 50 prefix_selector_(this, this) { |
| 51 DCHECK(parent); | 51 DCHECK(parent); |
| 52 // We'll delete ourselves, otherwise the ScrollView would delete us on close. | 52 // We'll delete ourselves, otherwise the ScrollView would delete us on close. |
| 53 set_owned_by_client(); | 53 set_owned_by_client(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 SubmenuView::~SubmenuView() { | 56 SubmenuView::~SubmenuView() { |
| 57 // The menu may not have been closed yet (it will be hidden, but not | 57 // The menu may not have been closed yet (it will be hidden, but not |
| 58 // necessarily closed). | 58 // necessarily closed). |
| 59 Close(); | 59 Close(); |
| 60 | 60 |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 y = std::max(y, 0); | 509 y = std::max(y, 0); |
| 510 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); | 510 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); |
| 511 if (new_vis_bounds != vis_bounds) { | 511 if (new_vis_bounds != vis_bounds) { |
| 512 ScrollRectToVisible(new_vis_bounds); | 512 ScrollRectToVisible(new_vis_bounds); |
| 513 return true; | 513 return true; |
| 514 } | 514 } |
| 515 return false; | 515 return false; |
| 516 } | 516 } |
| 517 | 517 |
| 518 } // namespace views | 518 } // namespace views |
| OLD | NEW |