1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_CONTEXT_MENU_CONTROLLER_H_
6 #define UI_VIEWS_CONTEXT_MENU_CONTROLLER_H_
8 #include "ui/views/views_export.h"
17 // ContextMenuController is responsible for showing the context menu for a
18 // View. To use a ContextMenuController invoke set_context_menu_controller on a
19 // View. When the appropriate user gesture occurs ShowContextMenu is invoked
20 // on the ContextMenuController.
22 // Setting a ContextMenuController on a view makes the view process mouse
25 // It is up to subclasses that do their own mouse processing to invoke
26 // the appropriate ContextMenuController method, typically by invoking super's
27 // implementation for mouse processing.
28 class VIEWS_EXPORT ContextMenuController
{
30 // Invoked to show the context menu for |source|.
31 // |point| is in screen coordinates.
32 virtual void ShowContextMenuForView(View
* source
,
33 const gfx::Point
& point
) = 0;
36 virtual ~ContextMenuController() {}
41 #endif // UI_VIEWS_CONTEXT_MENU_CONTROLLER_H_