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

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

Issue 126092: Begin to upgrade BackForwardMenuModelViews to use new menu API.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ 5 #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_
6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ 6 #define VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 const std::wstring& label); 64 const std::wstring& label);
65 65
66 // Updates the local data structure with the correctly formatted version of 66 // Updates the local data structure with the correctly formatted version of
67 // |label| at the specified model_index, and adds string data to |mii| if 67 // |label| at the specified model_index, and adds string data to |mii| if
68 // the menu is not owner-draw. That's a mouthful. This function exists because 68 // the menu is not owner-draw. That's a mouthful. This function exists because
69 // of the peculiarities of the Windows menu API. 69 // of the peculiarities of the Windows menu API.
70 void UpdateMenuItemInfoForString(MENUITEMINFO* mii, 70 void UpdateMenuItemInfoForString(MENUITEMINFO* mii,
71 int model_index, 71 int model_index,
72 const std::wstring& label); 72 const std::wstring& label);
73 73
74 // Returns the NativeMenuWin object that contains an item with the specified
75 // command id. This function must only be called from RunMenuAt!
76 NativeMenuWin* GetMenuForCommandId(UINT command_id) const;
77
78 // Returns the alignment flags to be passed to TrackPopupMenuEx, based on the 74 // Returns the alignment flags to be passed to TrackPopupMenuEx, based on the
79 // supplied alignment and the UI text direction. 75 // supplied alignment and the UI text direction.
80 UINT GetAlignmentFlags(int alignment) const; 76 UINT GetAlignmentFlags(int alignment) const;
81 77
82 // Resets the native menu stored in |menu_| by destroying any old menu then 78 // Resets the native menu stored in |menu_| by destroying any old menu then
83 // creating a new empty one. 79 // creating a new empty one.
84 void ResetNativeMenu(); 80 void ResetNativeMenu();
85 81
86 // Creates the host window that receives notifications from the menu. 82 // Creates the host window that receives notifications from the menu.
87 void CreateHostWindow(); 83 void CreateHostWindow();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Overridden from SimpleMenuModel: 125 // Overridden from SimpleMenuModel:
130 virtual int FlipIndex(int index) const { return GetItemCount() - index - 1; } 126 virtual int FlipIndex(int index) const { return GetItemCount() - index - 1; }
131 127
132 private: 128 private:
133 DISALLOW_COPY_AND_ASSIGN(SystemMenuModel); 129 DISALLOW_COPY_AND_ASSIGN(SystemMenuModel);
134 }; 130 };
135 131
136 } // namespace views 132 } // namespace views
137 133
138 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_ 134 #endif // VIEWS_CONTROLS_MENU_NATIVE_MENU_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698