Changeset 188969 in webkit
- Timestamp:
- Aug 26, 2015 10:33:49 AM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r188958 r188969 1 2015-08-26 Brent Fulgham <bfulgham@apple.com> 2 3 [Win] Simplify menu handling code in WinLauncher 4 https://bugs.webkit.org/show_bug.cgi?id=148461 5 6 Reviewed by Zalan Bujtas. 7 8 Revise 'ToggleMenuItem' to return a boolean value indicating if 9 it handled the message. Revise WndProc to use this to decide if it 10 should pass the message on to the default handler, rather than 11 duplicating the logic in both places. 12 13 * WinLauncher/Common.cpp: 14 (ToggleMenuItem): Return true if the menu item message was handled. 15 (WndProc): If 'ToggleMenuItem' did not handle the message, pass 16 the message tothe default handler. 17 1 18 2015-08-26 Csaba Osztrogonác <ossy@webkit.org> 2 19 -
trunk/Tools/WinLauncher/Common.cpp
r188939 r188969 360 360 } 361 361 362 static void ToggleMenuItem(HWND hWnd, UINT menuID) 363 { 362 static bool ToggleMenuItem(HWND hWnd, UINT menuID) 363 { 364 if (!gWinLauncher) 365 return false; 366 364 367 HMENU menu = ::GetMenu(hWnd); 365 368 … … 370 373 371 374 if (!::GetMenuItemInfo(menu, menuID, FALSE, &info)) 372 return ;375 return false; 373 376 374 377 BOOL newState = !menuItemIsChecked(info); 375 378 376 379 if (!gWinLauncher->standardPreferences() || !gWinLauncher->privatePreferences()) 377 return ;380 return false; 378 381 379 382 switch (menuID) { … … 423 426 turnOffOtherUserAgents(menu); 424 427 break; 428 default: 429 return false; 425 430 } 426 431 … … 428 433 429 434 ::SetMenuItemInfo(menu, menuID, FALSE, &info); 435 436 return true; 430 437 } 431 438 … … 488 495 gWinLauncher->navigateForwardOrBackward(hWnd, wmId); 489 496 break; 490 case IDM_AVFOUNDATION:491 case IDM_ACC_COMPOSITING:492 case IDM_WK_FULLSCREEN:493 case IDM_COMPOSITING_BORDERS:494 case IDM_INVERT_COLORS:495 case IDM_DISABLE_IMAGES:496 case IDM_DISABLE_STYLES:497 case IDM_DISABLE_JAVASCRIPT:498 case IDM_DISABLE_LOCAL_FILE_RESTRICTIONS:499 case IDM_UA_DEFAULT:500 case IDM_UA_SAFARI_8_0:501 case IDM_UA_SAFARI_IOS_8_IPHONE:502 case IDM_UA_SAFARI_IOS_8_IPAD:503 case IDM_UA_IE_11:504 case IDM_UA_CHROME_MAC:505 case IDM_UA_CHROME_WIN:506 case IDM_UA_FIREFOX_MAC:507 case IDM_UA_FIREFOX_WIN:508 ToggleMenuItem(hWnd, wmId);509 break;510 497 case IDM_UA_OTHER: 511 498 if (wmEvent) … … 527 514 break; 528 515 default: 529 return CallWindowProc(parentProc, hWnd, message, wParam, lParam); 516 if (!ToggleMenuItem(hWnd, wmId)) 517 return CallWindowProc(parentProc, hWnd, message, wParam, lParam); 530 518 } 531 519 }
Note: See TracChangeset
for help on using the changeset viewer.