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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/menu/menu_runner_impl_adapter.h
diff --git a/ui/views/controls/menu/menu_runner_impl_adapter.h b/ui/views/controls/menu/menu_runner_impl_adapter.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f407141ca5e6c2133db5e4a0faffab0bc7d3b38
--- /dev/null
+++ b/ui/views/controls/menu/menu_runner_impl_adapter.h
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_
+#define UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_
+
+#include "ui/views/controls/menu/menu_runner_impl_interface.h"
+
+namespace views {
+namespace internal {
+
+class MenuRunnerImpl;
+
+// Given a MenuModel, adapts MenuRunnerImpl which expects a MenuItemView.
+class MenuRunnerImplAdapter : public MenuRunnerImplInterface {
sky 2014/07/14 21:02:22 This class confused me a bit. Is there a reason no
Andre 2014/07/14 22:59:42 I created this mainly so that I don't have create
sky 2014/07/15 04:33:44 How about a helper class that both use then?
+ public:
+ explicit MenuRunnerImplAdapter(ui::MenuModel* menu_model);
+
+ virtual MenuItemView* GetMenu() const OVERRIDE;
sky 2014/07/14 21:02:22 Prefix wit // MenuRunnerImplyInterface: (or someth
Andre 2014/07/14 22:59:42 Done.
+ virtual bool IsRunning() const OVERRIDE;
+ virtual void Release() OVERRIDE;
+ virtual MenuRunner::RunResult RunMenuAt(Widget* parent,
+ MenuButton* button,
+ const gfx::Rect& bounds,
+ MenuAnchorPosition anchor,
+ int32 types) OVERRIDE;
+ virtual void Cancel() OVERRIDE;
+ virtual base::TimeDelta GetClosingEventTime() const OVERRIDE;
+
+ private:
+ virtual ~MenuRunnerImplAdapter();
+
+ scoped_ptr<MenuModelAdapter> menu_model_adapter_;
+ MenuRunnerImpl* impl_;
+};
sky 2014/07/14 21:02:22 DISALLOW_...
Andre 2014/07/14 22:59:42 Done.
+
+} // namespace internal
+} // namespace views
+
+#endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698