| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" | 9 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" |
| 10 #include "chrome/browser/android/shortcut_helper.h" | 10 #include "chrome/browser/android/shortcut_helper.h" |
| 11 #include "chrome/browser/banners/app_banner_metrics.h" | 11 #include "chrome/browser/banners/app_banner_metrics.h" |
| 12 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
| 13 #include "chrome/browser/manifest/manifest_icon_selector.h" | 13 #include "chrome/browser/manifest/manifest_icon_selector.h" |
| 14 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h" | 14 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h" |
| 15 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
| 16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
| 17 | 17 |
| 18 namespace banners { | 18 namespace banners { |
| 19 | 19 |
| 20 AppBannerDataFetcherAndroid::AppBannerDataFetcherAndroid( | 20 AppBannerDataFetcherAndroid::AppBannerDataFetcherAndroid( |
| 21 content::WebContents* web_contents, | 21 content::WebContents* web_contents, |
| 22 base::WeakPtr<Delegate> weak_delegate, | 22 base::WeakPtr<Delegate> weak_delegate, |
| 23 int ideal_icon_size_in_dp, | 23 int ideal_icon_size_in_dp, |
| 24 int minimum_icon_size_in_dp, | 24 int minimum_icon_size_in_dp, |
| 25 int ideal_splash_image_size_in_dp, | 25 int ideal_splash_image_size_in_dp, |
| 26 int minimum_splash_image_size_in_dp) | 26 int minimum_splash_image_size_in_dp, |
| 27 bool is_debug_mode) |
| 27 : AppBannerDataFetcher(web_contents, | 28 : AppBannerDataFetcher(web_contents, |
| 28 weak_delegate, | 29 weak_delegate, |
| 29 ideal_icon_size_in_dp, | 30 ideal_icon_size_in_dp, |
| 30 minimum_icon_size_in_dp), | 31 minimum_icon_size_in_dp, |
| 32 is_debug_mode), |
| 31 ideal_splash_image_size_in_dp_(ideal_splash_image_size_in_dp), | 33 ideal_splash_image_size_in_dp_(ideal_splash_image_size_in_dp), |
| 32 minimum_splash_image_size_in_dp_(minimum_splash_image_size_in_dp) { | 34 minimum_splash_image_size_in_dp_(minimum_splash_image_size_in_dp) {} |
| 33 } | |
| 34 | 35 |
| 35 AppBannerDataFetcherAndroid::~AppBannerDataFetcherAndroid() { | 36 AppBannerDataFetcherAndroid::~AppBannerDataFetcherAndroid() { |
| 36 } | 37 } |
| 37 | 38 |
| 38 std::string AppBannerDataFetcherAndroid::GetBannerType() { | 39 std::string AppBannerDataFetcherAndroid::GetBannerType() { |
| 39 return native_app_data_.is_null() | 40 return native_app_data_.is_null() |
| 40 ? AppBannerDataFetcher::GetBannerType() : "android"; | 41 ? AppBannerDataFetcher::GetBannerType() : "android"; |
| 41 } | 42 } |
| 42 | 43 |
| 43 bool AppBannerDataFetcherAndroid::ContinueFetching( | 44 bool AppBannerDataFetcherAndroid::ContinueFetching( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 if (infobar) { | 105 if (infobar) { |
| 105 RecordDidShowBanner("AppBanner.NativeApp.Shown"); | 106 RecordDidShowBanner("AppBanner.NativeApp.Shown"); |
| 106 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); | 107 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); |
| 107 } | 108 } |
| 108 } | 109 } |
| 109 InfoBarService::FromWebContents(web_contents) | 110 InfoBarService::FromWebContents(web_contents) |
| 110 ->AddInfoBar(make_scoped_ptr(infobar)); | 111 ->AddInfoBar(make_scoped_ptr(infobar)); |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace banners | 114 } // namespace banners |
| OLD | NEW |