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

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

Issue 331993009: MacViews: Run native Cocoa context menus to support Services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add VIEWS_EXPORT for unit test access 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
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_COCOA_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_COCOA_H_
7
8 #include "ui/views/controls/menu/menu_runner_impl_interface.h"
9
10 #import "base/mac/scoped_nsobject.h"
11 #include "base/time/time.h"
12
13 @class MenuController;
14
15 namespace views {
16 namespace internal {
17
18 // A menu runner implementation that uses NSMenu to show a context menu.
19 class VIEWS_EXPORT MenuRunnerImplCocoa : public MenuRunnerImplInterface {
20 public:
21 explicit MenuRunnerImplCocoa(ui::MenuModel* menu);
22
23 virtual MenuItemView* GetMenu() const OVERRIDE;
24 virtual bool IsRunning() const OVERRIDE;
25 virtual void Release() OVERRIDE;
26 virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
27 MenuButton* button,
28 const gfx::Rect& bounds,
29 MenuAnchorPosition anchor,
30 int32 run_types) OVERRIDE;
31 virtual void Cancel() OVERRIDE;
32 virtual base::TimeDelta GetClosingEventTime() const OVERRIDE;
33
34 private:
35 virtual ~MenuRunnerImplCocoa();
36
37 // The Cocoa menu controller that this instance is bridging.
38 base::scoped_nsobject<MenuController> menu_controller_;
39
40 // Set if |running_| and Release() has been invoked.
41 bool delete_after_run_;
42
43 // The timestamp of the event which closed the menu - or 0.
44 base::TimeDelta closing_event_time_;
45
46 DISALLOW_COPY_AND_ASSIGN(MenuRunnerImplCocoa);
47 };
48
49 } // namespace internal
50 } // namespace views
51
52 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_COCOA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698