| 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 #ifndef UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // Overridden from View: | 159 // Overridden from View: |
| 160 const char* GetClassName() const override; | 160 const char* GetClassName() const override; |
| 161 | 161 |
| 162 // View method. Overridden to schedule a paint. We do this so that when | 162 // View method. Overridden to schedule a paint. We do this so that when |
| 163 // scrolling occurs, everything is repainted correctly. | 163 // scrolling occurs, everything is repainted correctly. |
| 164 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 164 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 165 | 165 |
| 166 void ChildPreferredSizeChanged(View* child) override; | 166 void ChildPreferredSizeChanged(View* child) override; |
| 167 | 167 |
| 168 private: | 168 private: |
| 169 // Paints the drop indicator. This is only invoked if item is non-NULL and | |
| 170 // position is not DROP_NONE. | |
| 171 void PaintDropIndicator(gfx::Canvas* canvas, | |
| 172 MenuItemView* item, | |
| 173 MenuDelegate::DropPosition position); | |
| 174 | |
| 175 void SchedulePaintForDropIndicator(MenuItemView* item, | 169 void SchedulePaintForDropIndicator(MenuItemView* item, |
| 176 MenuDelegate::DropPosition position); | 170 MenuDelegate::DropPosition position); |
| 177 | 171 |
| 178 // Calculates the location of th edrop indicator. | 172 // Calculates the location of th edrop indicator. |
| 179 gfx::Rect CalculateDropIndicatorBounds(MenuItemView* item, | 173 gfx::Rect CalculateDropIndicatorBounds(MenuItemView* item, |
| 180 MenuDelegate::DropPosition position); | 174 MenuDelegate::DropPosition position); |
| 181 | 175 |
| 182 // Implementation of ScrollDelegate | 176 // Implementation of ScrollDelegate |
| 183 bool OnScroll(float dx, float dy) override; | 177 bool OnScroll(float dx, float dy) override; |
| 184 | 178 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 float roundoff_error_; | 212 float roundoff_error_; |
| 219 | 213 |
| 220 PrefixSelector prefix_selector_; | 214 PrefixSelector prefix_selector_; |
| 221 | 215 |
| 222 DISALLOW_COPY_AND_ASSIGN(SubmenuView); | 216 DISALLOW_COPY_AND_ASSIGN(SubmenuView); |
| 223 }; | 217 }; |
| 224 | 218 |
| 225 } // namespace views | 219 } // namespace views |
| 226 | 220 |
| 227 #endif // UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ | 221 #endif // UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ |
| OLD | NEW |