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_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "components/infobars/core/confirm_infobar_delegate.h" | 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Called when the infobar has been destroyed. | 36 // Called when the infobar has been destroyed. |
37 virtual void OnInfoBarDestroyed() = 0; | 37 virtual void OnInfoBarDestroyed() = 0; |
38 | 38 |
39 // Returns the title of the app. | 39 // Returns the title of the app. |
40 virtual base::string16 GetTitle() const = 0; | 40 virtual base::string16 GetTitle() const = 0; |
41 | 41 |
42 // Returns the icon to display for the app. | 42 // Returns the icon to display for the app. |
43 virtual gfx::Image GetIcon() const = 0; | 43 virtual gfx::Image GetIcon() const = 0; |
44 }; | 44 }; |
45 | 45 |
| 46 // Creates a banner for the current page that promotes a native app. |
| 47 // May return nullptr if the the infobar couldn't be created. |
| 48 static AppBannerInfoBar* CreateForNativeApp( |
| 49 infobars::InfoBarManager* infobar_manager, |
| 50 AppDelegate* delegate, |
| 51 const base::android::ScopedJavaGlobalRef<jobject>& japp_data); |
| 52 |
46 // Creates a banner for the current page that promotes a web app. | 53 // Creates a banner for the current page that promotes a web app. |
47 // May return nullptr if the the infobar couldn't be created. | 54 // May return nullptr if the the infobar couldn't be created. |
48 static AppBannerInfoBar* CreateForWebApp( | 55 static AppBannerInfoBar* CreateForWebApp( |
49 infobars::InfoBarManager* infobar_manager, | 56 infobars::InfoBarManager* infobar_manager, |
50 AppDelegate* delegate, | 57 AppDelegate* delegate, |
51 const GURL& url); | 58 const GURL& url); |
52 | 59 |
53 ~AppBannerInfoBarDelegate() override; | 60 ~AppBannerInfoBarDelegate() override; |
54 | 61 |
55 // InfoBarDelegate overrides. | 62 // InfoBarDelegate overrides. |
(...skipping 11 matching lines...) Expand all Loading... |
67 AppDelegate* delegate_; | 74 AppDelegate* delegate_; |
68 | 75 |
69 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegate); | 76 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegate); |
70 }; // AppBannerInfoBarDelegate | 77 }; // AppBannerInfoBarDelegate |
71 | 78 |
72 } // namespace banners | 79 } // namespace banners |
73 | 80 |
74 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env); | 81 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env); |
75 | 82 |
76 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ | 83 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
OLD | NEW |