Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: chrome/browser/android/banners/app_banner_data_fetcher_android.h

Issue 1310223002: webapps: initial addition of splash screen icon downloading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapps-database-exp
Patch Set: Add call to webapp storage Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/banners/app_banner_data_fetcher.h" 9 #include "chrome/browser/banners/app_banner_data_fetcher.h"
10 10
11 namespace banners { 11 namespace banners {
12 12
13 // Fetches data required to show a banner for the URL currently shown by the 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. 14 // WebContents. Extends the regular fetch to add support for Android apps.
15 class AppBannerDataFetcherAndroid : public AppBannerDataFetcher { 15 class AppBannerDataFetcherAndroid : public AppBannerDataFetcher {
16 public: 16 public:
17 AppBannerDataFetcherAndroid( 17 AppBannerDataFetcherAndroid(
18 content::WebContents* web_contents, 18 content::WebContents* web_contents,
19 base::WeakPtr<Delegate> weak_delegate, 19 base::WeakPtr<Delegate> weak_delegate,
20 int ideal_splash_icon_size,
20 int ideal_icon_size); 21 int ideal_icon_size);
21 22
22 // Saves information about the Android app being promoted by the current page, 23 // Saves information about the Android app being promoted by the current page,
23 // then continues the creation pipeline. 24 // then continues the creation pipeline.
24 bool ContinueFetching(const base::string16& app_title, 25 bool ContinueFetching(const base::string16& app_title,
25 const std::string& app_package, 26 const std::string& app_package,
26 base::android::ScopedJavaLocalRef<jobject> app_data, 27 base::android::ScopedJavaLocalRef<jobject> app_data,
27 const GURL& image_url); 28 const GURL& image_url);
28 29
29 protected: 30 protected:
30 ~AppBannerDataFetcherAndroid() override; 31 ~AppBannerDataFetcherAndroid() override;
31 32
32 std::string GetBannerType() override; 33 std::string GetBannerType() override;
33 std::string GetAppIdentifier() override; 34 std::string GetAppIdentifier() override;
34 35
36 void OnHasServiceWorker(content::WebContents* web_contents) override;
37
35 private: 38 private:
39 void OnSplashIconFetched(const SkBitmap& bitmap);
40
36 void ShowBanner(const SkBitmap* icon, 41 void ShowBanner(const SkBitmap* icon,
37 const base::string16& title, 42 const base::string16& title,
38 const std::string& referrer) override; 43 const std::string& referrer) override;
39 44
40 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; 45 base::android::ScopedJavaGlobalRef<jobject> native_app_data_;
41 std::string native_app_package_; 46 std::string native_app_package_;
42 47
48 int ideal_splash_icon_size_;
49 scoped_ptr<SkBitmap> splash_icon_;
50
43 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcherAndroid); 51 DISALLOW_COPY_AND_ASSIGN(AppBannerDataFetcherAndroid);
44 }; 52 };
45 53
46 } // namespace banners 54 } // namespace banners
47 55
48 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_ 56 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_DATA_FETCHER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698