| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
| 8 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
| 9 #include "views/controls/menu/menu_config.h" | 9 #include "views/controls/menu/menu_config.h" |
| 10 #include "views/controls/menu/menu_controller.h" | 10 #include "views/controls/menu/menu_controller.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 SchedulePaint(); | 350 SchedulePaint(); |
| 351 } | 351 } |
| 352 | 352 |
| 353 void SubmenuView::PaintDropIndicator(gfx::Canvas* canvas, | 353 void SubmenuView::PaintDropIndicator(gfx::Canvas* canvas, |
| 354 MenuItemView* item, | 354 MenuItemView* item, |
| 355 MenuDelegate::DropPosition position) { | 355 MenuDelegate::DropPosition position) { |
| 356 if (position == MenuDelegate::DROP_NONE) | 356 if (position == MenuDelegate::DROP_NONE) |
| 357 return; | 357 return; |
| 358 | 358 |
| 359 gfx::Rect bounds = CalculateDropIndicatorBounds(item, position); | 359 gfx::Rect bounds = CalculateDropIndicatorBounds(item, position); |
| 360 canvas->FillRectInt(kDropIndicatorColor, bounds.x(), bounds.y(), | 360 canvas->FillRect(kDropIndicatorColor, bounds); |
| 361 bounds.width(), bounds.height()); | |
| 362 } | 361 } |
| 363 | 362 |
| 364 void SubmenuView::SchedulePaintForDropIndicator( | 363 void SubmenuView::SchedulePaintForDropIndicator( |
| 365 MenuItemView* item, | 364 MenuItemView* item, |
| 366 MenuDelegate::DropPosition position) { | 365 MenuDelegate::DropPosition position) { |
| 367 if (item == NULL) | 366 if (item == NULL) |
| 368 return; | 367 return; |
| 369 | 368 |
| 370 if (position == MenuDelegate::DROP_ON) { | 369 if (position == MenuDelegate::DROP_ON) { |
| 371 item->SchedulePaint(); | 370 item->SchedulePaint(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 390 item_bounds.set_height(kDropIndicatorHeight); | 389 item_bounds.set_height(kDropIndicatorHeight); |
| 391 return item_bounds; | 390 return item_bounds; |
| 392 | 391 |
| 393 default: | 392 default: |
| 394 // Don't render anything for on. | 393 // Don't render anything for on. |
| 395 return gfx::Rect(); | 394 return gfx::Rect(); |
| 396 } | 395 } |
| 397 } | 396 } |
| 398 | 397 |
| 399 } // namespace views | 398 } // namespace views |
| OLD | NEW |