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

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

Issue 2676863002: Update WebApkInstaller to support badge icon in installation. (Closed)
Patch Set: addressing comments Created 3 years, 8 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 webapk::TrackGooglePlayInstallState(state); 150 webapk::TrackGooglePlayInstallState(state);
151 return; 151 return;
152 } 152 }
153 AddShortcutWithSkBitmap(info, webapp_id, icon_bitmap); 153 AddShortcutWithSkBitmap(info, webapp_id, icon_bitmap);
154 } 154 }
155 155
156 // static 156 // static
157 void ShortcutHelper::InstallWebApkWithSkBitmap( 157 void ShortcutHelper::InstallWebApkWithSkBitmap(
158 content::WebContents* web_contents, 158 content::WebContents* web_contents,
159 const ShortcutInfo& info, 159 const ShortcutInfo& info,
160 const SkBitmap& icon_bitmap, 160 const SkBitmap& primary_icon_bitmap,
161 const SkBitmap& badge_icon_bitmap,
161 const WebApkInstallService::FinishCallback& callback) { 162 const WebApkInstallService::FinishCallback& callback) {
162 WebApkInstallService::Get(web_contents->GetBrowserContext()) 163 WebApkInstallService::Get(web_contents->GetBrowserContext())
163 ->InstallAsync(info, icon_bitmap, callback); 164 ->InstallAsync(info, primary_icon_bitmap, badge_icon_bitmap, callback);
164 webapk::TrackGooglePlayInstallState(GooglePlayInstallState::SUPPORTED); 165 webapk::TrackGooglePlayInstallState(GooglePlayInstallState::SUPPORTED);
165 } 166 }
166 167
167 void ShortcutHelper::ShowWebApkInstallInProgressToast() { 168 void ShortcutHelper::ShowWebApkInstallInProgressToast() {
168 Java_ShortcutHelper_showWebApkInstallInProgressToast( 169 Java_ShortcutHelper_showWebApkInstallInProgressToast(
169 base::android::AttachCurrentThread()); 170 base::android::AttachCurrentThread());
170 } 171 }
171 172
172 int ShortcutHelper::GetIdealHomescreenIconSizeInPx() { 173 int ShortcutHelper::GetIdealHomescreenIconSizeInPx() {
173 if (g_ideal_homescreen_icon_size == -1) 174 if (g_ideal_homescreen_icon_size == -1)
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 409
409 ShortcutHelper::WebApkInfoCallback* webapk_list_callback = 410 ShortcutHelper::WebApkInfoCallback* webapk_list_callback =
410 reinterpret_cast<ShortcutHelper::WebApkInfoCallback*>(jcallback_pointer); 411 reinterpret_cast<ShortcutHelper::WebApkInfoCallback*>(jcallback_pointer);
411 webapk_list_callback->Run(webapk_list); 412 webapk_list_callback->Run(webapk_list);
412 delete webapk_list_callback; 413 delete webapk_list_callback;
413 } 414 }
414 415
415 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { 416 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) {
416 return RegisterNativesImpl(env); 417 return RegisterNativesImpl(env);
417 } 418 }
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | chrome/browser/android/webapk/webapk_install_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698