OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/menu_controller.h" | 5 #include "views/controls/menu/menu_controller.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "ui/base/dragdrop/os_exchange_data.h" | 10 #include "ui/base/dragdrop/os_exchange_data.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 gfx::CanvasSkia canvas(item->width(), item->height(), false); | 456 gfx::CanvasSkia canvas(item->width(), item->height(), false); |
457 item->Paint(&canvas, true); | 457 item->Paint(&canvas, true); |
458 | 458 |
459 OSExchangeData data; | 459 OSExchangeData data; |
460 item->GetDelegate()->WriteDragData(item, &data); | 460 item->GetDelegate()->WriteDragData(item, &data); |
461 drag_utils::SetDragImageOnDataObject(canvas, item->size(), press_loc, | 461 drag_utils::SetDragImageOnDataObject(canvas, item->size(), press_loc, |
462 &data); | 462 &data); |
463 StopScrolling(); | 463 StopScrolling(); |
464 int drag_ops = item->GetDelegate()->GetDragOperations(item); | 464 int drag_ops = item->GetDelegate()->GetDragOperations(item); |
465 drag_in_progress_ = true; | 465 drag_in_progress_ = true; |
466 item->GetRootView()->StartDragForViewFromMouseEvent( | 466 item->GetWidget()->StartDragForViewFromMouseEvent(NULL, data, drag_ops); |
467 NULL, data, drag_ops); | |
468 drag_in_progress_ = false; | 467 drag_in_progress_ = false; |
469 | 468 |
470 if (GetActiveInstance() == this) { | 469 if (GetActiveInstance() == this) { |
471 if (showing_) { | 470 if (showing_) { |
472 // We're still showing, close all menus. | 471 // We're still showing, close all menus. |
473 CloseAllNestedMenus(); | 472 CloseAllNestedMenus(); |
474 Cancel(EXIT_ALL); | 473 Cancel(EXIT_ALL); |
475 } // else case, drop was on us. | 474 } // else case, drop was on us. |
476 } // else case, someone canceled us, don't do anything | 475 } // else case, someone canceled us, don't do anything |
477 } | 476 } |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1835 | 1834 |
1836 MouseEvent release_event(ui::ET_MOUSE_RELEASED, -1, -1, 0); | 1835 MouseEvent release_event(ui::ET_MOUSE_RELEASED, -1, -1, 0); |
1837 // Reset the active_mouse_view_ before sending mouse released. That way if if | 1836 // Reset the active_mouse_view_ before sending mouse released. That way if if |
1838 // calls back to use we aren't in a weird state. | 1837 // calls back to use we aren't in a weird state. |
1839 View* active_view = active_mouse_view_; | 1838 View* active_view = active_mouse_view_; |
1840 active_mouse_view_ = NULL; | 1839 active_mouse_view_ = NULL; |
1841 active_view->OnMouseReleased(release_event, true); | 1840 active_view->OnMouseReleased(release_event, true); |
1842 } | 1841 } |
1843 | 1842 |
1844 } // namespace views | 1843 } // namespace views |
OLD | NEW |