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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.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: 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
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.Context; 7 import android.content.Context;
8 import android.content.SharedPreferences; 8 import android.content.SharedPreferences;
9 import android.graphics.Bitmap; 9 import android.graphics.Bitmap;
10 import android.os.AsyncTask; 10 import android.os.AsyncTask;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 public void updateSplashScreenImage(Bitmap splashScreenImage) { 130 public void updateSplashScreenImage(Bitmap splashScreenImage) {
131 new UpdateTask(splashScreenImage).execute(); 131 new UpdateTask(splashScreenImage).execute();
132 } 132 }
133 133
134 /** Package private for use by WebappRegistry */ 134 /** Package private for use by WebappRegistry */
135 void updateLastUsedTime() { 135 void updateLastUsedTime() {
136 assert !ThreadUtils.runningOnUiThread(); 136 assert !ThreadUtils.runningOnUiThread();
137 mPreferences.edit().putLong(KEY_LAST_USED, System.currentTimeMillis()).c ommit(); 137 mPreferences.edit().putLong(KEY_LAST_USED, System.currentTimeMillis()).c ommit();
138 } 138 }
139 139
140 private long getLastUsedTime() { 140 /** Package private for use by WebappRegistry */
gone 2015/09/24 10:27:11 nit: could've sworn I'd put a comment last time ab
Lalit Maganti 2015/09/24 12:35:44 Think you said something related but not for packa
141 long getLastUsedTime() {
141 assert !ThreadUtils.runningOnUiThread(); 142 assert !ThreadUtils.runningOnUiThread();
142 return mPreferences.getLong(KEY_LAST_USED, INVALID_LAST_USED); 143 return mPreferences.getLong(KEY_LAST_USED, INVALID_LAST_USED);
143 } 144 }
144 145
145 private Map<String, ?> getAllData() { 146 private Map<String, ?> getAllData() {
146 return mPreferences.getAll(); 147 return mPreferences.getAll();
147 } 148 }
148 149
149 /** 150 /**
150 * Called after data has been retrieved from storage. 151 * Called after data has been retrieved from storage.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 200
200 @Override 201 @Override
201 protected Void doInBackground(Void... nothing) { 202 protected Void doInBackground(Void... nothing) {
202 mPreferences.edit() 203 mPreferences.edit()
203 .putString(KEY_SPLASH_ICON, ShortcutHelper.encodeBitmapAsStr ing(mSplashImage)) 204 .putString(KEY_SPLASH_ICON, ShortcutHelper.encodeBitmapAsStr ing(mSplashImage))
204 .commit(); 205 .commit();
205 return null; 206 return null;
206 } 207 }
207 } 208 }
208 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698