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_MANAGER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "chrome/browser/banners/app_banner_manager.h" | 13 #include "chrome/browser/banners/app_banner_manager.h" |
14 #include "content/public/browser/web_contents_user_data.h" | 14 #include "content/public/browser/web_contents_user_data.h" |
| 15 #include "third_party/skia/include/core/SkBitmap.h" |
15 | 16 |
16 namespace banners { | 17 namespace banners { |
17 | 18 |
18 // Extends the AppBannerManager to support native Android apps. This class owns | 19 // Extends the AppBannerManager to support native Android apps. This class owns |
19 // a Java-side AppBannerManager which interfaces with the Java runtime to fetch | 20 // a Java-side AppBannerManager which interfaces with the Java runtime to fetch |
20 // native app data and install them when requested. | 21 // native app data and install them when requested. |
21 // | 22 // |
22 // A site requests a native app banner by setting "prefer_related_applications" | 23 // A site requests a native app banner by setting "prefer_related_applications" |
23 // to true in its manifest, and providing at least one related application for | 24 // to true in its manifest, and providing at least one related application for |
24 // the "play" platform with a Play Store ID. | 25 // the "play" platform with a Play Store ID. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // true, only a native app banner may be shown, and the web app banner flow | 99 // true, only a native app banner may be shown, and the web app banner flow |
99 // will not be run. | 100 // will not be run. |
100 bool CanHandleNonWebApp(const std::string& platform, | 101 bool CanHandleNonWebApp(const std::string& platform, |
101 const GURL& url, | 102 const GURL& url, |
102 const std::string& id); | 103 const std::string& id); |
103 | 104 |
104 // The URL of the badge icon. | 105 // The URL of the badge icon. |
105 GURL badge_icon_url_; | 106 GURL badge_icon_url_; |
106 | 107 |
107 // The badge icon object. | 108 // The badge icon object. |
108 std::unique_ptr<SkBitmap> badge_icon_; | 109 SkBitmap badge_icon_; |
109 | 110 |
110 // The Java-side AppBannerManager. | 111 // The Java-side AppBannerManager. |
111 base::android::ScopedJavaGlobalRef<jobject> java_banner_manager_; | 112 base::android::ScopedJavaGlobalRef<jobject> java_banner_manager_; |
112 | 113 |
113 // Java-side object containing data about a native app. | 114 // Java-side object containing data about a native app. |
114 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; | 115 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; |
115 | 116 |
116 // App package name for a native app banner. | 117 // App package name for a native app banner. |
117 std::string native_app_package_; | 118 std::string native_app_package_; |
118 | 119 |
119 // Whether WebAPKs can be installed. | 120 // Whether WebAPKs can be installed. |
120 bool can_install_webapk_; | 121 bool can_install_webapk_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); | 123 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace banners | 126 } // namespace banners |
126 | 127 |
127 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 128 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
OLD | NEW |