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

Unified Diff: chrome/browser/android/shortcut_helper.cc

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: Fix non-compiling test 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index cead81b0d9f22a05e0c5ef072dfd7b067508c017..adc09ce2a2b2b7034a671ea5588cd8112366fe91 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -64,6 +64,7 @@ void ShortcutHelper::FetchSplashScreenImage(
content::WebContents* web_contents,
const GURL& image_url,
const int ideal_splash_image_size_in_dp,
+ const int minimum_splash_image_size_in_dp,
const std::string& webapp_id) {
// This is a fire and forget task. It is not vital for the splash screen image
// to be downloaded so if the downloader returns false there is no fallback.
@@ -71,9 +72,34 @@ void ShortcutHelper::FetchSplashScreenImage(
web_contents,
image_url,
ideal_splash_image_size_in_dp,
+ minimum_splash_image_size_in_dp,
base::Bind(&ShortcutHelper::StoreWebappData, webapp_id));
}
+int ShortcutHelper::GetIdealSplashImageSizeInDp() {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ return Java_ShortcutHelper_getIdealSplashImageSizeInDp(
+ env, base::android::GetApplicationContext());
+}
+
+int ShortcutHelper::GetMinimumSplashImageSizeInDp() {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ return Java_ShortcutHelper_getMinimumSplashImageSizeInDp(
+ env, base::android::GetApplicationContext());
+}
+
+int ShortcutHelper::GetIdealIconSizeInDp() {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ return Java_ShortcutHelper_getIdealIconSizeInDp(
+ env, base::android::GetApplicationContext());
+}
+
+int ShortcutHelper::GetMinimumIconSizeInDp() {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ return Java_ShortcutHelper_getMinimumIconSizeInDp(
+ env, base::android::GetApplicationContext());
+}
+
// static
void ShortcutHelper::StoreWebappData(
const std::string& webapp_id,

Powered by Google App Engine
This is Rietveld 408576698