summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authormlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 15:55:13 +0000
committermlamouri@chromium.org <mlamouri@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-07 15:55:13 +0000
commitbb027028c600804ee2637e3758c872a6e0fa85ee (patch)
tree081e11f43ac046329313a6d8bfd861e1f20c2ebd /ui
parentc8e704e7838993207d532256f64b78d74ccb7119 (diff)
downloadchromium_src-bb027028c600804ee2637e3758c872a6e0fa85ee.zip
chromium_src-bb027028c600804ee2637e3758c872a6e0fa85ee.tar.gz
chromium_src-bb027028c600804ee2637e3758c872a6e0fa85ee.tar.bz2
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
Diffstat (limited to 'ui')
-rw-r--r--ui/views/win/hwnd_message_handler.cc2
1 files changed, 2 insertions, 0 deletions
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,