| 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 #include "ui/views/controls/menu/menu_controller.h" | 5 #include "ui/views/controls/menu/menu_controller.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 } | 616 } |
| 617 | 617 |
| 618 #if defined(OS_LINUX) | 618 #if defined(OS_LINUX) |
| 619 bool MenuController::OnMouseWheel(SubmenuView* source, | 619 bool MenuController::OnMouseWheel(SubmenuView* source, |
| 620 const MouseWheelEvent& event) { | 620 const MouseWheelEvent& event) { |
| 621 MenuPart part = GetMenuPart(source, event.location()); | 621 MenuPart part = GetMenuPart(source, event.location()); |
| 622 return part.submenu && part.submenu->OnMouseWheel(event); | 622 return part.submenu && part.submenu->OnMouseWheel(event); |
| 623 } | 623 } |
| 624 #endif | 624 #endif |
| 625 | 625 |
| 626 ui::GestureStatus MenuController::OnGestureEvent(SubmenuView* source, |
| 627 const GestureEvent& event) { |
| 628 MenuPart part = GetMenuPart(source, event.location()); |
| 629 if (!part.submenu) |
| 630 return ui::GESTURE_STATUS_UNKNOWN; |
| 631 return part.submenu->OnGestureEvent(event); |
| 632 } |
| 633 |
| 626 bool MenuController::GetDropFormats( | 634 bool MenuController::GetDropFormats( |
| 627 SubmenuView* source, | 635 SubmenuView* source, |
| 628 int* formats, | 636 int* formats, |
| 629 std::set<OSExchangeData::CustomFormat>* custom_formats) { | 637 std::set<OSExchangeData::CustomFormat>* custom_formats) { |
| 630 return source->GetMenuItem()->GetDelegate()->GetDropFormats( | 638 return source->GetMenuItem()->GetDelegate()->GetDropFormats( |
| 631 source->GetMenuItem(), formats, custom_formats); | 639 source->GetMenuItem(), formats, custom_formats); |
| 632 } | 640 } |
| 633 | 641 |
| 634 bool MenuController::AreDropTypesRequired(SubmenuView* source) { | 642 bool MenuController::AreDropTypesRequired(SubmenuView* source) { |
| 635 return source->GetMenuItem()->GetDelegate()->AreDropTypesRequired( | 643 return source->GetMenuItem()->GetDelegate()->AreDropTypesRequired( |
| (...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 // is necessary to exit from nested loop (See Dispatch methods). | 1996 // is necessary to exit from nested loop (See Dispatch methods). |
| 1989 // Send non-op event so that Dispatch method will always be called. | 1997 // Send non-op event so that Dispatch method will always be called. |
| 1990 // crbug.com/104684. | 1998 // crbug.com/104684. |
| 1991 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) | 1999 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) |
| 1992 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); | 2000 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); |
| 1993 #endif | 2001 #endif |
| 1994 } | 2002 } |
| 1995 | 2003 |
| 1996 | 2004 |
| 1997 } // namespace views | 2005 } // namespace views |
| OLD | NEW |