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

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

Issue 2969163002: Remove AppBannerManager::event_request_id(). (Closed)
Patch Set: Comments 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
« no previous file with comments | « chrome/browser/banners/app_banner_manager.h ('k') | chrome/browser/banners/app_banner_manager_desktop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/banners/app_banner_manager.cc
diff --git a/chrome/browser/banners/app_banner_manager.cc b/chrome/browser/banners/app_banner_manager.cc
index ee166f2f946fd83b6c08b95142952d2ccc8668de..2692f31cfe5f243fc9720bb06c07b076ec8efe73 100644
--- a/chrome/browser/banners/app_banner_manager.cc
+++ b/chrome/browser/banners/app_banner_manager.cc
@@ -30,7 +30,6 @@
namespace {
-int gCurrentRequestID = -1;
int gTimeDeltaInDaysForTesting = 0;
InstallableParams ParamsToGetManifest() {
@@ -66,6 +65,9 @@ void AppBannerManager::RequestAppBanner(const GURL& validated_url,
if (is_active_or_pending()) {
DCHECK(is_debug_mode);
weak_factory_.InvalidateWeakPtrs();
benwells 2017/07/06 07:22:39 Nit: can you factor this out into a separate funct
dominickn 2017/07/07 00:35:40 Done.
+ binding_.Close();
+ controller_.reset();
+ event_.reset();
}
UpdateState(State::ACTIVE);
@@ -115,20 +117,14 @@ void AppBannerManager::OnInstall() {
installation_service->OnInstall();
}
-void AppBannerManager::SendBannerAccepted(int request_id) {
- if (request_id != gCurrentRequestID)
- return;
-
- DCHECK(event_.is_bound());
- event_->BannerAccepted(GetBannerType());
+void AppBannerManager::SendBannerAccepted() {
+ if (event_.is_bound())
+ event_->BannerAccepted(GetBannerType());
}
-void AppBannerManager::SendBannerDismissed(int request_id) {
- if (request_id != gCurrentRequestID)
- return;
-
- DCHECK(event_.is_bound());
- event_->BannerDismissed();
+void AppBannerManager::SendBannerDismissed() {
+ if (event_.is_bound())
+ event_->BannerDismissed();
}
base::WeakPtr<AppBannerManager> AppBannerManager::GetWeakPtr() {
@@ -141,7 +137,6 @@ AppBannerManager::AppBannerManager(content::WebContents* web_contents)
Profile::FromBrowserContext(web_contents->GetBrowserContext()))),
state_(State::INACTIVE),
manager_(InstallableManager::FromWebContents(web_contents)),
- event_request_id_(-1),
binding_(this),
has_sufficient_engagement_(false),
load_finished_(false),
@@ -352,9 +347,7 @@ void AppBannerManager::Stop() {
void AppBannerManager::SendBannerPromptRequest() {
RecordCouldShowBanner();
-
TrackBeforeInstallEvent(BEFORE_INSTALL_EVENT_CREATED);
- event_request_id_ = ++gCurrentRequestID;
web_contents()->GetMainFrame()->GetRemoteInterfaces()->GetInterface(
mojo::MakeRequest(&controller_));
« no previous file with comments | « chrome/browser/banners/app_banner_manager.h ('k') | chrome/browser/banners/app_banner_manager_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698