• mnaganov's avatar
    [Android WebView] Send WebChromeClient.onReceivedTitle when navigating back · 27cdc32e
    mnaganov authored
    This is a re-land of https://codereview.chromium.org/1126383005, fixed
    not to cause a crash when 'WebView.loadUrl' is called from inside the
    onReceivedTitle callback, added a regression test. Also, the document
    title is now cached to minimize the amount of callback calls.
    
    Original patch description:
    
    The usual channel for delivering onReceivedTitle (via updating title for
    a NavigationEntry) doesn't work in the case of history navigations, because
    WebContentsImpl silences no-op updates of entries titles.
    
    Chrome Browser uses another event for updating the title in this case --
    via WebContentsDelegate::LoadingStateChanged. This patch enables WebView to
    use it as well.
    
    Note that WebChromeClient.onReceivedIcon doesn't need to be re-sent, as
    nobody seems to bother checking whether the icon update is a "no-op", so
    updates on history navigations just work.
    
    BUG=481570,495234
    
    Review URL: https://codereview.chromium.org/1161783005
    
    Cr-Commit-Position: refs/heads/master@{#333056}
    27cdc32e
aw_web_contents_delegate.cc 11.4 KB