| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "views/controls/menu/menu_controller.h" | 8 #include "views/controls/menu/menu_controller.h" |
| 9 #include "views/controls/menu/menu_scroll_view_container.h" | 9 #include "views/controls/menu/menu_scroll_view_container.h" |
| 10 #include "views/widget/root_view.h" | 10 #include "views/widget/root_view.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 SchedulePaint(); | 105 SchedulePaint(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void SubmenuView::PaintChildren(gfx::Canvas* canvas) { | 108 void SubmenuView::PaintChildren(gfx::Canvas* canvas) { |
| 109 View::PaintChildren(canvas); | 109 View::PaintChildren(canvas); |
| 110 | 110 |
| 111 if (drop_item_ && drop_position_ != MenuDelegate::DROP_ON) | 111 if (drop_item_ && drop_position_ != MenuDelegate::DROP_ON) |
| 112 PaintDropIndicator(canvas, drop_item_, drop_position_); | 112 PaintDropIndicator(canvas, drop_item_, drop_position_); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // TODO(sky): need to add support for new dnd methods for Linux. | 115 bool SubmenuView::GetDropFormats( |
| 116 int* formats, |
| 117 std::set<OSExchangeData::CustomFormat>* custom_formats) { |
| 118 DCHECK(GetMenuItem()->GetMenuController()); |
| 119 return GetMenuItem()->GetMenuController()->GetDropFormats(this, formats, |
| 120 custom_formats); |
| 121 } |
| 122 |
| 123 bool SubmenuView::AreDropTypesRequired() { |
| 124 DCHECK(GetMenuItem()->GetMenuController()); |
| 125 return GetMenuItem()->GetMenuController()->AreDropTypesRequired(this); |
| 126 } |
| 116 | 127 |
| 117 bool SubmenuView::CanDrop(const OSExchangeData& data) { | 128 bool SubmenuView::CanDrop(const OSExchangeData& data) { |
| 118 DCHECK(GetMenuItem()->GetMenuController()); | 129 DCHECK(GetMenuItem()->GetMenuController()); |
| 119 return GetMenuItem()->GetMenuController()->CanDrop(this, data); | 130 return GetMenuItem()->GetMenuController()->CanDrop(this, data); |
| 120 } | 131 } |
| 121 | 132 |
| 122 void SubmenuView::OnDragEntered(const DropTargetEvent& event) { | 133 void SubmenuView::OnDragEntered(const DropTargetEvent& event) { |
| 123 DCHECK(GetMenuItem()->GetMenuController()); | 134 DCHECK(GetMenuItem()->GetMenuController()); |
| 124 GetMenuItem()->GetMenuController()->OnDragEntered(this, event); | 135 GetMenuItem()->GetMenuController()->OnDragEntered(this, event); |
| 125 } | 136 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 item_bounds.set_height(kDropIndicatorHeight); | 325 item_bounds.set_height(kDropIndicatorHeight); |
| 315 return item_bounds; | 326 return item_bounds; |
| 316 | 327 |
| 317 default: | 328 default: |
| 318 // Don't render anything for on. | 329 // Don't render anything for on. |
| 319 return gfx::Rect(); | 330 return gfx::Rect(); |
| 320 } | 331 } |
| 321 } | 332 } |
| 322 | 333 |
| 323 } // namespace views | 334 } // namespace views |
| OLD | NEW |