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_DESKTOP_H_ | 5 #ifndef CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_DESKTOP_H_ |
6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_DESKTOP_H_ | 6 #define CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_DESKTOP_H_ |
7 | 7 |
8 #include "chrome/browser/banners/app_banner_manager.h" | 8 #include "chrome/browser/banners/app_banner_manager.h" |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "content/public/browser/web_contents_user_data.h" | 11 #include "content/public/browser/web_contents_user_data.h" |
12 | 12 |
| 13 namespace extensions { |
| 14 class BookmarkAppHelper; |
| 15 } |
| 16 |
13 namespace banners { | 17 namespace banners { |
14 | 18 |
| 19 // Manages web app banners for desktop platforms. |
15 class AppBannerManagerDesktop | 20 class AppBannerManagerDesktop |
16 : public AppBannerManager, | 21 : public AppBannerManager, |
17 public content::WebContentsUserData<AppBannerManagerDesktop> { | 22 public content::WebContentsUserData<AppBannerManagerDesktop> { |
18 | |
19 public: | 23 public: |
20 static bool IsEnabled(); | 24 static bool IsEnabled(); |
21 | 25 |
22 protected: | 26 private: |
23 AppBannerDataFetcher* CreateAppBannerDataFetcher( | 27 friend class content::WebContentsUserData<AppBannerManagerDesktop>; |
24 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate, | |
25 bool is_debug_mode) override; | |
26 | 28 |
27 private: | |
28 explicit AppBannerManagerDesktop(content::WebContents* web_contents); | 29 explicit AppBannerManagerDesktop(content::WebContents* web_contents); |
29 friend class content::WebContentsUserData<AppBannerManagerDesktop>; | 30 ~AppBannerManagerDesktop() override; |
| 31 |
| 32 // AppBannerManager overrides. |
| 33 void DidFinishCreatingBookmarkApp( |
| 34 const extensions::Extension* extension, |
| 35 const WebApplicationInfo& web_app_info) override; |
| 36 bool IsWebAppInstalled(content::BrowserContext* browser_context, |
| 37 const GURL& start_url) override; |
| 38 void ShowBanner() override; |
| 39 |
| 40 // content::WebContentsObserver override. |
| 41 void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
| 42 const GURL& validated_url) override; |
| 43 |
| 44 // SiteEngagementObserver override. |
| 45 void OnEngagementIncreased(content::WebContents* web_contents, |
| 46 const GURL& url, |
| 47 double score) override; |
| 48 |
| 49 std::unique_ptr<extensions::BookmarkAppHelper> bookmark_app_helper_; |
30 | 50 |
31 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerDesktop); | 51 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerDesktop); |
32 }; | 52 }; |
33 | 53 |
34 } // namespace banners | 54 } // namespace banners |
35 | 55 |
36 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_DESKTOP_H_ | 56 #endif // CHROME_BROWSER_BANNERS_APP_BANNER_MANAGER_DESKTOP_H_ |
OLD | NEW |