| 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_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 class AppBannerManager; | 33 class AppBannerManager; |
| 34 | 34 |
| 35 // Manages installation of an app being promoted by a page. | 35 // Manages installation of an app being promoted by a page. |
| 36 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { | 36 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
| 37 public: | 37 public: |
| 38 // Creates an infobar and delegate for promoting the installation of a web | 38 // Creates an infobar and delegate for promoting the installation of a web |
| 39 // app, and adds the infobar to the InfoBarManager for |web_contents|. | 39 // app, and adds the infobar to the InfoBarManager for |web_contents|. |
| 40 static bool Create(content::WebContents* web_contents, | 40 static bool Create(content::WebContents* web_contents, |
| 41 base::WeakPtr<AppBannerManager> weak_manager, | 41 base::WeakPtr<AppBannerManager> weak_manager, |
| 42 const base::string16& app_title, | |
| 43 std::unique_ptr<ShortcutInfo> info, | 42 std::unique_ptr<ShortcutInfo> info, |
| 44 const SkBitmap& primary_icon, | 43 const SkBitmap& primary_icon, |
| 45 const SkBitmap& badge_icon, | 44 const SkBitmap& badge_icon, |
| 46 int event_request_id, | 45 int event_request_id, |
| 47 bool is_webapk, | 46 bool is_webapk, |
| 48 webapk::InstallSource webapk_install_source); | 47 webapk::InstallSource webapk_install_source); |
| 49 | 48 |
| 50 // Creates an infobar and delegate for promoting the installation of an | 49 // Creates an infobar and delegate for promoting the installation of an |
| 51 // Android app, and adds the infobar to the InfoBarManager for |web_contents|. | 50 // Android app, and adds the infobar to the InfoBarManager for |web_contents|. |
| 52 static bool Create( | 51 static bool Create( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // UMA metrics. | 86 // UMA metrics. |
| 88 enum InstallState { | 87 enum InstallState { |
| 89 INSTALL_NOT_STARTED, | 88 INSTALL_NOT_STARTED, |
| 90 INSTALLING, | 89 INSTALLING, |
| 91 INSTALLED, | 90 INSTALLED, |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 // Delegate for promoting a web app. | 93 // Delegate for promoting a web app. |
| 95 AppBannerInfoBarDelegateAndroid( | 94 AppBannerInfoBarDelegateAndroid( |
| 96 base::WeakPtr<AppBannerManager> weak_manager, | 95 base::WeakPtr<AppBannerManager> weak_manager, |
| 97 const base::string16& app_title, | |
| 98 std::unique_ptr<ShortcutInfo> info, | 96 std::unique_ptr<ShortcutInfo> info, |
| 99 const SkBitmap& primary_icon, | 97 const SkBitmap& primary_icon, |
| 100 const SkBitmap& badge_icon, | 98 const SkBitmap& badge_icon, |
| 101 int event_request_id, | 99 int event_request_id, |
| 102 bool is_webapk, | 100 bool is_webapk, |
| 103 webapk::InstallSource webapk_install_source); | 101 webapk::InstallSource webapk_install_source); |
| 104 | 102 |
| 105 // Delegate for promoting an Android app. | 103 // Delegate for promoting an Android app. |
| 106 AppBannerInfoBarDelegateAndroid( | 104 AppBannerInfoBarDelegateAndroid( |
| 107 const base::string16& app_title, | 105 const base::string16& app_title, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 174 |
| 177 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); | 175 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); |
| 178 }; | 176 }; |
| 179 | 177 |
| 180 // Register native methods. | 178 // Register native methods. |
| 181 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); | 179 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); |
| 182 | 180 |
| 183 } // namespace banners | 181 } // namespace banners |
| 184 | 182 |
| 185 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 183 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| OLD | NEW |