Chromium Code Reviews| 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/callback.h" | 10 #include "base/callback.h" |
|
dominickn
2017/03/01 02:29:40
Remove this include.
| |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "chrome/browser/banners/app_banner_metrics.h" | 14 #include "chrome/browser/banners/app_banner_metrics.h" |
| 15 #include "chrome/browser/banners/app_banner_settings_helper.h" | 15 #include "chrome/browser/banners/app_banner_settings_helper.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/engagement/site_engagement_service.h" | 17 #include "chrome/browser/engagement/site_engagement_service.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "components/rappor/public/rappor_utils.h" | 20 #include "components/rappor/public/rappor_utils.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 } | 133 } |
| 134 | 134 |
| 135 void AppBannerManager::SendBannerDismissed(int request_id) { | 135 void AppBannerManager::SendBannerDismissed(int request_id) { |
| 136 if (request_id != gCurrentRequestID) | 136 if (request_id != gCurrentRequestID) |
| 137 return; | 137 return; |
| 138 | 138 |
| 139 DCHECK(event_.is_bound()); | 139 DCHECK(event_.is_bound()); |
| 140 event_->BannerDismissed(); | 140 event_->BannerDismissed(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 base::Closure AppBannerManager::FetchWebappSplashScreenImageCallback( | |
| 144 const std::string& webapp_id) { | |
| 145 return base::Closure(); | |
| 146 } | |
| 147 | |
| 148 AppBannerManager::AppBannerManager(content::WebContents* web_contents) | 143 AppBannerManager::AppBannerManager(content::WebContents* web_contents) |
| 149 : content::WebContentsObserver(web_contents), | 144 : content::WebContentsObserver(web_contents), |
| 150 SiteEngagementObserver(nullptr), | 145 SiteEngagementObserver(nullptr), |
| 151 manager_(nullptr), | 146 manager_(nullptr), |
| 152 event_request_id_(-1), | 147 event_request_id_(-1), |
| 153 binding_(this), | 148 binding_(this), |
| 154 is_active_(false), | 149 is_active_(false), |
| 155 banner_request_queued_(false), | 150 banner_request_queued_(false), |
| 156 load_finished_(false), | 151 load_finished_(false), |
| 157 was_canceled_by_page_(false), | 152 was_canceled_by_page_(false), |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 // Simulate a non-canceled OnBannerPromptReply to show the delayed banner. | 528 // Simulate a non-canceled OnBannerPromptReply to show the delayed banner. |
| 534 // Don't reset |was_canceled_by_page_| yet for metrics purposes. | 529 // Don't reset |was_canceled_by_page_| yet for metrics purposes. |
| 535 OnBannerPromptReply(blink::mojom::AppBannerPromptReply::NONE, referrer_); | 530 OnBannerPromptReply(blink::mojom::AppBannerPromptReply::NONE, referrer_); |
| 536 } else { | 531 } else { |
| 537 // Log that the prompt request was made for when we get the prompt reply. | 532 // Log that the prompt request was made for when we get the prompt reply. |
| 538 page_requested_prompt_ = true; | 533 page_requested_prompt_ = true; |
| 539 } | 534 } |
| 540 } | 535 } |
| 541 | 536 |
| 542 } // namespace banners | 537 } // namespace banners |
| OLD | NEW |