Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Side by Side Diff: ui/views/controls/menu/menu_controller.cc

Issue 8508024: Support touch scroll gestures in menus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Gardening. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 // MouseEntered is always followed by a mouse moved, so don't need to 614 // MouseEntered is always followed by a mouse moved, so don't need to
615 // do anything here. 615 // do anything here.
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
625 ui::GestureStatus MenuController::OnGestureEvent(SubmenuView* source,
626 const GestureEvent& event) {
627 MenuPart part = GetMenuPart(source, event.location());
628 if (!part.submenu)
629 return ui::GESTURE_STATUS_UNKNOWN;
630 return part.submenu->OnGestureEvent(event);
631 }
624 #endif 632 #endif
625 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
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698