Chromium Code Reviews| Index: chrome/browser/installable/installable_manager.h |
| diff --git a/chrome/browser/installable/installable_manager.h b/chrome/browser/installable/installable_manager.h |
| index 5d56abd0e35b2c22e0a9c43bcf3e4b70d394e9b1..85a52ad4c8e34ef7b02e330280f26ed8f7b29ad1 100644 |
| --- a/chrome/browser/installable/installable_manager.h |
| +++ b/chrome/browser/installable/installable_manager.h |
| @@ -16,6 +16,7 @@ |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| #include "chrome/browser/installable/installable_logging.h" |
| +#include "chrome/browser/installable/installable_metrics.h" |
| #include "content/public/browser/service_worker_context.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/browser/web_contents_user_data.h" |
| @@ -128,7 +129,14 @@ class InstallableManager |
| virtual void GetData(const InstallableParams& params, |
| const InstallableCallback& callback); |
| + // Called via AppBannerManagerAndroid to record metrics on how often the |
| + // installable check is completed when the menu or add to homescreen menu item |
| + // is opened on Android. |
| + void RecordMenuOpenHistogram(); |
| + void RecordMenuItemAddToHomescreenHistogram(); |
| + |
| private: |
| + friend class InstallableManagerBrowserTest; |
| friend class InstallableManagerUnitTest; |
| FRIEND_TEST_ALL_PREFIXES(InstallableManagerBrowserTest, |
| ManagerBeginsInEmptyState); |
| @@ -218,6 +226,17 @@ class InstallableManager |
| std::unique_ptr<InstallableProperty> installable_; |
| std::map<IconParams, IconProperty> icons_; |
| + // A representation of the progress of the PWA check. This is reset per |
| + // navigation and is independent of the caching mechanism, i.e. if a PWA check |
| + // is run multiple times, this will be set on the first run. |
| + InstallableMetrics::InstallabilityCheckStatus status_; |
|
benwells
2017/03/30 08:22:37
This variable is kinda subtle (e.g. you need to co
dominickn
2017/03/30 23:42:53
Done.
|
| + |
| + // Counts for the number of queued requests of the menu and add to homescreen |
| + // menu item there have been whilst the installable check is awaiting |
| + // completion. Used for metrics recording. |
| + int menu_opened_count_; |
| + int menu_item_add_to_homescreen_count_; |
| + |
| bool is_active_; |
| base::WeakPtrFactory<InstallableManager> weak_factory_; |