From bb027028c600804ee2637e3758c872a6e0fa85ee Mon Sep 17 00:00:00 2001 From: "mlamouri@chromium.org" Date: Tue, 7 Jan 2014 15:55:13 +0000 Subject: Set the default action on the title bar menu properly on Windows. It is currently not set, thus chosen by the system. However, the default action is maximized when the window is not maximized and restore when the window is maximized. It is fixing the bug mentioned in bug 260229 as a side effect. The change is actually applying to all windows, not only Chrome Apps ones. BUG=260229 TEST=Open Chrome on Windows, right click on the title bar. Look at the item in bold. Double click. The action should match the name of the item in bold. Repeat another time. Review URL: https://codereview.chromium.org/113943005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243300 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/views/win/hwnd_message_handler.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui') diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc index 396184e..6859542 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -1453,6 +1453,8 @@ void HWNDMessageHandler::OnInitMenu(HMENU menu) { !is_fullscreen && !is_maximized); EnableMenuItemByCommand(menu, SC_MINIMIZE, delegate_->CanMaximize() && !is_minimized); + + ::SetMenuDefaultItem(menu, is_maximized ? SC_RESTORE : SC_MAXIMIZE, FALSE); } void HWNDMessageHandler::OnInputLangChange(DWORD character_set, -- cgit v1.1