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

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

Issue 1749603002: Store URLs in WebappDataStorage, and purge them when history is cleared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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/WebappActivity.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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; 5 package org.chromium.chrome.browser;
6 6
7 import android.app.ActivityManager; 7 import android.app.ActivityManager;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.pm.PackageManager; 10 import android.content.pm.PackageManager;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 Toast toast = Toast.makeText(applicationContext, toastText, Toas t.LENGTH_SHORT); 166 Toast toast = Toast.makeText(applicationContext, toastText, Toas t.LENGTH_SHORT);
167 toast.show(); 167 toast.show();
168 } 168 }
169 }); 169 });
170 } 170 }
171 171
172 /** 172 /**
173 * Creates a storage location and stores the data for a web app using {@link WebappDataStorage}. 173 * Creates a storage location and stores the data for a web app using {@link WebappDataStorage}.
174 * @param context Context to open the WebappDataStorage with. 174 * @param context Context to open the WebappDataStorage with.
175 * @param id ID of the webapp which is storing data. 175 * @param id ID of the webapp which is storing data.
176 * @param scope scope of the webapp which is storing data.
176 * @param splashImage Image which should be displayed on the splash screen o f 177 * @param splashImage Image which should be displayed on the splash screen o f
177 * the webapp. This can be null of there is no image to s how. 178 * the webapp. This can be null of there is no image to s how.
178 */ 179 */
179 @SuppressWarnings("unused") 180 @SuppressWarnings("unused")
180 @CalledByNative 181 @CalledByNative
181 private static void storeWebappData(Context context, String id, Bitmap splas hImage) { 182 private static void storeWebappData(Context context, String id, String scope ,
182 WebappRegistry.registerWebapp(context, id); 183 Bitmap splashImage) {
184 WebappRegistry.registerWebapp(context, id, scope);
183 WebappDataStorage.open(context, id).updateSplashScreenImage(splashImage) ; 185 WebappDataStorage.open(context, id).updateSplashScreenImage(splashImage) ;
184 } 186 }
185 187
186 /** 188 /**
187 * Creates an intent that will add a shortcut to the home screen. 189 * Creates an intent that will add a shortcut to the home screen.
188 * @param shortcutIntent Intent to fire when the shortcut is activated. 190 * @param shortcutIntent Intent to fire when the shortcut is activated.
189 * @param url URL of the shortcut. 191 * @param url URL of the shortcut.
190 * @param title Title of the shortcut. 192 * @param title Title of the shortcut.
191 * @param icon Image that represents the shortcut. 193 * @param icon Image that represents the shortcut.
192 * @return Intent for the shortcut. 194 * @return Intent for the shortcut.
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 context.getResources(), id, density); 455 context.getResources(), id, density);
454 456
455 if (drawable instanceof BitmapDrawable) { 457 if (drawable instanceof BitmapDrawable) {
456 BitmapDrawable bd = (BitmapDrawable) drawable; 458 BitmapDrawable bd = (BitmapDrawable) drawable;
457 return bd.getBitmap(); 459 return bd.getBitmap();
458 } 460 }
459 assert false : "The drawable was not a bitmap drawable as expected"; 461 assert false : "The drawable was not a bitmap drawable as expected";
460 return null; 462 return null;
461 } 463 }
462 } 464 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698