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

Side by Side Diff: ui/views/controls/menu/menu_runner_impl_adapter.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
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_ADAPTER_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_
7
8 #include "ui/views/controls/menu/menu_runner_impl_interface.h"
9
10 namespace views {
11 namespace internal {
12
13 class MenuRunnerImpl;
14
15 // Given a MenuModel, adapts MenuRunnerImpl which expects a MenuItemView.
16 class MenuRunnerImplAdapter : public MenuRunnerImplInterface {
17 public:
18 explicit MenuRunnerImplAdapter(ui::MenuModel* menu_model);
19
20 // MenuRunnerImplInterface:
21 virtual MenuItemView* GetMenu() const OVERRIDE;
22 virtual bool IsRunning() const OVERRIDE;
23 virtual void Release() OVERRIDE;
24 virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
25 MenuButton* button,
26 const gfx::Rect& bounds,
27 MenuAnchorPosition anchor,
28 int32 types) OVERRIDE;
29 virtual void Cancel() OVERRIDE;
30 virtual base::TimeDelta GetClosingEventTime() const OVERRIDE;
31
32 private:
33 virtual ~MenuRunnerImplAdapter();
34
35 scoped_ptr<MenuModelAdapter> menu_model_adapter_;
36 MenuRunnerImpl* impl_;
37
38 DISALLOW_COPY_AND_ASSIGN(MenuRunnerImplAdapter);
39 };
40
41 } // namespace internal
42 } // namespace views
43
44 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698