| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 // Positions and sizes the child views. This tiles the views vertically, | 54 // Positions and sizes the child views. This tiles the views vertically, |
| 55 // giving each child the available width. | 55 // giving each child the available width. |
| 56 virtual void Layout() OVERRIDE; | 56 virtual void Layout() OVERRIDE; |
| 57 virtual gfx::Size GetPreferredSize() OVERRIDE; | 57 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 58 | 58 |
| 59 // Override from View. | 59 // Override from View. |
| 60 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 60 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 61 | 61 |
| 62 // Painting. | 62 // Painting. |
| 63 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 63 virtual void PaintChildren(gfx::CanvasSkia* canvas) OVERRIDE; |
| 64 | 64 |
| 65 // Drag and drop methods. These are forwarded to the MenuController. | 65 // Drag and drop methods. These are forwarded to the MenuController. |
| 66 virtual bool GetDropFormats( | 66 virtual bool GetDropFormats( |
| 67 int* formats, | 67 int* formats, |
| 68 std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 68 std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
| 69 virtual bool AreDropTypesRequired() OVERRIDE; | 69 virtual bool AreDropTypesRequired() OVERRIDE; |
| 70 virtual bool CanDrop(const OSExchangeData& data) OVERRIDE; | 70 virtual bool CanDrop(const OSExchangeData& data) OVERRIDE; |
| 71 virtual void OnDragEntered(const DropTargetEvent& event) OVERRIDE; | 71 virtual void OnDragEntered(const DropTargetEvent& event) OVERRIDE; |
| 72 virtual int OnDragUpdated(const DropTargetEvent& event) OVERRIDE; | 72 virtual int OnDragUpdated(const DropTargetEvent& event) OVERRIDE; |
| 73 virtual void OnDragExited() OVERRIDE; | 73 virtual void OnDragExited() OVERRIDE; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 // View method. Overridden to schedule a paint. We do this so that when | 158 // View method. Overridden to schedule a paint. We do this so that when |
| 159 // scrolling occurs, everything is repainted correctly. | 159 // scrolling occurs, everything is repainted correctly. |
| 160 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 160 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
| 161 | 161 |
| 162 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; | 162 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 // Paints the drop indicator. This is only invoked if item is non-NULL and | 165 // Paints the drop indicator. This is only invoked if item is non-NULL and |
| 166 // position is not DROP_NONE. | 166 // position is not DROP_NONE. |
| 167 void PaintDropIndicator(gfx::Canvas* canvas, | 167 void PaintDropIndicator(gfx::CanvasSkia* canvas, |
| 168 MenuItemView* item, | 168 MenuItemView* item, |
| 169 MenuDelegate::DropPosition position); | 169 MenuDelegate::DropPosition position); |
| 170 | 170 |
| 171 void SchedulePaintForDropIndicator(MenuItemView* item, | 171 void SchedulePaintForDropIndicator(MenuItemView* item, |
| 172 MenuDelegate::DropPosition position); | 172 MenuDelegate::DropPosition position); |
| 173 | 173 |
| 174 // Calculates the location of th edrop indicator. | 174 // Calculates the location of th edrop indicator. |
| 175 gfx::Rect CalculateDropIndicatorBounds(MenuItemView* item, | 175 gfx::Rect CalculateDropIndicatorBounds(MenuItemView* item, |
| 176 MenuDelegate::DropPosition position); | 176 MenuDelegate::DropPosition position); |
| 177 | 177 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 206 | 206 |
| 207 // The submenu's scroll animator | 207 // The submenu's scroll animator |
| 208 scoped_ptr<ScrollAnimator> scroll_animator_; | 208 scoped_ptr<ScrollAnimator> scroll_animator_; |
| 209 | 209 |
| 210 DISALLOW_COPY_AND_ASSIGN(SubmenuView); | 210 DISALLOW_COPY_AND_ASSIGN(SubmenuView); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 } // namespace views | 213 } // namespace views |
| 214 | 214 |
| 215 #endif // UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ | 215 #endif // UI_VIEWS_CONTROLS_MENU_SUBMENU_VIEW_H_ |
| OLD | NEW |