| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 static void DisableSecureSchemeCheckForTesting(); | 33 static void DisableSecureSchemeCheckForTesting(); |
| 34 | 34 |
| 35 static void SetEngagementWeights(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 // Requests an app banner. Set |is_debug_mode| when it is triggered by the | 41 // Requests an app banner. Set |is_debug_mode| when it is triggered by the |
| 42 // developer's action in DevTools. | 42 // developer's action in DevTools. |
| 43 void RequestAppBanner(const GURL& validated_url, bool is_debug_mode); | 43 virtual void RequestAppBanner(const GURL& validated_url, bool is_debug_mode); |
| 44 | 44 |
| 45 ~AppBannerManager() override; | 45 ~AppBannerManager() override; |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 explicit AppBannerManager(content::WebContents* web_contents); | 48 explicit AppBannerManager(content::WebContents* web_contents); |
| 49 | 49 |
| 50 void ReplaceWebContents(content::WebContents* web_contents); | 50 void ReplaceWebContents(content::WebContents* web_contents); |
| 51 | 51 |
| 52 // Creates an AppBannerDataFetcher, which constructs an app banner. | 52 // Creates an AppBannerDataFetcher, which constructs an app banner. |
| 53 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher( | 53 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher( |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // longer than the lifetime of this banner manager. The banner manager | 104 // longer than the lifetime of this banner manager. The banner manager |
| 105 // might be gone when calls sent to the ServiceWorkerContext are completed. | 105 // might be gone when calls sent to the ServiceWorkerContext are completed. |
| 106 base::WeakPtrFactory<AppBannerManager> weak_factory_; | 106 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 108 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 109 }; // class AppBannerManager | 109 }; // class AppBannerManager |
| 110 | 110 |
| 111 } // namespace banners | 111 } // namespace banners |
| 112 | 112 |
| 113 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 113 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |