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

Side by Side Diff: views/controls/menu/native_menu_x.h

Issue 7746012: Fixes the touch build from patch @ 98179 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
« no previous file with comments | « no previous file | views/controls/menu/native_menu_x.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 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 #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_X_H_ 5 #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_X_H_
6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_X_H_ 6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_X_H_
7 #pragma once 7 #pragma once
8 8
9 #include "views/controls/menu/menu_delegate.h" 9 #include "views/controls/menu/menu_delegate.h"
10 #include "views/controls/menu/menu_item_view.h" 10 #include "views/controls/menu/menu_item_view.h"
11 #include "views/controls/menu/menu_wrapper.h" 11 #include "views/controls/menu/menu_wrapper.h"
12 12
13 namespace ui { 13 namespace ui {
14 class MenuModel; 14 class MenuModel;
15 } 15 }
16 16
17 namespace views { 17 namespace views {
18 18
19 class MenuRunner;
20
19 // A non-GTK implementation of MenuWrapper, used currently for touchui. 21 // A non-GTK implementation of MenuWrapper, used currently for touchui.
20 class NativeMenuX : public MenuWrapper, 22 class NativeMenuX : public MenuWrapper,
21 public MenuDelegate { 23 public MenuDelegate {
22 public: 24 public:
23 explicit NativeMenuX(Menu2* menu); 25 explicit NativeMenuX(Menu2* menu);
24 virtual ~NativeMenuX(); 26 virtual ~NativeMenuX();
25 27
26 // Overridden from MenuWrapper: 28 // Overridden from MenuWrapper:
27 virtual void RunMenuAt(const gfx::Point& point, int alignment); 29 virtual void RunMenuAt(const gfx::Point& point, int alignment);
28 virtual void CancelMenu(); 30 virtual void CancelMenu();
(...skipping 10 matching lines...) Expand all
39 virtual bool IsCommandEnabled(int id) const; 41 virtual bool IsCommandEnabled(int id) const;
40 virtual void ExecuteCommand(int id); 42 virtual void ExecuteCommand(int id);
41 virtual bool GetAccelerator(int id, views::Accelerator* accelerator); 43 virtual bool GetAccelerator(int id, views::Accelerator* accelerator);
42 44
43 private: 45 private:
44 void AddMenuItemsFromModel(MenuItemView* parent, ui::MenuModel* model); 46 void AddMenuItemsFromModel(MenuItemView* parent, ui::MenuModel* model);
45 void UpdateMenuFromModel(SubmenuView* menu, ui::MenuModel* model); 47 void UpdateMenuFromModel(SubmenuView* menu, ui::MenuModel* model);
46 48
47 // The attached model and delegate. Does not assume ownership. 49 // The attached model and delegate. Does not assume ownership.
48 ui::MenuModel* model_; 50 ui::MenuModel* model_;
49 scoped_ptr<MenuItemView> root_; 51 MenuItemView* root_;
52 scoped_ptr<MenuRunner> menu_runner_;
50 53
51 DISALLOW_COPY_AND_ASSIGN(NativeMenuX); 54 DISALLOW_COPY_AND_ASSIGN(NativeMenuX);
52 }; 55 };
53 56
54 } // namespace views 57 } // namespace views
55 58
56 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_X_H_ 59 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_X_H_
OLDNEW
« no previous file with comments | « no previous file | views/controls/menu/native_menu_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698