| 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 #include "chrome/browser/android/banners/app_banner_data_fetcher_android.h" | 5 #include "chrome/browser/android/banners/app_banner_data_fetcher_android.h" |
| 6 | 6 |
| 7 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" | 7 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" |
| 8 #include "chrome/browser/banners/app_banner_metrics.h" | 8 #include "chrome/browser/banners/app_banner_metrics.h" |
| 9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 10 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h" | 10 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool AppBannerDataFetcherAndroid::ContinueFetching( | 30 bool AppBannerDataFetcherAndroid::ContinueFetching( |
| 31 const base::string16& app_title, | 31 const base::string16& app_title, |
| 32 const std::string& app_package, | 32 const std::string& app_package, |
| 33 base::android::ScopedJavaLocalRef<jobject> app_data, | 33 base::android::ScopedJavaLocalRef<jobject> app_data, |
| 34 const GURL& image_url) { | 34 const GURL& image_url) { |
| 35 set_app_title(app_title); | 35 set_app_title(app_title); |
| 36 native_app_package_ = app_package; | 36 native_app_package_ = app_package; |
| 37 native_app_data_.Reset(app_data); | 37 native_app_data_.Reset(app_data); |
| 38 return FetchIcon(image_url); | 38 return FetchAppIcon(GetWebContents(), image_url); |
| 39 } | 39 } |
| 40 | 40 |
| 41 std::string AppBannerDataFetcherAndroid::GetAppIdentifier() { | 41 std::string AppBannerDataFetcherAndroid::GetAppIdentifier() { |
| 42 return native_app_data_.is_null() | 42 return native_app_data_.is_null() |
| 43 ? AppBannerDataFetcher::GetAppIdentifier() : native_app_package_; | 43 ? AppBannerDataFetcher::GetAppIdentifier() : native_app_package_; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void AppBannerDataFetcherAndroid::ShowBanner(const SkBitmap* icon, | 46 void AppBannerDataFetcherAndroid::ShowBanner(const SkBitmap* icon, |
| 47 const base::string16& title) { | 47 const base::string16& title) { |
| 48 content::WebContents* web_contents = GetWebContents(); | 48 content::WebContents* web_contents = GetWebContents(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 69 if (infobar) { | 69 if (infobar) { |
| 70 RecordDidShowBanner("AppBanner.NativeApp.Shown"); | 70 RecordDidShowBanner("AppBanner.NativeApp.Shown"); |
| 71 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); | 71 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 InfoBarService::FromWebContents(web_contents) | 74 InfoBarService::FromWebContents(web_contents) |
| 75 ->AddInfoBar(make_scoped_ptr(infobar)); | 75 ->AddInfoBar(make_scoped_ptr(infobar)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace banners | 78 } // namespace banners |
| OLD | NEW |