Resolvesbrave/brave-browser#46588
Crash happened because SecurityStateTabHelper was null for inactive tab in split tabs.
It should not be null because split view location bar fetches tab's current security status indirectly via ChromeLocationBarModelDelegate.
So far, BraveMultiContentsView calls UpdateSecondaryLocationBar() whenever SetActiveIndex()
is called. If SetActiveIndex() is called after proper WebContents are set on both inactive/active
web view in split tabs, there is no crash. However, SetActiveIndex() could be called if one of them is cleared state.
At BrowserView::OnSplitTabContentsUpdated(), that can happen.
So, WebView::GetWebContents() created another WebContents accidently and that created WebContents doesn't have
SecurityStateTabHelper. To prevent creating it, calling GetWebContents() is replaced with web_contents().
To fix this, called UpdateSecondaryLocationBar() after proper WebContents are set on inactive/active webview in split tabs.
TEST=SideBySideEnabledBrowserTest.SelectTabTest
This change adjusts the sync settings UI a bit, moving the 'Add New Device' button into the device list section, and shifting the sync internals toolbar button into the section that used to only include the remove from chain button. It also adjusts a couple of font sizes, padding, and the overall table style
This introduces a temporary patch that is being upstreamed:
https://chromium-review.googlesource.com/c/chromium/src/+/6621103
The patch itself fixes a crash when you attempt to iterate the back-forward list after the underlying web state resets (such as when restoring the tab)
We were only flipping the toggle when the toggle element itself is
clicked, while the expected behavior is the entire menu item should be
toggling the switch if clicked.
This PR fixes the bug by adding the onClick handler for the menu item
with interactive property set to true so it won't dismiss the menu when
the item is clicked to match the behavior where the toggle itself is
clicked.
This PR removes a lot of unnecessary uses of `EXPECT_STREQ` combined
with calls to `c_str()`, and converts these comparisons simply to
`std::string` comparisons using `EXPECT_EQ`. This is functionally the
same, but it is arguably easier to read in general.
Resolves https://github.com/brave/brave-browser/issues/46600