| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |