| 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..a8bc03f943b9a62e1e00fad9f7d0fa503c1b5a97
|
| --- /dev/null
|
| +++ b/ui/views/controls/menu/menu_runner_impl_adapter.h
|
| @@ -0,0 +1,44 @@
|
| +// 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 {
|
| + public:
|
| + explicit MenuRunnerImplAdapter(ui::MenuModel* menu_model);
|
| +
|
| + // MenuRunnerImplInterface:
|
| + virtual MenuItemView* GetMenu() const OVERRIDE;
|
| + 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_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MenuRunnerImplAdapter);
|
| +};
|
| +
|
| +} // namespace internal
|
| +} // namespace views
|
| +
|
| +#endif // UI_VIEWS_CONTROLS_MENU_MENU_RUNNER_IMPL_ADAPTER_H_
|
|
|