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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 137543006: Windows: only change default menu item if available. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleaner Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 60a7dc2193cdf5ee5463cb2bd0762d07833c596d..1901aadc7c7da2e42511a4ffb21a06d7632d2562 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1502,7 +1502,10 @@ void HWNDMessageHandler::OnInitMenu(HMENU menu) {
EnableMenuItemByCommand(menu, SC_MINIMIZE, delegate_->CanMaximize() &&
!is_minimized);
- ::SetMenuDefaultItem(menu, is_maximized ? SC_RESTORE : SC_MAXIMIZE, FALSE);
+ if (is_maximized)
+ ::SetMenuDefaultItem(menu, SC_RESTORE, FALSE);
+ else if (delegate_->CanMaximize())
+ ::SetMenuDefaultItem(menu, SC_MAXIMIZE, FALSE);
}
void HWNDMessageHandler::OnInputLangChange(DWORD character_set,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698