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

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

Issue 1308533006: webapps: allow callers of icon downloader/selector to specify a minimum size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapps-splashscreen-icon
Patch Set: Address review comments Created 5 years, 3 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.graphics.Bitmap; 8 import android.graphics.Bitmap;
9 9
10 import org.chromium.base.ApplicationStatus; 10 import org.chromium.base.ApplicationStatus;
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 /** 42 /**
43 * Gets all the information required to initialize the UI. The observer wil l be notified as 43 * Gets all the information required to initialize the UI. The observer wil l be notified as
44 * information required for the shortcut become available. 44 * information required for the shortcut become available.
45 * @param observer Observer to notify. 45 * @param observer Observer to notify.
46 */ 46 */
47 public void initialize(Observer observer) { 47 public void initialize(Observer observer) {
48 mObserver = observer; 48 mObserver = observer;
49 mNativeAddToHomescreenDialogHelper = nativeInitialize( 49 mNativeAddToHomescreenDialogHelper = nativeInitialize(
50 mTab.getWebContents(), 50 mTab.getWebContents());
51 ShortcutHelper.getIdealSplashImageSizeInDp(mAppContext.getResour ces()),
52 ShortcutHelper.getIdealIconSizeInDp(mAppContext.getResources())) ;
53 } 51 }
54 52
55 /** 53 /**
56 * Returns whether the object is initialized. 54 * Returns whether the object is initialized.
57 */ 55 */
58 public boolean isInitialized() { 56 public boolean isInitialized() {
59 return mIsInitialized; 57 return mIsInitialized;
60 } 58 }
61 59
62 /** 60 /**
(...skipping 30 matching lines...) Expand all
93 /** 91 /**
94 * Creates an icon that is acceptable to show on the launcher. 92 * Creates an icon that is acceptable to show on the launcher.
95 */ 93 */
96 @CalledByNative 94 @CalledByNative
97 private static Bitmap finalizeLauncherIcon( 95 private static Bitmap finalizeLauncherIcon(
98 String url, Bitmap icon, int red, int green, int blue) { 96 String url, Bitmap icon, int red, int green, int blue) {
99 return ShortcutHelper.createLauncherIcon( 97 return ShortcutHelper.createLauncherIcon(
100 ApplicationStatus.getApplicationContext(), icon, url, red, green , blue); 98 ApplicationStatus.getApplicationContext(), icon, url, red, green , blue);
101 } 99 }
102 100
103 private native long nativeInitialize(WebContents webContents, 101 private native long nativeInitialize(WebContents webContents);
104 int idealSplashImageSizeInDp, int idealIconSizeInDp);
105 private native void nativeAddShortcut(long nativeAddToHomescreenDialogHelper , 102 private native void nativeAddShortcut(long nativeAddToHomescreenDialogHelper ,
106 String userRequestedTitle); 103 String userRequestedTitle);
107 private native void nativeDestroy(long nativeAddToHomescreenDialogHelper); 104 private native void nativeDestroy(long nativeAddToHomescreenDialogHelper);
108 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698