| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // true, only a native app banner may be shown, and the web app banner flow | 110 // true, only a native app banner may be shown, and the web app banner flow |
| 110 // will not be run. | 111 // will not be run. |
| 111 bool CanHandleNonWebApp(const std::string& platform, | 112 bool CanHandleNonWebApp(const std::string& platform, |
| 112 const GURL& url, | 113 const GURL& url, |
| 113 const std::string& id); | 114 const std::string& id); |
| 114 | 115 |
| 115 // The URL of the badge icon. | 116 // The URL of the badge icon. |
| 116 GURL badge_icon_url_; | 117 GURL badge_icon_url_; |
| 117 | 118 |
| 118 // The badge icon object. | 119 // The badge icon object. |
| 119 std::unique_ptr<SkBitmap> badge_icon_; | 120 SkBitmap badge_icon_; |
| 120 | 121 |
| 121 // The Java-side AppBannerManager. | 122 // The Java-side AppBannerManager. |
| 122 base::android::ScopedJavaGlobalRef<jobject> java_banner_manager_; | 123 base::android::ScopedJavaGlobalRef<jobject> java_banner_manager_; |
| 123 | 124 |
| 124 // Java-side object containing data about a native app. | 125 // Java-side object containing data about a native app. |
| 125 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; | 126 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; |
| 126 | 127 |
| 127 // App package name for a native app banner. | 128 // App package name for a native app banner. |
| 128 std::string native_app_package_; | 129 std::string native_app_package_; |
| 129 | 130 |
| 130 // Whether WebAPKs can be installed. | 131 // Whether WebAPKs can be installed. |
| 131 bool can_install_webapk_; | 132 bool can_install_webapk_; |
| 132 | 133 |
| 133 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); | 134 DISALLOW_COPY_AND_ASSIGN(AppBannerManagerAndroid); |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 } // namespace banners | 137 } // namespace banners |
| 137 | 138 |
| 138 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ | 139 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_MANAGER_ANDROID_H_ |
| OLD | NEW |