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

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

Issue 2942513002: Allow banners to trigger on sites which don't register a service worker onload. (Closed)
Patch Set: Fix windows compile Created 3 years, 6 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 d14251b7dc4aeaf9c35048e288ad112c24d9f9f9..ebb8cbe3214d866d11e739693e19786e68fc9463 100644
--- a/chrome/browser/banners/app_banner_manager.h
+++ b/chrome/browser/banners/app_banner_manager.h
@@ -101,6 +101,14 @@ class AppBannerManager : public content::WebContentsObserver,
// The banner pipeline is currently running for this page load.
ACTIVE,
+ // The banner pipeline is currently waiting for the page manifest to be
+ // fetched.
+ PENDING_MANIFEST,
+
+ // The banner pipeline is currently waiting for the installability criteria
+ // to be checked.
+ PENDING_INSTALLABLE_CHECK,
+
// The banner pipeline has finished running, but is waiting for sufficient
// engagement to trigger the banner.
PENDING_ENGAGEMENT,
@@ -212,8 +220,18 @@ class AppBannerManager : public content::WebContentsObserver,
int event_request_id() const { return event_request_id_; }
bool is_active() const { return state_ == State::ACTIVE; }
bool is_active_or_pending() const {
- return state_ == State::ACTIVE || state_ == State::PENDING_ENGAGEMENT ||
- state_ == State::PENDING_EVENT;
+ switch (state_) {
+ case State::ACTIVE:
+ case State::PENDING_MANIFEST:
+ case State::PENDING_INSTALLABLE_CHECK:
+ case State::PENDING_ENGAGEMENT:
+ case State::PENDING_EVENT:
+ return true;
+ case State::INACTIVE:
+ case State::COMPLETE:
+ return false;
+ }
+ return false;
}
bool is_complete() const { return state_ == State::COMPLETE; }
bool is_pending_engagement() const {

Powered by Google App Engine
This is Rietveld 408576698