Chromium Code Reviews| Index: chrome/browser/android/shortcut_helper.cc |
| diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc |
| index 0131235a0bd00941a492a282df336dae94cea224..9ee1d426ccddfa052c457bbc70a55b42a243ba6e 100644 |
| --- a/chrome/browser/android/shortcut_helper.cc |
| +++ b/chrome/browser/android/shortcut_helper.cc |
| @@ -17,6 +17,7 @@ |
| #include "base/threading/worker_pool.h" |
| #include "chrome/browser/android/manifest_icon_selector.h" |
| #include "chrome/browser/android/tab_android.h" |
| +#include "chrome/browser/banners/app_banner_settings_helper.h" |
| #include "chrome/browser/favicon/favicon_service.h" |
| #include "chrome/browser/favicon/favicon_service_factory.h" |
| #include "chrome/browser/profiles/profile.h" |
| @@ -218,6 +219,8 @@ void ShortcutHelper::AddShortcutUsingManifestIcon() { |
| // Stop observing so we don't get destroyed while doing the last steps. |
| Observe(NULL); |
| + RecordAddToHomescreen(); |
| + |
| base::WorkerPool::PostTask( |
| FROM_HERE, |
| base::Bind(&ShortcutHelper::AddShortcutInBackgroundWithSkBitmap, |
| @@ -229,6 +232,8 @@ void ShortcutHelper::AddShortcutUsingManifestIcon() { |
| } |
| void ShortcutHelper::AddShortcutUsingFavicon() { |
| + RecordAddToHomescreen(); |
|
gone
2015/02/17 17:58:43
The common point in the pathway for these is to go
benwells
2015/02/17 19:49:53
That's true but it is on the wrong thread. See htt
gone
2015/02/17 19:52:08
Hrm, fair point.
|
| + |
| Profile* profile = |
| Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| @@ -336,3 +341,12 @@ void ShortcutHelper::AddShortcutInBackgroundWithSkBitmap( |
| info.display == content::Manifest::DISPLAY_MODE_STANDALONE, |
| info.orientation); |
| } |
| + |
| +void ShortcutHelper::RecordAddToHomescreen() { |
| + // Record that the shortcut has been added, so no banners will be shown |
| + // for this app. |
| + AppBannerSettingsHelper::RecordBannerEvent( |
| + web_contents(), shortcut_info_.url, shortcut_info_.url.spec(), |
| + AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, |
| + base::Time::Now()); |
| +} |