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

Unified Diff: chrome/browser/banners/app_banner_settings_helper.cc

Issue 1161233005: Implement app banner info bars on desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stop-icon-overgeneration
Patch Set: Moving feature enabling to existing #ifs Created 5 years, 7 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
Index: chrome/browser/banners/app_banner_settings_helper.cc
diff --git a/chrome/browser/banners/app_banner_settings_helper.cc b/chrome/browser/banners/app_banner_settings_helper.cc
index 19e711018502493e31ccdc4aec7aa8156de4649e..7306d7b9cf3f15eddfd02448e6b23c11445b964e 100644
--- a/chrome/browser/banners/app_banner_settings_helper.cc
+++ b/chrome/browser/banners/app_banner_settings_helper.cc
@@ -8,11 +8,14 @@
#include <string>
#include "base/command_line.h"
+#include "chrome/browser/banners/app_banner_data_fetcher.h"
#include "chrome/browser/banners/app_banner_metrics.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
+#include "components/rappor/rappor_utils.h"
#include "content/public/browser/web_contents.h"
#include "net/base/escape.h"
#include "url/gurl.h"
@@ -95,6 +98,44 @@ void AppBannerSettingsHelper::ClearHistoryForURLs(
}
}
+void AppBannerSettingsHelper::RecordBannerInstallEvent(
+ content::WebContents* web_contents,
+ const std::string& package_name_or_start_url,
+ AppBannerRapporMetric rappor_metric) {
+ banners::TrackInstallEvent(banners::INSTALL_EVENT_WEB_APP_INSTALLED);
+
+ AppBannerSettingsHelper::RecordBannerEvent(
+ web_contents, web_contents->GetURL(),
+ package_name_or_start_url,
+ AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN,
+ banners::AppBannerDataFetcher::GetCurrentTime());
+
+ rappor::SampleDomainAndRegistryFromGURL(
+ g_browser_process->rappor_service(),
+ (rappor_metric == WEB ? "AppBanner.WebApp.Installed"
+ : "AppBanner.NativeApp.Installed"),
+ web_contents->GetURL());
+}
+
+void AppBannerSettingsHelper::RecordBannerDismissEvent(
+ content::WebContents* web_contents,
+ const std::string& package_name_or_start_url,
+ AppBannerRapporMetric rappor_metric) {
+ banners::TrackDismissEvent(banners::DISMISS_EVENT_CLOSE_BUTTON);
+
+ AppBannerSettingsHelper::RecordBannerEvent(
+ web_contents, web_contents->GetURL(),
+ package_name_or_start_url,
+ AppBannerSettingsHelper::APP_BANNER_EVENT_DID_BLOCK,
+ banners::AppBannerDataFetcher::GetCurrentTime());
+
+ rappor::SampleDomainAndRegistryFromGURL(
+ g_browser_process->rappor_service(),
+ (rappor_metric == WEB ? "AppBanner.WebApp.Dismissed"
+ : "AppBanner.NativeApp.Dismissed"),
+ web_contents->GetURL());
+}
+
void AppBannerSettingsHelper::RecordBannerEvent(
content::WebContents* web_contents,
const GURL& origin_url,
« no previous file with comments | « chrome/browser/banners/app_banner_settings_helper.h ('k') | chrome/browser/extensions/bookmark_app_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698