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

Side by Side Diff: chrome/browser/banners/app_banner_manager.cc

Issue 2910363002: Propagate a user gesture bit for beforeinstallprompt.prompt() (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/banners/app_banner_manager.h" 5 #include "chrome/browser/banners/app_banner_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 DCHECK(!manifest_url_.is_empty()); 548 DCHECK(!manifest_url_.is_empty());
549 DCHECK(!manifest_.IsEmpty()); 549 DCHECK(!manifest_.IsEmpty());
550 DCHECK(!primary_icon_url_.is_empty()); 550 DCHECK(!primary_icon_url_.is_empty());
551 DCHECK(!primary_icon_.drawsNothing()); 551 DCHECK(!primary_icon_.drawsNothing());
552 552
553 TrackBeforeInstallEvent(BEFORE_INSTALL_EVENT_COMPLETE); 553 TrackBeforeInstallEvent(BEFORE_INSTALL_EVENT_COMPLETE);
554 ShowBanner(); 554 ShowBanner();
555 UpdateState(State::COMPLETE); 555 UpdateState(State::COMPLETE);
556 } 556 }
557 557
558 void AppBannerManager::DisplayAppBanner() { 558 void AppBannerManager::DisplayAppBanner(bool user_gesture) {
559 if (is_pending_event()) { 559 if (is_pending_event()) {
560 // Simulate a non-canceled OnBannerPromptReply to show the delayed banner. 560 // Simulate a non-canceled OnBannerPromptReply to show the delayed banner.
561 OnBannerPromptReply(blink::mojom::AppBannerPromptReply::NONE, referrer_); 561 OnBannerPromptReply(blink::mojom::AppBannerPromptReply::NONE, referrer_);
562 } else { 562 } else {
563 // Log that the prompt request was made for when we get the prompt reply. 563 // Log that the prompt request was made for when we get the prompt reply.
564 page_requested_prompt_ = true; 564 page_requested_prompt_ = true;
565 } 565 }
566 } 566 }
567 567
568 } // namespace banners 568 } // namespace banners
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_manager.h ('k') | content/shell/test_runner/app_banner_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698