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