Rename to_different_document to should_show_loading_ui in LoadingStateChanged() callbacks

Currently, the purpose of this bit is to indicate to embedders whether
or not a navigation should show loading UI indicators. Currently, same
document navigations never show loading UI because they're always
processed synchronously, so there's no point in flipping to showing
loading UI only to immediately turn it off again. However, in a future
patch, we will introduce a new asynchronous kind of same-document
navigation (as part of the new appHistory API). In preparation for
that, rename to_different_document to should_show_loading_ui to better
indicate what the bit means and how it should be used.

Bug: 1241202
Change-Id: I8c890da3571b80b361644fdf8fbb366336a09f1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3268574
Reviewed-by: Toni Barzic <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Chris Hamilton <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Tommy Nyquist <[email protected]>
Owners-Override: Charlie Reis <[email protected]>
Commit-Queue: Nate Chapin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#940997}
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index d55b043..8b7f3c9 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -578,11 +578,11 @@
   // Returns the current load progress.
   virtual double GetLoadProgress() = 0;
 
-  // Returns whether this WebContents is loading and and the load is to a
-  // different top-level document (rather than being a navigation within the
-  // same document) in the main frame. This being true implies that IsLoading()
-  // is also true.
-  virtual bool IsLoadingToDifferentDocument() = 0;
+  // Returns whether a navigation is currently in progress that should show
+  // loading UI if such UI exists (progress bar, loading spinner, stop button,
+  // etc.) True for different-document navigations and appHistory's
+  // transitionWhile(). This being true implies that IsLoading() is also true.
+  virtual bool ShouldShowLoadingUI() = 0;
 
   // Returns whether the current main document has reached and finished
   // executing its onload() handler. Corresponds to