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

Side by Side Diff: ui/views/controls/menu/native_menu_views.h

Issue 8909007: Removing deprecated touchui code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years 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
« no previous file with comments | « no previous file | ui/views/controls/menu/native_menu_views.cc » ('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) 2011 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 #ifndef UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_VIEWS_H_
6 #define UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_VIEWS_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "ui/views/controls/menu/menu_delegate.h"
13 #include "ui/views/controls/menu/menu_wrapper.h"
14
15 namespace ui {
16 class MenuModel;
17 }
18
19 namespace views {
20
21 class MenuItemView;
22 class MenuRunner;
23
24 // A views implementation of MenuWrapper, used currently for touchui.
25 class NativeMenuViews : public MenuWrapper,
26 public MenuDelegate {
27 public:
28 explicit NativeMenuViews(Menu2* menu);
29 virtual ~NativeMenuViews();
30
31 // Overridden from MenuWrapper:
32 virtual void RunMenuAt(const gfx::Point& point, int alignment) OVERRIDE;
33 virtual void CancelMenu() OVERRIDE;
34 virtual void Rebuild() OVERRIDE;
35 virtual void UpdateStates() OVERRIDE;
36 virtual gfx::NativeMenu GetNativeMenu() const OVERRIDE;
37 virtual MenuAction GetMenuAction() const OVERRIDE;
38 virtual void AddMenuListener(MenuListener* listener) OVERRIDE;
39 virtual void RemoveMenuListener(MenuListener* listener) OVERRIDE;
40 virtual void SetMinimumWidth(int width) OVERRIDE;
41
42 // Overridden from MenuDelegate:
43 virtual bool IsItemChecked(int id) const OVERRIDE;
44 virtual bool IsCommandEnabled(int id) const OVERRIDE;
45 virtual void ExecuteCommand(int id) OVERRIDE;
46 virtual bool GetAccelerator(int id, ui::Accelerator* accelerator) OVERRIDE;
47
48 private:
49 void AddMenuItemsFromModel(MenuItemView* parent, ui::MenuModel* model);
50 void UpdateMenuFromModel(SubmenuView* menu, ui::MenuModel* model);
51
52 // The attached model and delegate. Does not assume ownership.
53 ui::MenuModel* model_;
54 MenuItemView* root_;
55 scoped_ptr<MenuRunner> menu_runner_;
56
57 DISALLOW_COPY_AND_ASSIGN(NativeMenuViews);
58 };
59
60 } // namespace views
61
62 #endif // UI_VIEWS_CONTROLS_MENU_NATIVE_MENU_VIEWS_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/native_menu_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698