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

Unified Diff: chrome/browser/android/banners/app_banner_manager.cc

Issue 905913002: Move banner counting logic much later in the pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/banners/app_banner_manager.cc
diff --git a/chrome/browser/android/banners/app_banner_manager.cc b/chrome/browser/android/banners/app_banner_manager.cc
index 140901f1bc52878aaeb46edd391b1b5af16a488a..fdf041f9fad18f9dd641879fdb105dfd50874e71 100644
--- a/chrome/browser/android/banners/app_banner_manager.cc
+++ b/chrome/browser/android/banners/app_banner_manager.cc
@@ -199,10 +199,6 @@ void AppBannerManager::OnDidCheckHasServiceWorker(bool has_service_worker) {
if (icon_url.is_empty())
return;
- RecordCouldShowBanner(web_app_data_.start_url.spec());
- if (!CheckIfShouldShow(web_app_data_.start_url.spec()))
- return;
-
FetchIcon(icon_url);
}
}
@@ -255,11 +251,19 @@ void AppBannerManager::OnFetchComplete(const GURL url, const SkBitmap* bitmap) {
weak_infobar_ptr_ = nullptr;
if (!native_app_data_.is_null()) {
+ RecordCouldShowBanner(native_app_package_);
+ if (!CheckIfShouldShow(native_app_package_))
+ return;
+
weak_infobar_ptr_ = AppBannerInfoBarDelegate::CreateForNativeApp(
service,
this,
native_app_data_);
} else if (!web_app_data_.IsEmpty()){
+ RecordCouldShowBanner(web_app_data_.start_url.spec());
+ if (!CheckIfShouldShow(web_app_data_.start_url.spec()))
+ return;
+
weak_infobar_ptr_ = AppBannerInfoBarDelegate::CreateForWebApp(
service,
this,
@@ -283,10 +287,6 @@ void AppBannerManager::OnDidRetrieveMetaTagContent(
banners::TrackDisplayEvent(DISPLAY_BANNER_REQUESTED);
- RecordCouldShowBanner(tag_content);
- if (!CheckIfShouldShow(tag_content))
- return;
-
// Send the info to the Java side to get info about the app.
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> jobj = weak_java_banner_view_manager_.get(env);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698