| 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 "chrome/browser/banners/app_banner_data_fetcher.h" | 7 #include "chrome/browser/banners/app_banner_data_fetcher.h" |
| 8 #include "chrome/browser/banners/app_banner_debug_log.h" | 8 #include "chrome/browser/banners/app_banner_debug_log.h" |
| 9 #include "chrome/browser/banners/app_banner_settings_helper.h" | 9 #include "chrome/browser/banners/app_banner_settings_helper.h" |
| 10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 bool AppBannerManager::URLsAreForTheSamePage(const GURL& first, | 24 bool AppBannerManager::URLsAreForTheSamePage(const GURL& first, |
| 25 const GURL& second) { | 25 const GURL& second) { |
| 26 return first.GetWithEmptyPath() == second.GetWithEmptyPath() && | 26 return first.GetWithEmptyPath() == second.GetWithEmptyPath() && |
| 27 first.path() == second.path() && first.query() == second.query(); | 27 first.path() == second.path() && first.query() == second.query(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 AppBannerManager::AppBannerManager(int icon_size) | 30 AppBannerManager::AppBannerManager(int icon_size) |
| 31 : ideal_icon_size_(icon_size), | 31 : ideal_icon_size_(icon_size), |
| 32 data_fetcher_(nullptr), | 32 data_fetcher_(nullptr), |
| 33 weak_factory_(this) { | 33 weak_factory_(this) { |
| 34 AppBannerSettingsHelper::UpdateMinutesBetweenVisits(); |
| 34 } | 35 } |
| 35 | 36 |
| 36 AppBannerManager::AppBannerManager(content::WebContents* web_contents, | 37 AppBannerManager::AppBannerManager(content::WebContents* web_contents, |
| 37 int icon_size) | 38 int icon_size) |
| 38 : content::WebContentsObserver(web_contents), | 39 : content::WebContentsObserver(web_contents), |
| 39 ideal_icon_size_(icon_size), | 40 ideal_icon_size_(icon_size), |
| 40 data_fetcher_(nullptr), | 41 data_fetcher_(nullptr), |
| 41 weak_factory_(this) { | 42 weak_factory_(this) { |
| 43 AppBannerSettingsHelper::UpdateMinutesBetweenVisits(); |
| 42 } | 44 } |
| 43 | 45 |
| 44 AppBannerManager::~AppBannerManager() { | 46 AppBannerManager::~AppBannerManager() { |
| 45 CancelActiveFetcher(); | 47 CancelActiveFetcher(); |
| 46 } | 48 } |
| 47 | 49 |
| 48 void AppBannerManager::DidCommitProvisionalLoadForFrame( | 50 void AppBannerManager::DidCommitProvisionalLoadForFrame( |
| 49 content::RenderFrameHost* render_frame_host, | 51 content::RenderFrameHost* render_frame_host, |
| 50 const GURL& url, | 52 const GURL& url, |
| 51 ui::PageTransition transition_type) { | 53 ui::PageTransition transition_type) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 107 } |
| 106 | 108 |
| 107 void AppBannerManager::ForceEngagementWeightsForTesting( | 109 void AppBannerManager::ForceEngagementWeightsForTesting( |
| 108 double direct_engagement, | 110 double direct_engagement, |
| 109 double indirect_engagement) { | 111 double indirect_engagement) { |
| 110 AppBannerSettingsHelper::SetEngagementWeights(direct_engagement, | 112 AppBannerSettingsHelper::SetEngagementWeights(direct_engagement, |
| 111 indirect_engagement); | 113 indirect_engagement); |
| 112 } | 114 } |
| 113 | 115 |
| 114 } // namespace banners | 116 } // namespace banners |
| OLD | NEW |