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

Unified Diff: chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc

Issue 1420743002: Web app: set a flag on the Intent if the icon was generated by Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@splashscreen-even-more-tests
Patch Set: review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/android/webapps/add_to_homescreen_dialog_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc
diff --git a/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc b/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc
index 15a22276d94c4b386c3a893f473a5d4968eb83da..845d325a093cbfcbfc87b646952c4888785029b6 100644
--- a/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc
+++ b/chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc
@@ -85,32 +85,11 @@ void AddToHomescreenDialogHelper::Destroy(JNIEnv* env, jobject obj) {
SkBitmap AddToHomescreenDialogHelper::FinalizeLauncherIcon(
const SkBitmap& bitmap,
- const GURL& url) {
+ const GURL& url,
+ bool* is_generated) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- // Determine a single color to use for the favicon if the favicon that is
- // returned it is too low quality.
- SkColor color = color_utils::CalculateKMeanColorOfBitmap(bitmap);
- int dominant_red = SkColorGetR(color);
- int dominant_green = SkColorGetG(color);
- int dominant_blue = SkColorGetB(color);
-
- // Make the icon acceptable for the Android launcher.
- JNIEnv* env = base::android::AttachCurrentThread();
- ScopedJavaLocalRef<jstring> java_url =
- base::android::ConvertUTF8ToJavaString(env, url.spec());
- ScopedJavaLocalRef<jobject> java_bitmap;
- if (bitmap.getSize())
- java_bitmap = gfx::ConvertToJavaBitmap(&bitmap);
-
- base::android::ScopedJavaLocalRef<jobject> ref =
- Java_AddToHomescreenDialogHelper_finalizeLauncherIcon(env,
- java_url.obj(),
- java_bitmap.obj(),
- dominant_red,
- dominant_green,
- dominant_blue);
- return gfx::CreateSkBitmapFromJavaBitmap(gfx::JavaBitmap(ref.obj()));
+ return ShortcutHelper::FinalizeLauncherIcon(bitmap, url, is_generated);
}
void AddToHomescreenDialogHelper::AddShortcut(JNIEnv* env,
« no previous file with comments | « chrome/browser/android/webapps/add_to_homescreen_dialog_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698