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

Unified Diff: views/touchui/touch_selection_controller_impl.h

Issue 7740024: Implement touch selection menu. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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
Index: views/touchui/touch_selection_controller_impl.h
diff --git a/views/touchui/touch_selection_controller_impl.h b/views/touchui/touch_selection_controller_impl.h
index 00ade4103c9f8dc752cbdc9001e3795a1f8b8473..7439efb2bc766dd40f156a460251d2af873398c7 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"
@@ -30,6 +31,7 @@ class TouchSelectionControllerImpl : public TouchSelectionController {
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.
@@ -39,6 +41,21 @@ class TouchSelectionControllerImpl : public TouchSelectionController {
// 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();
@@ -48,6 +65,9 @@ class TouchSelectionControllerImpl : public TouchSelectionController {
TouchSelectionClientView* client_view_;
scoped_ptr<SelectionHandleView> selection_handle_1_;
scoped_ptr<SelectionHandleView> selection_handle_2_;
+ scoped_ptr<TouchContextMenuView> context_menu_;
+ base::OneShotTimer<TouchSelectionControllerImpl> context_menu_timer_;
sky 2011/08/26 15:45:33 Description?
varunjain 2011/08/26 16:31:15 Done.
+ gfx::Point context_menu_screen_pos_;
// Pointer to the SelectionHandleView being dragged during a drag session.
SelectionHandleView* dragging_handle_;

Powered by Google App Engine
This is Rietveld 408576698