| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/banners/app_banner_manager_android.h" | 5 #include "chrome/browser/android/banners/app_banner_manager_android.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 Stop(); | 190 Stop(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 if (!is_active()) | 193 if (!is_active()) |
| 194 return; | 194 return; |
| 195 | 195 |
| 196 icon_.reset(new SkBitmap(bitmap)); | 196 icon_.reset(new SkBitmap(bitmap)); |
| 197 SendBannerPromptRequest(); | 197 SendBannerPromptRequest(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void AppBannerManagerAndroid::ResetCurrentPageData() { |
| 201 AppBannerManager::ResetCurrentPageData(); |
| 202 native_app_data_.Reset(); |
| 203 native_app_package_ = ""; |
| 204 } |
| 205 |
| 200 void AppBannerManagerAndroid::ShowBanner() { | 206 void AppBannerManagerAndroid::ShowBanner() { |
| 201 content::WebContents* contents = web_contents(); | 207 content::WebContents* contents = web_contents(); |
| 202 DCHECK(contents); | 208 DCHECK(contents); |
| 203 | 209 |
| 204 if (native_app_data_.is_null()) { | 210 if (native_app_data_.is_null()) { |
| 205 if (AppBannerInfoBarDelegateAndroid::Create( | 211 if (AppBannerInfoBarDelegateAndroid::Create( |
| 206 contents, GetWeakPtr(), app_title_, | 212 contents, GetWeakPtr(), app_title_, |
| 207 CreateShortcutInfo(manifest_url_, manifest_, icon_url_), | 213 CreateShortcutInfo(manifest_url_, manifest_, icon_url_), |
| 208 std::move(icon_), event_request_id(), | 214 std::move(icon_), event_request_id(), |
| 209 webapk::INSTALL_SOURCE_BANNER)) { | 215 webapk::INSTALL_SOURCE_BANNER)) { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 335 } |
| 330 | 336 |
| 331 // static | 337 // static |
| 332 void SetTotalEngagementToTrigger(JNIEnv* env, | 338 void SetTotalEngagementToTrigger(JNIEnv* env, |
| 333 const JavaParamRef<jclass>& clazz, | 339 const JavaParamRef<jclass>& clazz, |
| 334 jdouble engagement) { | 340 jdouble engagement) { |
| 335 AppBannerSettingsHelper::SetTotalEngagementToTrigger(engagement); | 341 AppBannerSettingsHelper::SetTotalEngagementToTrigger(engagement); |
| 336 } | 342 } |
| 337 | 343 |
| 338 } // namespace banners | 344 } // namespace banners |
| OLD | NEW |