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" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return native_app_data_.is_null() | 56 return native_app_data_.is_null() |
57 ? AppBannerDataFetcher::GetAppIdentifier() : native_app_package_; | 57 ? AppBannerDataFetcher::GetAppIdentifier() : native_app_package_; |
58 } | 58 } |
59 | 59 |
60 void AppBannerDataFetcherAndroid::FetchWebappSplashScreenImage( | 60 void AppBannerDataFetcherAndroid::FetchWebappSplashScreenImage( |
61 const std::string& webapp_id) { | 61 const std::string& webapp_id) { |
62 content::WebContents* web_contents = GetWebContents(); | 62 content::WebContents* web_contents = GetWebContents(); |
63 DCHECK(web_contents); | 63 DCHECK(web_contents); |
64 | 64 |
65 GURL image_url = ManifestIconSelector::FindBestMatchingIcon( | 65 GURL image_url = ManifestIconSelector::FindBestMatchingIcon( |
66 web_app_data().icons, | 66 web_app_data().icons, ideal_splash_image_size_in_dp_, |
67 ideal_splash_image_size_in_dp_, | 67 minimum_splash_image_size_in_dp_); |
68 minimum_splash_image_size_in_dp_, | |
69 gfx::Screen::GetScreenFor(web_contents->GetNativeView())); | |
70 | 68 |
71 ShortcutHelper::FetchSplashScreenImage( | 69 ShortcutHelper::FetchSplashScreenImage( |
72 web_contents, | 70 web_contents, |
73 image_url, | 71 image_url, |
74 ideal_splash_image_size_in_dp_, | 72 ideal_splash_image_size_in_dp_, |
75 minimum_splash_image_size_in_dp_, | 73 minimum_splash_image_size_in_dp_, |
76 webapp_id); | 74 webapp_id); |
77 } | 75 } |
78 | 76 |
79 void AppBannerDataFetcherAndroid::ShowBanner(const SkBitmap* icon, | 77 void AppBannerDataFetcherAndroid::ShowBanner(const SkBitmap* icon, |
(...skipping 25 matching lines...) Expand all Loading... |
105 if (infobar) { | 103 if (infobar) { |
106 RecordDidShowBanner("AppBanner.NativeApp.Shown"); | 104 RecordDidShowBanner("AppBanner.NativeApp.Shown"); |
107 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); | 105 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); |
108 } | 106 } |
109 } | 107 } |
110 InfoBarService::FromWebContents(web_contents) | 108 InfoBarService::FromWebContents(web_contents) |
111 ->AddInfoBar(make_scoped_ptr(infobar)); | 109 ->AddInfoBar(make_scoped_ptr(infobar)); |
112 } | 110 } |
113 | 111 |
114 } // namespace banners | 112 } // namespace banners |
OLD | NEW |