Chromium Code Reviews| 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/infobars/infobar_service.h" | |
| 8 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h" | 9 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 | 11 |
| 11 namespace banners { | 12 namespace banners { |
| 12 | 13 |
| 13 AppBannerDataFetcherAndroid::AppBannerDataFetcherAndroid( | 14 AppBannerDataFetcherAndroid::AppBannerDataFetcherAndroid( |
| 14 content::WebContents* web_contents, | 15 content::WebContents* web_contents, |
| 15 base::WeakPtr<Delegate> weak_delegate, | 16 base::WeakPtr<Delegate> weak_delegate, |
| 16 int ideal_icon_size) | 17 int ideal_icon_size) |
| 17 : AppBannerDataFetcher(web_contents, weak_delegate, ideal_icon_size) { | 18 : AppBannerDataFetcher(web_contents, weak_delegate, ideal_icon_size) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 RecordDidShowBanner("AppBanner.WebApp.Shown"); | 60 RecordDidShowBanner("AppBanner.WebApp.Shown"); |
| 60 } else { | 61 } else { |
| 61 scoped_ptr<AppBannerInfoBarDelegateAndroid> delegate( | 62 scoped_ptr<AppBannerInfoBarDelegateAndroid> delegate( |
| 62 new AppBannerInfoBarDelegateAndroid( | 63 new AppBannerInfoBarDelegateAndroid( |
| 63 event_request_id(), title, new SkBitmap(*icon), native_app_data_, | 64 event_request_id(), title, new SkBitmap(*icon), native_app_data_, |
| 64 native_app_package_)); | 65 native_app_package_)); |
| 65 infobar = new AppBannerInfoBarAndroid(delegate.Pass(), native_app_data_); | 66 infobar = new AppBannerInfoBarAndroid(delegate.Pass(), native_app_data_); |
| 66 if (infobar) | 67 if (infobar) |
| 67 RecordDidShowBanner("AppBanner.NativeApp.Shown"); | 68 RecordDidShowBanner("AppBanner.NativeApp.Shown"); |
| 68 } | 69 } |
| 70 InfoBarService::FromWebContents(web_contents) | |
| 71 ->AddInfoBar(make_scoped_ptr(infobar)); | |
| 69 | 72 |
| 70 return infobar; | 73 return infobar; |
|
benwells
2015/06/02 05:53:35
Is there any reason to return infobar now? It feel
dominickn (DO NOT USE)
2015/06/02 06:51:32
Done.
| |
| 71 } | 74 } |
| 72 | 75 |
| 73 } // namespace banners | 76 } // namespace banners |
| OLD | NEW |