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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_
8 #include "base/android/jni_android.h"
9 #include "chrome/browser/banners/app_banner_data_fetcher.h"
13 // Fetches data required to show a banner for the URL currently shown by the
14 // WebContents. Extends the regular fetch to add support for Android apps.
15 class AppBannerDataFetcherAndroid
: public AppBannerDataFetcher
{
17 AppBannerDataFetcherAndroid(
18 content::WebContents
* web_contents
,
19 base::WeakPtr
<Delegate
> weak_delegate
,
22 // Saves information about the Android app being promoted by the current page,
23 // then continues the creation pipeline.
24 bool ContinueFetching(const base::string16
& app_title
,
25 const std::string
& app_package
,
26 base::android::ScopedJavaLocalRef
<jobject
> app_data
,
27 const GURL
& image_url
);
30 ~AppBannerDataFetcherAndroid() override
;
32 std::string
GetBannerType() override
;
33 std::string
GetAppIdentifier() override
;
36 void ShowBanner(const SkBitmap
* icon
,
37 const base::string16
& title
) override
;
39 base::android::ScopedJavaGlobalRef
<jobject
> native_app_data_
;
40 std::string native_app_package_
;
42 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcherAndroid
);
45 } // namespace banners
47 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_