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

Unified Diff: chrome/browser/ui/extensions/application_launch.cc

Issue 2612493002: Prevent app banners from displaying after desktop add to shelf. (Closed)
Patch Set: Created 3 years, 12 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/extensions/bookmark_app_helper_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/extensions/application_launch.cc
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc
index 9d404559f5e504a798dff6647f455ebb5d7d6e6b..56d65659524e51895ab3aeefa1e0ba79fa853206 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -9,8 +9,10 @@
#include "apps/launcher.h"
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
+#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
+#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/launch_util.h"
@@ -316,16 +318,6 @@ WebContents* OpenEnabledApplication(const AppLaunchParams& params) {
extensions::NUM_LAUNCH_CONTAINERS);
GURL url = UrlForExtension(extension, params.override_url);
- if (extension->from_bookmark()) {
- UMA_HISTOGRAM_ENUMERATION("Extensions.BookmarkAppLaunchContainer",
- params.container,
- extensions::NUM_LAUNCH_CONTAINERS);
-
- // Record the launch time in the site engagement service. A recent bookmark
- // app launch will provide an engagement boost to the origin.
- SiteEngagementService* service = SiteEngagementService::Get(params.profile);
- service->SetLastShortcutLaunchTime(url);
- }
// Record v1 app launch. Platform app launch is recorded when dispatching
// the onLaunched event.
@@ -348,6 +340,25 @@ WebContents* OpenEnabledApplication(const AppLaunchParams& params) {
NOTREACHED();
break;
}
+
+ if (extension->from_bookmark()) {
+ UMA_HISTOGRAM_ENUMERATION("Extensions.BookmarkAppLaunchContainer",
+ params.container,
+ extensions::NUM_LAUNCH_CONTAINERS);
+
+ // Record the launch time in the site engagement service. A recent bookmark
+ // app launch will provide an engagement boost to the origin.
+ SiteEngagementService* service = SiteEngagementService::Get(params.profile);
+ service->SetLastShortcutLaunchTime(url);
+
+ // Refresh the app banner added to homescreen event. The user may have
+ // cleared their browsing data since installing the app, which removes the
+ // event and will potentially permit a banner to be shown for the site.
+ AppBannerSettingsHelper::RecordBannerEvent(
+ tab, url, url.spec(),
+ AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN,
+ base::Time::Now());
+ }
return tab;
}
« no previous file with comments | « chrome/browser/extensions/bookmark_app_helper_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698