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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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
« no previous file with comments | « ui/views/controls/menu/menu_2.h ('k') | ui/views/controls/menu/menu_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 wrapper_(MenuWrapper::CreateWrapper(model)) {
15 Rebuild();
16 }
17
18 Menu2::~Menu2() {}
19
20 HMENU Menu2::GetNativeMenu() const {
21 return wrapper_->GetNativeMenu();
22 }
23
24 void Menu2::RunMenuAt(const gfx::Point& point, Alignment alignment) {
25 wrapper_->RunMenuAt(point, alignment);
26 }
27
28 void Menu2::RunContextMenuAt(const gfx::Point& point) {
29 RunMenuAt(point, ALIGN_TOPLEFT);
30 }
31
32 void Menu2::CancelMenu() {
33 wrapper_->CancelMenu();
34 }
35
36 void Menu2::Rebuild() {
37 wrapper_->Rebuild(NULL);
38 }
39
40 void Menu2::UpdateStates() {
41 wrapper_->UpdateStates();
42 }
43
44 MenuWrapper::MenuAction Menu2::GetMenuAction() const {
45 return wrapper_->GetMenuAction();
46 }
47
48 void Menu2::AddMenuListener(MenuListener* listener) {
49 wrapper_->AddMenuListener(listener);
50 }
51
52 void Menu2::RemoveMenuListener(MenuListener* listener) {
53 wrapper_->RemoveMenuListener(listener);
54 }
55
56 void Menu2::SetMinimumWidth(int width) {
57 wrapper_->SetMinimumWidth(width);
58 }
59
60 } // namespace
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_2.h ('k') | ui/views/controls/menu/menu_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698