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

Unified Diff: ui/views/events/context_menu_controller.h

Issue 6286013: V2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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/demo/main.cc ('k') | ui/views/events/drag_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/events/context_menu_controller.h
===================================================================
--- ui/views/events/context_menu_controller.h (revision 0)
+++ ui/views/events/context_menu_controller.h (revision 0)
@@ -0,0 +1,47 @@
+// Copyright (c) 2011 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.
+
+#ifndef UI_VIEWS_EVENTS_CONTEXT_MENU_CONTROLLER_H_
+#define UI_VIEWS_EVENTS_CONTEXT_MENU_CONTROLLER_H_
+#pragma once
+
+namespace gfx {
+class Point;
+}
+
+namespace ui {
+
+class View;
+
+// ContextMenuController is responsible for showing the context menu for a
+// View. To use a ContextMenuController invoke SetContextMenuController on a
+// View. When the appropriate user gesture occurs ShowContextMenu is invoked
+// on the ContextMenuController.
+//
+// Setting a ContextMenuController on a View makes the View process mouse
+// events.
+//
+// It is up to subclasses that do their own mouse processing to invoke
+// the appropriate ContextMenuController method, typically by invoking super's
+// implementation for mouse processing.
+//
+class ContextMenuController {
+ public:
+ // Invoked to show the context menu for the source view. If |is_mouse_gesture|
+ // is true, |point| is the location of the mouse. If |is_mouse_gesture| is
+ // false, this method was not invoked by a mouse gesture and |point| is the
+ // recommended location to show the menu at.
+ //
+ // |point| is in screen coordinates.
+ virtual void ShowContextMenu(View* source,
+ const gfx::Point& point,
+ bool is_mouse_gesture) = 0;
+
+ protected:
+ virtual ~ContextMenuController() {}
+};
+
+} // namespace ui
+
+#endif // UI_VIEWS_EVENTS_CONTEXT_MENU_CONTROLLER_H_
Property changes on: ui\views\events\context_menu_controller.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « ui/views/demo/main.cc ('k') | ui/views/events/drag_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698