| 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 28 matching lines...) Expand all Loading... |
| 39 explicit AppBannerManager(int icon_size); | 39 explicit AppBannerManager(int icon_size); |
| 40 ~AppBannerManager() override; | 40 ~AppBannerManager() override; |
| 41 | 41 |
| 42 // WebContentsObserver overrides. | 42 // WebContentsObserver overrides. |
| 43 void DidFinishLoad(content::RenderFrameHost* render_frame_host, | 43 void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
| 44 const GURL& validated_url) override; | 44 const GURL& validated_url) override; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 AppBannerManager(content::WebContents* web_contents, int icon_size); | 47 AppBannerManager(content::WebContents* web_contents, int icon_size); |
| 48 | 48 |
| 49 bool ValidateFrameHostAndOrigin(content::RenderFrameHost* render_frame_host, |
| 50 const GURL& validated_url); |
| 49 void ReplaceWebContents(content::WebContents* web_contents); | 51 void ReplaceWebContents(content::WebContents* web_contents); |
| 50 | 52 |
| 51 // Creates an AppBannerDataFetcher, which constructs an app banner. | 53 // Creates an AppBannerDataFetcher, which constructs an app banner. |
| 52 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher( | 54 virtual AppBannerDataFetcher* CreateAppBannerDataFetcher( |
| 53 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate, | 55 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate, |
| 54 const int ideal_icon_size) = 0; | 56 const int ideal_icon_size) = 0; |
| 55 | 57 |
| 56 // Return whether the AppBannerDataFetcher is active. | 58 // Return whether the AppBannerDataFetcher is active. |
| 57 bool IsFetcherActive(); | 59 bool IsFetcherActive(); |
| 58 | 60 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 85 // longer than the lifetime of this banner manager. The banner manager | 87 // longer than the lifetime of this banner manager. The banner manager |
| 86 // might be gone when calls sent to the ServiceWorkerContext are completed. | 88 // might be gone when calls sent to the ServiceWorkerContext are completed. |
| 87 base::WeakPtrFactory<AppBannerManager> weak_factory_; | 89 base::WeakPtrFactory<AppBannerManager> weak_factory_; |
| 88 | 90 |
| 89 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); | 91 DISALLOW_COPY_AND_ASSIGN(AppBannerManager); |
| 90 }; // class AppBannerManager | 92 }; // class AppBannerManager |
| 91 | 93 |
| 92 } // namespace banners | 94 } // namespace banners |
| 93 | 95 |
| 94 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ | 96 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_H_ |
| OLD | NEW |