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