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

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

Issue 1359383002: webapps: Add cleanup task when opening up WebappActivity to clean old web apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapp-cleanup
Patch Set: Address Mounir's comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698