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 "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 | 66 |
67 GURL image_url = ManifestIconSelector::FindBestMatchingIcon( | 67 GURL image_url = ManifestIconSelector::FindBestMatchingIcon( |
68 manifest().icons, ideal_splash_image_size_in_dp_, | 68 manifest().icons, ideal_splash_image_size_in_dp_, |
69 minimum_splash_image_size_in_dp_); | 69 minimum_splash_image_size_in_dp_); |
70 | 70 |
71 return base::Bind(&ShortcutHelper::FetchSplashScreenImage, | 71 return base::Bind(&ShortcutHelper::FetchSplashScreenImage, |
72 web_contents, image_url, ideal_splash_image_size_in_dp_, | 72 web_contents, image_url, ideal_splash_image_size_in_dp_, |
73 minimum_splash_image_size_in_dp_, webapp_id); | 73 minimum_splash_image_size_in_dp_, webapp_id); |
74 } | 74 } |
75 | 75 |
76 bool AppBannerDataFetcherAndroid::IsWebAppInstalled( | |
77 content::BrowserContext* browser_context, | |
78 const GURL& start_url) { | |
dominickn
2016/07/07 00:50:58
You should explicitly document here that this meth
pkotwicz
2016/07/07 18:12:44
I have added some comments. Let me know if my comm
| |
79 return ShortcutHelper::IsWebApkInstalled(start_url); | |
80 } | |
81 | |
76 void AppBannerDataFetcherAndroid::ShowBanner(const GURL& icon_url, | 82 void AppBannerDataFetcherAndroid::ShowBanner(const GURL& icon_url, |
77 const SkBitmap* icon, | 83 const SkBitmap* icon, |
78 const base::string16& title, | 84 const base::string16& title, |
79 const std::string& referrer) { | 85 const std::string& referrer) { |
80 content::WebContents* web_contents = GetWebContents(); | 86 content::WebContents* web_contents = GetWebContents(); |
81 DCHECK(web_contents); | 87 DCHECK(web_contents); |
82 | 88 |
83 infobars::InfoBar* infobar = nullptr; | 89 infobars::InfoBar* infobar = nullptr; |
84 if (native_app_data_.is_null()) { | 90 if (native_app_data_.is_null()) { |
85 std::unique_ptr<AppBannerInfoBarDelegateAndroid> delegate( | 91 std::unique_ptr<AppBannerInfoBarDelegateAndroid> delegate( |
(...skipping 17 matching lines...) Expand all Loading... | |
103 if (infobar) { | 109 if (infobar) { |
104 RecordDidShowBanner("AppBanner.NativeApp.Shown"); | 110 RecordDidShowBanner("AppBanner.NativeApp.Shown"); |
105 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); | 111 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); |
106 } | 112 } |
107 } | 113 } |
108 InfoBarService::FromWebContents(web_contents) | 114 InfoBarService::FromWebContents(web_contents) |
109 ->AddInfoBar(base::WrapUnique(infobar)); | 115 ->AddInfoBar(base::WrapUnique(infobar)); |
110 } | 116 } |
111 | 117 |
112 } // namespace banners | 118 } // namespace banners |
OLD | NEW |