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

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

Issue 939263002: [App banners] Add RAPPOR support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Swapped out for new call 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 | « chrome/browser/android/banners/app_banner_infobar_delegate.cc ('k') | tools/metrics/rappor/rappor.xml » ('j') | 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 b3f1f565a84e9d924593074472abcee91177f957..b510b9e414befdb2dfb0f67d5f6c60f8238f80d4 100644
--- a/chrome/browser/android/banners/app_banner_manager.cc
+++ b/chrome/browser/android/banners/app_banner_manager.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/browser/metrics/rappor/sampling.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
@@ -237,8 +238,13 @@ void AppBannerManager::OnFetchComplete(BannerBitmapFetcher* fetcher,
return;
fetcher_ = nullptr;
- if (!bitmap || url != app_icon_url_)
+ if (!web_contents()
+ || web_contents()->IsBeingDestroyed()
+ || validated_url_ != web_contents()->GetURL()
+ || !bitmap
+ || url != app_icon_url_) {
return;
+ }
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> jobj = weak_java_banner_view_manager_.get(env);
@@ -259,6 +265,9 @@ void AppBannerManager::OnFetchComplete(BannerBitmapFetcher* fetcher,
new SkBitmap(*bitmap),
native_app_data_,
native_app_package_);
+
+ rappor::SampleDomainAndRegistryFromGURL("AppBanner.NativeApp.Shown",
+ web_contents()->GetURL());
} else if (!web_app_data_.IsEmpty()){
RecordCouldShowBanner(web_app_data_.start_url.spec());
if (!CheckIfShouldShow(web_app_data_.start_url.spec()))
@@ -269,6 +278,9 @@ void AppBannerManager::OnFetchComplete(BannerBitmapFetcher* fetcher,
app_title_,
new SkBitmap(*bitmap),
web_app_data_);
+
+ rappor::SampleDomainAndRegistryFromGURL("AppBanner.WebApp.Shown",
+ web_contents()->GetURL());
}
if (weak_infobar_ptr != nullptr)
« no previous file with comments | « chrome/browser/android/banners/app_banner_infobar_delegate.cc ('k') | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698