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

Side by Side Diff: chrome/browser/android/shortcut_helper.cc

Issue 2676863002: Update WebApkInstaller to support badge icon in installation. (Closed)
Patch Set: Revert git cl format Created 3 years, 10 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 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 #include "chrome/browser/android/shortcut_helper.h" 5 #include "chrome/browser/android/shortcut_helper.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 AddWebappWithSkBitmap(info, webapp_id, icon_bitmap, splash_image_callback); 79 AddWebappWithSkBitmap(info, webapp_id, icon_bitmap, splash_image_callback);
80 return; 80 return;
81 } 81 }
82 AddShortcutWithSkBitmap(info, webapp_id, icon_bitmap); 82 AddShortcutWithSkBitmap(info, webapp_id, icon_bitmap);
83 } 83 }
84 84
85 // static 85 // static
86 void ShortcutHelper::InstallWebApkWithSkBitmap( 86 void ShortcutHelper::InstallWebApkWithSkBitmap(
87 content::BrowserContext* browser_context, 87 content::BrowserContext* browser_context,
88 const ShortcutInfo& info, 88 const ShortcutInfo& info,
89 const SkBitmap& icon_bitmap, 89 const SkBitmap& primary_icon_bitmap,
90 const SkBitmap& badge_icon_bitmap,
90 const WebApkInstaller::FinishCallback& callback) { 91 const WebApkInstaller::FinishCallback& callback) {
91 WebApkInstallService::Get(browser_context) 92 WebApkInstallService::Get(browser_context)
92 ->InstallAsync(info, icon_bitmap, callback); 93 ->InstallAsync(info, primary_icon_bitmap, badge_icon_bitmap, callback);
93 } 94 }
94 95
95 // static 96 // static
96 void ShortcutHelper::AddWebappWithSkBitmap( 97 void ShortcutHelper::AddWebappWithSkBitmap(
97 const ShortcutInfo& info, 98 const ShortcutInfo& info,
98 const std::string& webapp_id, 99 const std::string& webapp_id,
99 const SkBitmap& icon_bitmap, 100 const SkBitmap& icon_bitmap,
100 const base::Closure& splash_image_callback) { 101 const base::Closure& splash_image_callback) {
101 // Send the data to the Java side to create the shortcut. 102 // Send the data to the Java side to create the shortcut.
102 JNIEnv* env = base::android::AttachCurrentThread(); 103 JNIEnv* env = base::android::AttachCurrentThread();
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 352
352 ShortcutHelper::WebApkInfoCallback* webapk_list_callback = 353 ShortcutHelper::WebApkInfoCallback* webapk_list_callback =
353 reinterpret_cast<ShortcutHelper::WebApkInfoCallback*>(jcallback_pointer); 354 reinterpret_cast<ShortcutHelper::WebApkInfoCallback*>(jcallback_pointer);
354 webapk_list_callback->Run(webapk_list); 355 webapk_list_callback->Run(webapk_list);
355 delete webapk_list_callback; 356 delete webapk_list_callback;
356 } 357 }
357 358
358 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { 359 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) {
359 return RegisterNativesImpl(env); 360 return RegisterNativesImpl(env);
360 } 361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698