position_to_select_(-1),
menu_to_select_factory_(this),
parent_(NULL),
- destroyed_flag_(NULL) {
+ destroyed_flag_(NULL),
+ create_as_window_menu_(false) {
}
NativeMenuWin::~NativeMenuWin() {
} else {
if (menu_)
DestroyMenu(menu_);
- menu_ = CreatePopupMenu();
+ menu_ = create_as_window_menu_ ? CreateMenu() : CreatePopupMenu();
// Rather than relying on the return value of TrackPopupMenuEx, which is
// always a command identifier, instead we tell the menu to notify us via
// our host window and the WM_MENUCOMMAND message.
virtual void RemoveMenuListener(views::MenuListener* listener) OVERRIDE;
virtual void SetMinimumWidth(int width) OVERRIDE;
+ // Flag to create a window menu instead of popup menu.
+ void set_create_as_window_menu(bool flag) { create_as_window_menu_ = flag; }
+ bool create_as_window_menu() const { return create_as_window_menu_; }
+
private:
// IMPORTANT: Note about indices.
// Functions in this class deal in two index spaces:
// events doesn't have a mechanism to get a user data pointer.
static NativeMenuWin* open_native_menu_win_;
+ // Create as window menu.
+ bool create_as_window_menu_;
+
DISALLOW_COPY_AND_ASSIGN(NativeMenuWin);
};