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.
5 #include "ui/views/controls/menu/menu_runner_impl_adapter.h"
7 #include "ui/views/controls/menu/menu_model_adapter.h"
8 #include "ui/views/controls/menu/menu_runner_impl.h"
13 MenuRunnerImplAdapter::MenuRunnerImplAdapter(ui::MenuModel
* menu_model
)
14 : menu_model_adapter_(new MenuModelAdapter(menu_model
)),
15 impl_(new MenuRunnerImpl(menu_model_adapter_
->CreateMenu())) {
18 bool MenuRunnerImplAdapter::IsRunning() const {
19 return impl_
->IsRunning();
22 void MenuRunnerImplAdapter::Release() {
27 MenuRunner::RunResult
MenuRunnerImplAdapter::RunMenuAt(
30 const gfx::Rect
& bounds
,
31 MenuAnchorPosition anchor
,
33 return impl_
->RunMenuAt(parent
, button
, bounds
, anchor
, types
);
36 void MenuRunnerImplAdapter::Cancel() {
40 base::TimeDelta
MenuRunnerImplAdapter::GetClosingEventTime() const {
41 return impl_
->GetClosingEventTime();
44 MenuRunnerImplAdapter::~MenuRunnerImplAdapter() {
47 } // namespace internal