Create new tab-loading animation
This implements three parts of the new tab-loading animation:
* Bottom bouncing pill of the indeterminate waiting state.
* Painting the loading state.
* Fading out the loading state animation once progress hits 100%.
This also makes all BrowserView tab animations' indeterminate state run
off of the same timer so this animation stays in sync across multiple
tabs. This timer restarts every time the animation timer starts, so the
first visible animation starts at 0 but following ones use the same
elapsed time as the already-running one.
Bug: chromium:822067
Change-Id: I7f5c38a92dc26556d11a01765831497027913f38
Reviewed-on: https://chromium-review.googlesource.com/c/1060605
Commit-Queue: Peter Boström <[email protected]>
Reviewed-by: Bret Sepulveda <[email protected]>
Reviewed-by: Michael Wasserman <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Cr-Commit-Position: refs/heads/master@{#604356}
diff --git a/content/browser/frame_host/frame_tree.h b/content/browser/frame_host/frame_tree.h
index 67e81da..4509b5b 100644
--- a/content/browser/frame_host/frame_tree.h
+++ b/content/browser/frame_host/frame_tree.h
@@ -226,7 +226,7 @@
void UpdateLoadProgress(double progress);
// Returns this FrameTree's total load progress.
- double load_progress() { return load_progress_; }
+ double load_progress() const { return load_progress_; }
// Resets the load progress on all nodes in this FrameTree.
void ResetLoadProgress();
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index fd677b0..f37cfab 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1422,6 +1422,10 @@
!(ShowingInterstitialPage() && interstitial_page_->pause_throbber());
}
+double WebContentsImpl::GetLoadProgress() const {
+ return frame_tree_.load_progress();
+}
+
bool WebContentsImpl::IsLoadingToDifferentDocument() const {
return IsLoading() && is_load_to_different_document_;
}
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index c7e5a55a..f7124e7 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -324,6 +324,7 @@
const base::string16& title) override;
SiteInstanceImpl* GetSiteInstance() const override;
bool IsLoading() const override;
+ double GetLoadProgress() const override;
bool IsLoadingToDifferentDocument() const override;
bool IsWaitingForResponse() const override;
const net::LoadStateWithParam& GetLoadState() const override;