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

Unified Diff: chrome/browser/banners/app_banner_manager.h

Issue 2178833002: Add new app banner metrics using InstallableStatusCode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@banner-integrate-checker-no-refptr
Patch Set: Fix histogram name Created 4 years, 4 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_manager.h
diff --git a/chrome/browser/banners/app_banner_manager.h b/chrome/browser/banners/app_banner_manager.h
index a022de1774ab735e8fe358a35264dba0630a0464..19fd112a6306fe571c3f4ae740a979694dbdb5bc 100644
--- a/chrome/browser/banners/app_banner_manager.h
+++ b/chrome/browser/banners/app_banner_manager.h
@@ -103,7 +103,7 @@ class AppBannerManager : public content::WebContentsObserver,
// Returns a string parameter for a devtools console message corresponding to
// |code|. Returns the empty string if |code| requires no parameter.
- std::string GetErrorParam(InstallableErrorCode code);
+ std::string GetStatusParam(InstallableStatusCode code);
// Returns the ideal and minimum icon sizes required for being installable.
virtual int GetIdealIconSizeInDp();
@@ -115,7 +115,7 @@ class AppBannerManager : public content::WebContentsObserver,
// Returns true if |is_debug_mode_| is true or the
// kBypassAppBannerEngagementChecks flag is set.
- bool IsDebugMode() const;
+ virtual bool IsDebugMode() const;
// Returns true if the webapp at |start_url| has already been installed.
virtual bool IsWebAppInstalled(content::BrowserContext* browser_context,
@@ -142,11 +142,12 @@ class AppBannerManager : public content::WebContentsObserver,
// Logs an error message corresponding to |code| to the devtools console
// attached to |web_contents|. Does nothing if IsDebugMode() returns false.
- void ReportError(content::WebContents* web_contents,
- InstallableErrorCode code);
+ void ReportStatus(content::WebContents* web_contents,
+ InstallableStatusCode code);
- // Stops the banner pipeline. Any callback currently running will terminate
- // the next time they check |is_active_|.
+ // Stops the banner pipeline, preventing any outstanding callbacks from
+ // running and resetting the manager state. This method is virtual to allow
+ // tests to intercept it and verify correct behaviour.
virtual void Stop();
// Sends a message to the renderer that the page has met the requirements to
@@ -258,6 +259,9 @@ class AppBannerManager : public content::WebContentsObserver,
// Whether we should be logging errors to the console for this request.
bool is_debug_mode_;
+ // Whether the installable status has been logged for this run.
+ bool need_to_log_status_;
+
// The concrete subclasses of this class are expected to have their lifetimes
// scoped to the WebContents which they are observing. This allows us to use
// weak pointers for callbacks.
« no previous file with comments | « chrome/browser/android/banners/app_banner_manager_android.cc ('k') | chrome/browser/banners/app_banner_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698