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

Side by Side Diff: ui/views/controls/menu/menu_runner_impl_interface.h

Issue 331993009: MacViews: Run native Cocoa context menus to support Services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Fixes for sky. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/menu/menu_runner_impl_cocoa.mm ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_INTERFACE_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_INTERFACE_H_
7
8 #include "ui/views/controls/menu/menu_runner.h"
9
10 namespace views {
11
12 class MenuItemView;
13
14 namespace internal {
15
16 // An abstract interface for menu runner implementations.
17 // Invoke Release() to destroy. Release() deletes immediately if the menu isn't
18 // showing. If the menu is showing Release() cancels the menu and when the
19 // nested RunMenuAt() call returns deletes itself and the menu.
20 class MenuRunnerImplInterface {
21 public:
22 // Creates a concrete instance for running |menu_model|.
23 // |run_types| is a bitmask of MenuRunner::RunTypes.
24 static MenuRunnerImplInterface* Create(ui::MenuModel* menu_model,
25 int32 run_types);
26
27 // Returns the menu view, or NULL if the runner doesn't use a MenuItemView to
28 // run the menu.
29 virtual MenuItemView* GetMenu() const = 0;
sky 2014/07/15 20:36:38 It's unfortunate the MenuItemView has to be expose
Andre 2014/07/16 18:43:28 Done. I've removed GetMenu, see https://codereview
30
31 // Returns true if we're in a nested message loop running the menu.
32 virtual bool IsRunning() const = 0;
33
34 // See description above class for details.
35 virtual void Release() = 0;
36
37 // Runs the menu. See MenuRunner::RunMenuAt for more details.
38 virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
39 MenuButton* button,
40 const gfx::Rect& bounds,
41 MenuAnchorPosition anchor,
42 int32 run_types)
43 WARN_UNUSED_RESULT = 0;
44
45 // Hides and cancels the menu.
46 virtual void Cancel() = 0;
47
48 // Returns the time from the event which closed the menu - or 0.
49 virtual base::TimeDelta GetClosingEventTime() const = 0;
50
51 protected:
52 // Call Release() to delete.
53 virtual ~MenuRunnerImplInterface() {}
54 };
55
56 } // namespace internal
57 } // namespace views
58
59 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_INTERFACE_H_
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_runner_impl_cocoa.mm ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698