Add ICU message format support
[chromium-blink-merge.git] / ui / views / controls / menu / menu_runner_impl_adapter.cc
blob2e6822e7896edcd9dd5cef2c8bc1ab24c4fa74ba
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"
10 namespace views {
11 namespace internal {
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() {
23 impl_->Release();
24 delete this;
27 MenuRunner::RunResult MenuRunnerImplAdapter::RunMenuAt(
28 Widget* parent,
29 MenuButton* button,
30 const gfx::Rect& bounds,
31 MenuAnchorPosition anchor,
32 int32 types) {
33 return impl_->RunMenuAt(parent, button, bounds, anchor, types);
36 void MenuRunnerImplAdapter::Cancel() {
37 impl_->Cancel();
40 base::TimeDelta MenuRunnerImplAdapter::GetClosingEventTime() const {
41 return impl_->GetClosingEventTime();
44 MenuRunnerImplAdapter::~MenuRunnerImplAdapter() {
47 } // namespace internal
48 } // namespace views