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

Side by Side Diff: ui/views/controls/menu/menu_runner_impl_adapter.cc

Issue 331993009: MacViews: Run native Cocoa context menus to support Services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Fixes for sky. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #include "ui/views/controls/menu/menu_runner_impl_adapter.h"
6
7 #include "ui/views/controls/menu/menu_model_adapter.h"
8 #include "ui/views/controls/menu/menu_runner_impl.h"
9
10 namespace views {
11 namespace internal {
12
13 MenuRunnerImplAdapter::MenuRunnerImplAdapter(ui::MenuModel* menu_model)
14 : menu_model_adapter_(new MenuModelAdapter(menu_model)),
15 impl_(new MenuRunnerImpl(menu_model_adapter_->CreateMenu())) {
16 }
17
18 MenuItemView* MenuRunnerImplAdapter::GetMenu() const {
19 return impl_->GetMenu();
20 }
21
22 bool MenuRunnerImplAdapter::IsRunning() const {
23 return impl_->IsRunning();
24 }
25
26 void MenuRunnerImplAdapter::Release() {
27 impl_->Release();
28 delete this;
29 }
30
31 MenuRunner::RunResult MenuRunnerImplAdapter::RunMenuAt(
32 Widget* parent,
33 MenuButton* button,
34 const gfx::Rect& bounds,
35 MenuAnchorPosition anchor,
36 int32 types) {
37 return impl_->RunMenuAt(parent, button, bounds, anchor, types);
38 }
39
40 void MenuRunnerImplAdapter::Cancel() {
41 impl_->Cancel();
42 }
43
44 base::TimeDelta MenuRunnerImplAdapter::GetClosingEventTime() const {
45 return impl_->GetClosingEventTime();
46 }
47
48 MenuRunnerImplAdapter::~MenuRunnerImplAdapter() {
49 }
50
51 } // namespace internal
52 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698