Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4036)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java

Issue 1405413002: Webapps splashscreen: hide the splashscreen after the page has fully loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@splashscreen-tests
Patch Set: rebase + no tests Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
index 264d0412647dc9b579dd94e9cbd20525dae8372e..804aa30e2adb3a39697a41f979d025d301e4f525 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
@@ -285,19 +285,17 @@ public class WebappActivity extends FullScreenActivity {
@Override
public void didFirstVisuallyNonEmptyPaint(Tab tab) {
- if (mSplashScreen == null) return;
-
- mSplashScreen.animate()
- .alpha(0f)
- .withEndAction(new Runnable() {
- @Override
- public void run() {
- ViewGroup contentView =
- (ViewGroup) findViewById(android.R.id.content);
- contentView.removeView(mSplashScreen);
- mSplashScreen = null;
- }
- });
+ hideSplashScreen();
+ }
+
+ @Override
+ public void onPageLoadFinished(Tab tab) {
+ hideSplashScreen();
+ }
+
+ @Override
+ public void onPageLoadFailed(Tab tab, int errorCode) {
+ hideSplashScreen();
}
};
}
@@ -384,6 +382,23 @@ public class WebappActivity extends FullScreenActivity {
}
}
+ private void hideSplashScreen() {
+ if (mSplashScreen == null) return;
+
+ mSplashScreen.animate()
+ .alpha(0f)
+ .withEndAction(new Runnable() {
+ @Override
+ public void run() {
+ ViewGroup contentView =
+ (ViewGroup) findViewById(android.R.id.content);
+ if (mSplashScreen == null) return;
+ contentView.removeView(mSplashScreen);
+ mSplashScreen = null;
+ }
+ });
+ }
+
@VisibleForTesting
WebappUrlBar getUrlBarForTests() {
return mUrlBar;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698