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

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

Issue 14150005: views: Finally get rid of the deprecated Menu2 API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm comment Created 7 years, 8 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 (c) 2012 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_2.h"
6
7 #include "ui/base/models/menu_model.h"
8 #include "ui/views/controls/menu/menu_listener.h"
9
10 namespace views {
11
12 Menu2::Menu2(ui::MenuModel* model)
13 : model_(model),
14 ALLOW_THIS_IN_INITIALIZER_LIST(
15 wrapper_(MenuWrapper::CreateWrapper(model))) {
16 Rebuild();
17 }
18
19 Menu2::~Menu2() {}
20
21 HMENU Menu2::GetNativeMenu() const {
22 return wrapper_->GetNativeMenu();
23 }
24
25 void Menu2::RunMenuAt(const gfx::Point& point, Alignment alignment) {
26 wrapper_->RunMenuAt(point, alignment);
27 }
28
29 void Menu2::RunContextMenuAt(const gfx::Point& point) {
30 RunMenuAt(point, ALIGN_TOPLEFT);
31 }
32
33 void Menu2::CancelMenu() {
34 wrapper_->CancelMenu();
35 }
36
37 void Menu2::Rebuild() {
38 wrapper_->Rebuild(NULL);
39 }
40
41 void Menu2::UpdateStates() {
42 wrapper_->UpdateStates();
43 }
44
45 MenuWrapper::MenuAction Menu2::GetMenuAction() const {
46 return wrapper_->GetMenuAction();
47 }
48
49 void Menu2::AddMenuListener(MenuListener* listener) {
50 wrapper_->AddMenuListener(listener);
51 }
52
53 void Menu2::RemoveMenuListener(MenuListener* listener) {
54 wrapper_->RemoveMenuListener(listener);
55 }
56
57 void Menu2::SetMinimumWidth(int width) {
58 wrapper_->SetMinimumWidth(width);
59 }
60
61 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698