| 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 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * | 25 * |
| 26 * Hooks the wiring together for getting the data for a particular app. | 26 * Hooks the wiring together for getting the data for a particular app. |
| 27 * Monitors at most one app at a time, tracking the info for the most recently | 27 * Monitors at most one app at a time, tracking the info for the most recently |
| 28 * requested app. Any work in progress for other apps is discarded. | 28 * requested app. Any work in progress for other apps is discarded. |
| 29 */ | 29 */ |
| 30 class AppBannerManager : public content::WebContentsObserver, | 30 class AppBannerManager : public content::WebContentsObserver, |
| 31 public AppBannerDataFetcher::Delegate { | 31 public AppBannerDataFetcher::Delegate { |
| 32 public: | 32 public: |
| 33 static void DisableSecureSchemeCheckForTesting(); | 33 static void DisableSecureSchemeCheckForTesting(); |
| 34 | 34 |
| 35 static void ForceEngagementWeightsForTesting(double direct_engagement, | 35 static void SetEngagementWeights(double direct_engagement, |
| 36 double indirect_engagement); | 36 double indirect_engagement); |
| 37 | 37 |
| 38 // Returns whether or not the URLs match for everything except for the ref. | 38 // Returns whether or not the URLs match for everything except for the ref. |
| 39 static bool URLsAreForTheSamePage(const GURL& first, const GURL& second); | 39 static bool URLsAreForTheSamePage(const GURL& first, const GURL& second); |
| 40 | 40 |
| 41 explicit AppBannerManager(int icon_size); | 41 explicit AppBannerManager(int icon_size); |
| 42 ~AppBannerManager() override; | 42 ~AppBannerManager() override; |
| 43 | 43 |
| 44 // WebContentsObserver overrides. | 44 // WebContentsObserver overrides. |
| 45 void DidCommitProvisionalLoadForFrame( | 45 void DidCommitProvisionalLoadForFrame( |
| 46 content::RenderFrameHost* render_frame_host, | 46 content::RenderFrameHost* render_frame_host, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // longer than the lifetime of this banner manager. The banner manager | 95 // longer than the lifetime of this banner manager. The banner manager |
| 96 // might be gone when calls sent to the ServiceWorkerContext are completed. | 96 // might be gone when calls sent to the ServiceWorkerContext are completed. |
| 97 base::WeakPtrFactory<AppBannerManager> weak_factory_; | 97 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 99 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 100 }; // class AppBannerManager | 100 }; // class AppBannerManager |
| 101 | 101 |
| 102 } // namespace banners | 102 } // namespace banners |
| 103 | 103 |
| 104 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 104 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |