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

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

Issue 2969163002: Remove AppBannerManager::event_request_id(). (Closed)
Patch Set: Refactor into method Created 3 years, 5 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 fa59da5e983673e700dffeb9a531c51ebecd86ee..d2745644c8cee872e0692fe2a48adea7ccafb074 100644
--- a/chrome/browser/banners/app_banner_manager.h
+++ b/chrome/browser/banners/app_banner_manager.h
@@ -68,13 +68,11 @@ class AppBannerManager : public content::WebContentsObserver,
// resolved, but is required by the install event spec.
void OnInstall();
- // Sends a message to the renderer that the user accepted the banner. Does
- // nothing if |request_id| does not match the current request.
- void SendBannerAccepted(int request_id);
+ // Sends a message to the renderer that the user accepted the banner.
+ void SendBannerAccepted();
- // Sends a message to the renderer that the user dismissed the banner. Does
- // nothing if |request_id| does not match the current request.
- void SendBannerDismissed(int request_id);
+ // Sends a message to the renderer that the user dismissed the banner.
+ void SendBannerDismissed();
// Returns a WeakPtr to this object. Exposed so subclasses/infobars may
// may bind callbacks without needing their own WeakPtrFactory.
@@ -217,7 +215,6 @@ class AppBannerManager : public content::WebContentsObserver,
// Subclass accessors for private fields which should not be changed outside
// this class.
InstallableManager* manager() const { return manager_; }
- int event_request_id() const { return event_request_id_; }
bool is_active() const { return state_ == State::ACTIVE; }
bool is_active_or_pending() const {
switch (state_) {
@@ -266,6 +263,9 @@ class AppBannerManager : public content::WebContentsObserver,
private:
friend class AppBannerManagerTest;
+ // Voids all outstanding weak pointers and service pointers.
+ void ResetBindings();
+
// Record that the banner could be shown at this point, if the triggering
// heuristic allowed.
void RecordCouldShowBanner();
@@ -288,10 +288,6 @@ class AppBannerManager : public content::WebContentsObserver,
// Fetches the data required to display a banner for the current page.
InstallableManager* manager_;
- // A monotonically increasing id to verify the response to the
- // beforeinstallprompt event from the renderer.
- int event_request_id_;
-
// We do not want to trigger a banner when the manager is attached to
// a WebContents that is playing video. Banners triggering on a site in the
// background will appear when the tab is reactivated.
« no previous file with comments | « chrome/browser/banners/app_banner_infobar_delegate_desktop.cc ('k') | chrome/browser/banners/app_banner_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698