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/base/accessibility/accessible_view_state.h" | 10 #include "ui/base/accessibility/accessible_view_state.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 const int kDropIndicatorHeight = 2; | 23 const int kDropIndicatorHeight = 2; |
24 | 24 |
25 // Color of the drop indicator. | 25 // Color of the drop indicator. |
26 const SkColor kDropIndicatorColor = SK_ColorBLACK; | 26 const SkColor kDropIndicatorColor = SK_ColorBLACK; |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 namespace views { | 30 namespace views { |
31 | 31 |
32 // static | 32 // static |
33 const char SubmenuView::kViewClassName[] = "views/SubmenuView"; | 33 const char SubmenuView::kViewClassName[] = "SubmenuView"; |
34 | 34 |
35 SubmenuView::SubmenuView(MenuItemView* parent) | 35 SubmenuView::SubmenuView(MenuItemView* parent) |
36 : parent_menu_item_(parent), | 36 : parent_menu_item_(parent), |
37 host_(NULL), | 37 host_(NULL), |
38 drop_item_(NULL), | 38 drop_item_(NULL), |
39 drop_position_(MenuDelegate::DROP_NONE), | 39 drop_position_(MenuDelegate::DROP_NONE), |
40 scroll_view_container_(NULL), | 40 scroll_view_container_(NULL), |
41 max_accelerator_width_(0), | 41 max_accelerator_width_(0), |
42 minimum_preferred_width_(0), | 42 minimum_preferred_width_(0), |
43 resize_open_menu_(false), | 43 resize_open_menu_(false), |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 y = std::max(y, 0); | 452 y = std::max(y, 0); |
453 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); | 453 gfx::Rect new_vis_bounds(x, y, vis_bounds.width(), vis_bounds.height()); |
454 if (new_vis_bounds != vis_bounds) { | 454 if (new_vis_bounds != vis_bounds) { |
455 ScrollRectToVisible(new_vis_bounds); | 455 ScrollRectToVisible(new_vis_bounds); |
456 return true; | 456 return true; |
457 } | 457 } |
458 return false; | 458 return false; |
459 } | 459 } |
460 | 460 |
461 } // namespace views | 461 } // namespace views |
OLD | NEW |