Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 { | |
|
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?
| |
| 17 public: | |
| 18 explicit MenuRunnerImplAdapter(ui::MenuModel* menu_model); | |
| 19 | |
| 20 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.
| |
| 21 virtual bool IsRunning() const OVERRIDE; | |
| 22 virtual void Release() OVERRIDE; | |
| 23 virtual MenuRunner::RunResult RunMenuAt(Widget* parent, | |
| 24 MenuButton* button, | |
| 25 const gfx::Rect& bounds, | |
| 26 MenuAnchorPosition anchor, | |
| 27 int32 types) OVERRIDE; | |
| 28 virtual void Cancel() OVERRIDE; | |
| 29 virtual base::TimeDelta GetClosingEventTime() const OVERRIDE; | |
| 30 | |
| 31 private: | |
| 32 virtual ~MenuRunnerImplAdapter(); | |
| 33 | |
| 34 scoped_ptr<MenuModelAdapter> menu_model_adapter_; | |
| 35 MenuRunnerImpl* impl_; | |
| 36 }; | |
|
sky
2014/07/14 21:02:22
DISALLOW_...
Andre
2014/07/14 22:59:42
Done.
| |
| 37 | |
| 38 } // namespace internal | |
| 39 } // namespace views | |
| 40 | |
| 41 #endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_ | |
| OLD | NEW |