Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.webapps; | 5 package org.chromium.chrome.browser.webapps; |
| 6 | 6 |
| 7 import android.content.Intent; | 7 import android.content.Intent; |
| 8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
| 9 import android.graphics.drawable.Drawable; | 9 import android.graphics.drawable.Drawable; |
| 10 import android.net.Uri; | 10 import android.net.Uri; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 * Displays a webapp in a nearly UI-less Chrome (InfoBars still appear). | 46 * Displays a webapp in a nearly UI-less Chrome (InfoBars still appear). |
| 47 */ | 47 */ |
| 48 public class WebappActivity extends FullScreenActivity { | 48 public class WebappActivity extends FullScreenActivity { |
| 49 public static final String WEBAPP_SCHEME = "webapp"; | 49 public static final String WEBAPP_SCHEME = "webapp"; |
| 50 | 50 |
| 51 private static final String TAG = "WebappActivity"; | 51 private static final String TAG = "WebappActivity"; |
| 52 private static final long MS_BEFORE_NAVIGATING_BACK_FROM_INTERSTITIAL = 1000 ; | 52 private static final long MS_BEFORE_NAVIGATING_BACK_FROM_INTERSTITIAL = 1000 ; |
| 53 | 53 |
| 54 private final WebappInfo mWebappInfo; | 54 private final WebappInfo mWebappInfo; |
| 55 private AsyncTask<Void, Void, Void> mCleanupTask; | 55 private AsyncTask<Void, Void, Void> mCleanupTask; |
| 56 private boolean mOldWebappCleanupStarted; | |
| 56 | 57 |
| 57 private WebContentsObserver mWebContentsObserver; | 58 private WebContentsObserver mWebContentsObserver; |
| 58 | 59 |
| 59 private ViewGroup mSplashScreen; | 60 private ViewGroup mSplashScreen; |
| 60 private WebappUrlBar mUrlBar; | 61 private WebappUrlBar mUrlBar; |
| 61 | 62 |
| 62 private boolean mIsInitialized; | 63 private boolean mIsInitialized; |
| 63 private Integer mBrandColor; | 64 private Integer mBrandColor; |
| 64 | 65 |
| 65 /** | 66 /** |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 @Override | 150 @Override |
| 150 public void onResume() { | 151 public void onResume() { |
| 151 if (!isFinishing()) { | 152 if (!isFinishing()) { |
| 152 if (getIntent() != null) { | 153 if (getIntent() != null) { |
| 153 // Avoid situations where Android starts two Activities with the same data. | 154 // Avoid situations where Android starts two Activities with the same data. |
| 154 DocumentUtils.finishOtherTasksWithData(getIntent().getData(), ge tTaskId()); | 155 DocumentUtils.finishOtherTasksWithData(getIntent().getData(), ge tTaskId()); |
| 155 } | 156 } |
| 156 updateTaskDescription(); | 157 updateTaskDescription(); |
| 157 } | 158 } |
| 158 super.onResume(); | 159 super.onResume(); |
| 160 | |
| 161 // Kick off the old web app cleanup (if we haven't already) now that we have queued the | |
| 162 // current web app's storage to be opened. | |
| 163 if (!mOldWebappCleanupStarted) { | |
| 164 WebappRegistry.unregisterOldWebapps(this, System.currentTimeMillis() ); | |
| 165 mOldWebappCleanupStarted = true; | |
| 166 } | |
|
mlamouri (slow - plz ping)
2015/09/24 15:20:04
Doing that in onResume means that it would be call
Lalit Maganti
2015/09/24 16:09:37
After being put in foreground but also after all t
| |
| 159 } | 167 } |
| 160 | 168 |
| 161 @Override | 169 @Override |
| 162 protected int getControlContainerLayoutId() { | 170 protected int getControlContainerLayoutId() { |
| 163 return R.layout.webapp_control_container; | 171 return R.layout.webapp_control_container; |
| 164 } | 172 } |
| 165 | 173 |
| 166 @Override | 174 @Override |
| 167 public void postInflationStartup() { | 175 public void postInflationStartup() { |
| 168 initializeSplashScreen(); | 176 initializeSplashScreen(); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 return visible; | 419 return visible; |
| 412 } | 420 } |
| 413 | 421 |
| 414 // We're temporarily disable CS on webapp since there are some issues. (http ://crbug.com/471950) | 422 // We're temporarily disable CS on webapp since there are some issues. (http ://crbug.com/471950) |
| 415 // TODO(changwan): re-enable it once the issues are resolved. | 423 // TODO(changwan): re-enable it once the issues are resolved. |
| 416 @Override | 424 @Override |
| 417 protected boolean isContextualSearchAllowed() { | 425 protected boolean isContextualSearchAllowed() { |
| 418 return false; | 426 return false; |
| 419 } | 427 } |
| 420 } | 428 } |
| OLD | NEW |