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

Side by Side Diff: 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 9 years, 1 month 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) 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/menu_controller.h" 5 #include "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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 // MouseEntered is always followed by a mouse moved, so don't need to 603 // MouseEntered is always followed by a mouse moved, so don't need to
604 // do anything here. 604 // do anything here.
605 } 605 }
606 606
607 #if defined(OS_LINUX) 607 #if defined(OS_LINUX)
608 bool MenuController::OnMouseWheel(SubmenuView* source, 608 bool MenuController::OnMouseWheel(SubmenuView* source,
609 const MouseWheelEvent& event) { 609 const MouseWheelEvent& event) {
610 MenuPart part = GetMenuPart(source, event.location()); 610 MenuPart part = GetMenuPart(source, event.location());
611 return part.submenu && part.submenu->OnMouseWheel(event); 611 return part.submenu && part.submenu->OnMouseWheel(event);
612 } 612 }
613
614 ui::GestureStatus MenuController::OnGestureEvent(SubmenuView* source,
615 const GestureEvent& event) {
616 MenuPart part = GetMenuPart(source, event.location());
617 if (!part.submenu)
618 return ui::GESTURE_STATUS_UNKNOWN;
619 return part.submenu->OnGestureEvent(event);
620 }
613 #endif 621 #endif
614 622
615 bool MenuController::GetDropFormats( 623 bool MenuController::GetDropFormats(
616 SubmenuView* source, 624 SubmenuView* source,
617 int* formats, 625 int* formats,
618 std::set<OSExchangeData::CustomFormat>* custom_formats) { 626 std::set<OSExchangeData::CustomFormat>* custom_formats) {
619 return source->GetMenuItem()->GetDelegate()->GetDropFormats( 627 return source->GetMenuItem()->GetDelegate()->GetDropFormats(
620 source->GetMenuItem(), formats, custom_formats); 628 source->GetMenuItem(), formats, custom_formats);
621 } 629 }
622 630
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1955 return; 1963 return;
1956 1964
1957 // Reset the active_mouse_view_ before sending mouse capture lost. That way if 1965 // Reset the active_mouse_view_ before sending mouse capture lost. That way if
1958 // it calls back to us, we aren't in a weird state. 1966 // it calls back to us, we aren't in a weird state.
1959 View* active_view = active_mouse_view_; 1967 View* active_view = active_mouse_view_;
1960 active_mouse_view_ = NULL; 1968 active_mouse_view_ = NULL;
1961 active_view->OnMouseCaptureLost(); 1969 active_view->OnMouseCaptureLost();
1962 } 1970 }
1963 1971
1964 } // namespace views 1972 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698