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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 * Displays a webapp in a nearly UI-less Chrome (InfoBars still appear). | 45 * Displays a webapp in a nearly UI-less Chrome (InfoBars still appear). |
| 46 */ | 46 */ |
| 47 public class WebappActivity extends FullScreenActivity { | 47 public class WebappActivity extends FullScreenActivity { |
| 48 public static final String WEBAPP_SCHEME = "webapp"; | 48 public static final String WEBAPP_SCHEME = "webapp"; |
| 49 | 49 |
| 50 private static final String TAG = "WebappActivity"; | 50 private static final String TAG = "WebappActivity"; |
| 51 private static final long MS_BEFORE_NAVIGATING_BACK_FROM_INTERSTITIAL = 1000 ; | 51 private static final long MS_BEFORE_NAVIGATING_BACK_FROM_INTERSTITIAL = 1000 ; |
| 52 | 52 |
| 53 private final WebappInfo mWebappInfo; | 53 private final WebappInfo mWebappInfo; |
| 54 private AsyncTask<WebappActivity, Void, Void> mCleanupTask; | 54 private AsyncTask<WebappActivity, Void, Void> mCleanupTask; |
| 55 private boolean mOldWebappCleanupStarted; | |
| 55 | 56 |
| 56 private WebContentsObserver mWebContentsObserver; | 57 private WebContentsObserver mWebContentsObserver; |
| 57 | 58 |
| 58 private ViewGroup mSplashScreen; | 59 private ViewGroup mSplashScreen; |
| 59 private WebappUrlBar mUrlBar; | 60 private WebappUrlBar mUrlBar; |
| 60 | 61 |
| 61 private boolean mIsInitialized; | 62 private boolean mIsInitialized; |
| 62 private Integer mBrandColor; | 63 private Integer mBrandColor; |
| 63 | 64 |
| 64 /** | 65 /** |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 | 159 |
| 159 @Override | 160 @Override |
| 160 protected int getControlContainerLayoutId() { | 161 protected int getControlContainerLayoutId() { |
| 161 return R.layout.webapp_control_container; | 162 return R.layout.webapp_control_container; |
| 162 } | 163 } |
| 163 | 164 |
| 164 @Override | 165 @Override |
| 165 public void postInflationStartup() { | 166 public void postInflationStartup() { |
| 166 initializeSplashScreen(); | 167 initializeSplashScreen(); |
| 167 | 168 |
| 169 // Kick off the old web app cleanup (if we haven't alread) now that we h ave queued the | |
|
gone
2015/09/24 10:27:11
nit: alread?
I'd move this further down in the pi
Lalit Maganti
2015/09/24 12:35:44
Moved to onResume as this point, UI work should ha
| |
| 170 // current web app's storage to be opened. | |
| 171 if (!mOldWebappCleanupStarted) { | |
| 172 WebappRegistry.unregisterOldWebapps(this); | |
| 173 mOldWebappCleanupStarted = true; | |
| 174 } | |
| 175 | |
| 168 super.postInflationStartup(); | 176 super.postInflationStartup(); |
| 169 WebappControlContainer controlContainer = | 177 WebappControlContainer controlContainer = |
| 170 (WebappControlContainer) findViewById(R.id.control_container); | 178 (WebappControlContainer) findViewById(R.id.control_container); |
| 171 mUrlBar = (WebappUrlBar) controlContainer.findViewById(R.id.webapp_url_b ar); | 179 mUrlBar = (WebappUrlBar) controlContainer.findViewById(R.id.webapp_url_b ar); |
| 172 } | 180 } |
| 173 | 181 |
| 174 /** | 182 /** |
| 175 * @return Structure containing data about the webapp currently displayed. | 183 * @return Structure containing data about the webapp currently displayed. |
| 176 */ | 184 */ |
| 177 WebappInfo getWebappInfo() { | 185 WebappInfo getWebappInfo() { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 return visible; | 417 return visible; |
| 410 } | 418 } |
| 411 | 419 |
| 412 // We're temporarily disable CS on webapp since there are some issues. (http ://crbug.com/471950) | 420 // We're temporarily disable CS on webapp since there are some issues. (http ://crbug.com/471950) |
| 413 // TODO(changwan): re-enable it once the issues are resolved. | 421 // TODO(changwan): re-enable it once the issues are resolved. |
| 414 @Override | 422 @Override |
| 415 protected boolean isContextualSearchAllowed() { | 423 protected boolean isContextualSearchAllowed() { |
| 416 return false; | 424 return false; |
| 417 } | 425 } |
| 418 } | 426 } |
| OLD | NEW |