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

Unified Diff: ui/views/controls/menu/submenu_view.h

Issue 8508024: Support touch scroll gestures in menus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win_aura 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.cc ('k') | ui/views/controls/menu/submenu_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/submenu_view.h
diff --git a/ui/views/controls/menu/submenu_view.h b/ui/views/controls/menu/submenu_view.h
index d4d0497df4db455db0967e1e8c921849e38bb739..40981a25605162886cab14c6adbeaff36bdb1c86 100644
--- a/ui/views/controls/menu/submenu_view.h
+++ b/ui/views/controls/menu/submenu_view.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,6 +9,7 @@
#include <string>
#include "base/compiler_specific.h"
+#include "ui/views/animation/scroll_animator.h"
#include "ui/views/controls/menu/menu_delegate.h"
#include "ui/views/view.h"
@@ -33,7 +34,8 @@ class MenuScrollViewContainer;
// MenuScrollViewContainer handles showing as much of the SubmenuView as the
// screen allows. If the SubmenuView is taller than the screen, scroll buttons
// are provided that allow the user to see all the menu items.
-class VIEWS_EXPORT SubmenuView : public View {
+class VIEWS_EXPORT SubmenuView : public View,
+ public ScrollDelegate {
public:
// The submenu's class name.
static const char kViewClassName[];
@@ -74,6 +76,9 @@ class VIEWS_EXPORT SubmenuView : public View {
// Scrolls on menu item boundaries.
virtual bool OnMouseWheel(const MouseWheelEvent& e) OVERRIDE;
+ // Scrolls on menu item boundaries.
+ virtual ui::GestureStatus OnGestureEvent(const GestureEvent& e) OVERRIDE;
+
// Returns true if the menu is showing.
bool IsShowing();
@@ -170,6 +175,9 @@ class VIEWS_EXPORT SubmenuView : public View {
gfx::Rect CalculateDropIndicatorBounds(MenuItemView* item,
MenuDelegate::DropPosition position);
+ // Implementation of ScrollDelegate
+ virtual void OnScroll(float dx, float dy) OVERRIDE;
+
// Parent menu item.
MenuItemView* parent_menu_item_;
@@ -196,6 +204,9 @@ class VIEWS_EXPORT SubmenuView : public View {
// Reposition open menu when contained views change size.
bool resize_open_menu_;
+ // The submenu's scroll animator
+ scoped_ptr<ScrollAnimator> scroll_animator_;
+
DISALLOW_COPY_AND_ASSIGN(SubmenuView);
};
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.cc ('k') | ui/views/controls/menu/submenu_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698