[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / ui / views / context_menu_controller.h
blob23ebd2730d0bd4a07aa9d548377a162f3f8070eb
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"
10 namespace gfx {
11 class Point;
14 namespace views {
15 class View;
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
23 // events.
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 {
29 public:
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;
35 protected:
36 virtual ~ContextMenuController() {}
39 } // namespace views
41 #endif // UI_VIEWS_CONTEXT_MENU_CONTROLLER_H_