OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "views/controls/menu/menu_2.h" | 5 #include "views/controls/menu/menu_2.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "views/controls/menu/menu_wrapper.h" | 8 #include "views/controls/menu/menu_wrapper.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
11 | 11 |
12 Menu2::Menu2(ui::MenuModel* model) | 12 Menu2::Menu2(ui::MenuModel* model) |
13 : model_(model), | 13 : model_(model), |
14 ALLOW_THIS_IN_INITIALIZER_LIST( | 14 ALLOW_THIS_IN_INITIALIZER_LIST( |
15 wrapper_(MenuWrapper::CreateWrapper(this))) { | 15 wrapper_(MenuWrapper::CreateWrapper(this))) { |
16 Rebuild(); | 16 Rebuild(); |
17 } | 17 } |
18 | 18 |
| 19 Menu2::~Menu2() {} |
| 20 |
19 gfx::NativeMenu Menu2::GetNativeMenu() const { | 21 gfx::NativeMenu Menu2::GetNativeMenu() const { |
20 return wrapper_->GetNativeMenu(); | 22 return wrapper_->GetNativeMenu(); |
21 } | 23 } |
22 | 24 |
23 void Menu2::RunMenuAt(const gfx::Point& point, Alignment alignment) { | 25 void Menu2::RunMenuAt(const gfx::Point& point, Alignment alignment) { |
24 wrapper_->RunMenuAt(point, alignment); | 26 wrapper_->RunMenuAt(point, alignment); |
25 } | 27 } |
26 | 28 |
27 void Menu2::RunContextMenuAt(const gfx::Point& point) { | 29 void Menu2::RunContextMenuAt(const gfx::Point& point) { |
28 RunMenuAt(point, ALIGN_TOPLEFT); | 30 RunMenuAt(point, ALIGN_TOPLEFT); |
(...skipping 21 matching lines...) Expand all Loading... |
50 | 52 |
51 void Menu2::RemoveMenuListener(MenuListener* listener) { | 53 void Menu2::RemoveMenuListener(MenuListener* listener) { |
52 wrapper_->RemoveMenuListener(listener); | 54 wrapper_->RemoveMenuListener(listener); |
53 } | 55 } |
54 | 56 |
55 void Menu2::SetMinimumWidth(int width) { | 57 void Menu2::SetMinimumWidth(int width) { |
56 wrapper_->SetMinimumWidth(width); | 58 wrapper_->SetMinimumWidth(width); |
57 } | 59 } |
58 | 60 |
59 } // namespace | 61 } // namespace |
OLD | NEW |