| 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 15 matching lines...) Expand all Loading... |
| 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 bool IsEnabled(); | 33 static bool IsEnabled(); |
| 34 static void DisableSecureSchemeCheckForTesting(); | 34 static void DisableSecureSchemeCheckForTesting(); |
| 35 | 35 |
| 36 // Returns whether or not the URLs match for everything except for the ref. |
| 37 static bool URLsAreForTheSamePage(const GURL& first, const GURL& second); |
| 38 |
| 36 explicit AppBannerManager(int icon_size); | 39 explicit AppBannerManager(int icon_size); |
| 37 ~AppBannerManager() override; | 40 ~AppBannerManager() override; |
| 38 | 41 |
| 39 // WebContentsObserver overrides. | 42 // WebContentsObserver overrides. |
| 40 void DidFinishLoad(content::RenderFrameHost* render_frame_host, | 43 void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
| 41 const GURL& validated_url) override; | 44 const GURL& validated_url) override; |
| 42 | 45 |
| 43 // AppBannerDataFetcher::Delegate overrides. | 46 // AppBannerDataFetcher::Delegate overrides. |
| 44 bool OnInvalidManifest(AppBannerDataFetcher* fetcher) override; | 47 bool OnInvalidManifest(AppBannerDataFetcher* fetcher) override; |
| 45 | 48 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // longer than the lifetime of this banner manager. The banner manager | 81 // longer than the lifetime of this banner manager. The banner manager |
| 79 // might be gone when calls sent to the ServiceWorkerContext are completed. | 82 // might be gone when calls sent to the ServiceWorkerContext are completed. |
| 80 base::WeakPtrFactory<AppBannerManager> weak_factory_; | 83 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 81 | 84 |
| 82 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 85 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 83 }; // class AppBannerManager | 86 }; // class AppBannerManager |
| 84 | 87 |
| 85 } // namespace banners | 88 } // namespace banners |
| 86 | 89 |
| 87 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 90 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |