OLD | NEW |
---|---|
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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& icon_bitmap, |
161 const WebApkInstallService::FinishCallback& callback) { | 161 const WebApkInstallService::FinishCallback& callback) { |
162 WebApkInstallService::Get(web_contents->GetBrowserContext()) | 162 WebApkInstallService::Get(web_contents->GetBrowserContext()) |
163 ->InstallAsync(info, icon_bitmap, callback); | 163 ->InstallAsync(info, icon_bitmap, callback); |
164 // Don't record metric for users who install WebAPKs via "unsigned sources" | |
165 // flow. | |
166 if (ChromeWebApkHost::GetGooglePlayInstallState() == | 164 if (ChromeWebApkHost::GetGooglePlayInstallState() == |
Yaron
2017/04/04 16:42:02
the comment was unnecessary, but I'm truthfully un
pkotwicz
2017/04/04 19:06:07
We can. The caller only calls ShortcutHelper::Inst
Yaron
2017/04/04 19:49:08
Done.
| |
167 GooglePlayInstallState::SUPPORTED) { | 165 GooglePlayInstallState::SUPPORTED) { |
168 webapk::TrackGooglePlayInstallState(GooglePlayInstallState::SUPPORTED); | 166 webapk::TrackGooglePlayInstallState(GooglePlayInstallState::SUPPORTED); |
169 } | 167 } |
170 } | 168 } |
171 | 169 |
172 void ShortcutHelper::ShowWebApkInstallInProgressToast() { | 170 void ShortcutHelper::ShowWebApkInstallInProgressToast() { |
173 Java_ShortcutHelper_showWebApkInstallInProgressToast( | 171 Java_ShortcutHelper_showWebApkInstallInProgressToast( |
174 base::android::AttachCurrentThread()); | 172 base::android::AttachCurrentThread()); |
175 } | 173 } |
176 | 174 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
413 | 411 |
414 ShortcutHelper::WebApkInfoCallback* webapk_list_callback = | 412 ShortcutHelper::WebApkInfoCallback* webapk_list_callback = |
415 reinterpret_cast<ShortcutHelper::WebApkInfoCallback*>(jcallback_pointer); | 413 reinterpret_cast<ShortcutHelper::WebApkInfoCallback*>(jcallback_pointer); |
416 webapk_list_callback->Run(webapk_list); | 414 webapk_list_callback->Run(webapk_list); |
417 delete webapk_list_callback; | 415 delete webapk_list_callback; |
418 } | 416 } |
419 | 417 |
420 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { | 418 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { |
421 return RegisterNativesImpl(env); | 419 return RegisterNativesImpl(env); |
422 } | 420 } |
OLD | NEW |