diff options
Diffstat (limited to 'views/touchui/touch_selection_controller_impl.h')
-rw-r--r-- | views/touchui/touch_selection_controller_impl.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/views/touchui/touch_selection_controller_impl.h b/views/touchui/touch_selection_controller_impl.h index 6cb7816..480485d 100644 --- a/views/touchui/touch_selection_controller_impl.h +++ b/views/touchui/touch_selection_controller_impl.h @@ -6,6 +6,7 @@ #define VIEWS_TOUCHUI_TOUCH_SELECTION_CONTROLLER_IMPL_H_ #pragma once +#include "base/timer.h" #include "ui/gfx/point.h" #include "views/touchui/touch_selection_controller.h" #include "views/view.h" @@ -32,6 +33,7 @@ class VIEWS_EXPORT TouchSelectionControllerImpl private: friend class TouchSelectionControllerImplTest; class SelectionHandleView; + class TouchContextMenuView; // Callback to inform the client view that the selection handle has been // dragged, hence selection may need to be updated. @@ -41,6 +43,21 @@ class VIEWS_EXPORT TouchSelectionControllerImpl // system to that of the client view. void ConvertPointToClientView(SelectionHandleView* source, gfx::Point* point); + // Checks if the client view supports a context menu command. + bool IsCommandIdEnabled(int command_id) const; + + // Sends a context menu command to the client view. + void ExecuteCommand(int command_id); + + // Time to show context menu. + void ContextMenuTimerFired(); + + // Convenience method to update the position/visibility of the context menu. + void UpdateContextMenu(const gfx::Point& p1, const gfx::Point& p2); + + // Convenience method for hiding context menu. + void HideContextMenu(); + // Convenience methods for testing. gfx::Point GetSelectionHandle1Position(); gfx::Point GetSelectionHandle2Position(); @@ -50,6 +67,12 @@ class VIEWS_EXPORT TouchSelectionControllerImpl TouchSelectionClientView* client_view_; scoped_ptr<SelectionHandleView> selection_handle_1_; scoped_ptr<SelectionHandleView> selection_handle_2_; + scoped_ptr<TouchContextMenuView> context_menu_; + + // Timer to trigger |context_menu| (|context_menu| is not shown if the + // selection handles are being updated. It appears only when the handles are + // stationary for a certain amount of time). + base::OneShotTimer<TouchSelectionControllerImpl> context_menu_timer_; // Pointer to the SelectionHandleView being dragged during a drag session. SelectionHandleView* dragging_handle_; |