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_DATA_FETCHER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_ |
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_ |
7 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/android/shortcut_info.h" |
11 #include "chrome/browser/banners/app_banner_data_fetcher.h" | 12 #include "chrome/browser/banners/app_banner_data_fetcher.h" |
12 | 13 |
13 namespace banners { | 14 namespace banners { |
14 | 15 |
15 // Fetches data required to show a banner for the URL currently shown by the | 16 // Fetches data required to show a banner for the URL currently shown by the |
16 // WebContents. Extends the regular fetch to add support for Android apps. | 17 // WebContents. Extends the regular fetch to add support for Android apps. |
17 class AppBannerDataFetcherAndroid : public AppBannerDataFetcher { | 18 class AppBannerDataFetcherAndroid : public AppBannerDataFetcher { |
18 public: | 19 public: |
19 AppBannerDataFetcherAndroid(content::WebContents* web_contents, | 20 AppBannerDataFetcherAndroid(content::WebContents* web_contents, |
20 base::WeakPtr<Delegate> weak_delegate, | 21 base::WeakPtr<Delegate> weak_delegate, |
(...skipping 12 matching lines...) Expand all Loading... |
33 | 34 |
34 // Returns a callback which fetches the splash screen image and stores it in | 35 // Returns a callback which fetches the splash screen image and stores it in |
35 // WebappDataStorage. | 36 // WebappDataStorage. |
36 base::Closure FetchWebappSplashScreenImageCallback( | 37 base::Closure FetchWebappSplashScreenImageCallback( |
37 const std::string& webapp_id); | 38 const std::string& webapp_id); |
38 | 39 |
39 protected: | 40 protected: |
40 ~AppBannerDataFetcherAndroid() override; | 41 ~AppBannerDataFetcherAndroid() override; |
41 | 42 |
42 std::string GetBannerType() override; | 43 std::string GetBannerType() override; |
| 44 bool CheckManifest(const content::Manifest& manifest, |
| 45 OutputDeveloperMessageCode* code) override; |
43 std::string GetAppIdentifier() override; | 46 std::string GetAppIdentifier() override; |
44 | 47 |
45 private: | 48 private: |
46 void ShowBanner(const SkBitmap* icon, | 49 void ShowBanner(const SkBitmap* icon, |
47 const base::string16& title, | 50 const base::string16& title, |
48 const std::string& referrer) override; | 51 const std::string& referrer) override; |
49 | 52 |
50 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; | 53 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; |
51 std::string native_app_package_; | 54 std::string native_app_package_; |
| 55 ShortcutInfo::Type webapp_type_; |
52 | 56 |
53 int ideal_splash_image_size_in_dp_; | 57 int ideal_splash_image_size_in_dp_; |
54 int minimum_splash_image_size_in_dp_; | 58 int minimum_splash_image_size_in_dp_; |
55 | 59 |
56 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcherAndroid); | 60 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcherAndroid); |
57 }; | 61 }; |
58 | 62 |
59 } // namespace banners | 63 } // namespace banners |
60 | 64 |
61 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_ | 65 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_ |
OLD | NEW |