[ios] Made IDC_BACK and IDC_FORWARD safe.
NavigationManager's GoBack() and GoForward() crash if navigation is not possible. This mirrors NavigationController's behavior so NavigationManager should only be changed along with NavigationController. KeyCommandsProvider sends IDC_FORWARD and IDC_BACK commands without checking that navigation is possible and app crashes. There are 2 fully correct options to fix this bug: 1.) Change NavigationManager and NavigationController, so they don't crash (which has both pros and cons). 2.) Change KeyCommandsProvider, so it does not send IDC_FORWARD, IDC_BACK commands if navigation is not possible. Correct fix will be tracked in a separate bug (crbug.com/677160), and this CL simply fixes a crash in the most simplest way w/o touching Tab class (which will be removed). BUG=676727 Review-Url: https://codereview.chromium.org/2605713002 Cr-Commit-Position: refs/heads/master@{#440773}
Showing
Please register or sign in to comment