Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: chrome/browser/android/banners/app_banner_manager_android.cc

Issue 2671653002: Webapps: Clear AppBannerManagerAndroid::native_app_data_ prior to native app check (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_manager_android.h" 5 #include "chrome/browser/android/banners/app_banner_manager_android.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Does not check whether a non-WebAPK web app is installed: this is detected 151 // Does not check whether a non-WebAPK web app is installed: this is detected
152 // by the content settings check in AppBannerSettingsHelper::ShouldShowBanner 152 // by the content settings check in AppBannerSettingsHelper::ShouldShowBanner
153 // (due to the lack of an API to detect what is and isn't on the Android 153 // (due to the lack of an API to detect what is and isn't on the Android
154 // homescreen). This method will still detect the presence of a WebAPK even if 154 // homescreen). This method will still detect the presence of a WebAPK even if
155 // Chrome's data is cleared. 155 // Chrome's data is cleared.
156 return ShortcutHelper::IsWebApkInstalled(browser_context, start_url, 156 return ShortcutHelper::IsWebApkInstalled(browser_context, start_url,
157 manifest_url); 157 manifest_url);
158 } 158 }
159 159
160 void AppBannerManagerAndroid::PerformInstallableCheck() { 160 void AppBannerManagerAndroid::PerformInstallableCheck() {
161 native_app_data_.Reset();
dominickn 2017/02/02 06:53:38 We should implement this correctly first up rather
162 native_app_package_ = "";
163
161 // Check if the manifest prefers that we show a native app banner. If so, call 164 // Check if the manifest prefers that we show a native app banner. If so, call
162 // to Java to verify the details. 165 // to Java to verify the details.
163 if (manifest_.prefer_related_applications && 166 if (manifest_.prefer_related_applications &&
164 manifest_.related_applications.size()) { 167 manifest_.related_applications.size()) {
165 for (const auto& application : manifest_.related_applications) { 168 for (const auto& application : manifest_.related_applications) {
166 std::string platform = base::UTF16ToUTF8(application.platform.string()); 169 std::string platform = base::UTF16ToUTF8(application.platform.string());
167 std::string id = base::UTF16ToUTF8(application.id.string()); 170 std::string id = base::UTF16ToUTF8(application.id.string());
168 if (CanHandleNonWebApp(platform, application.url, id)) 171 if (CanHandleNonWebApp(platform, application.url, id))
169 return; 172 return;
170 } 173 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 331 }
329 332
330 // static 333 // static
331 void SetTotalEngagementToTrigger(JNIEnv* env, 334 void SetTotalEngagementToTrigger(JNIEnv* env,
332 const JavaParamRef<jclass>& clazz, 335 const JavaParamRef<jclass>& clazz,
333 jdouble engagement) { 336 jdouble engagement) {
334 AppBannerSettingsHelper::SetTotalEngagementToTrigger(engagement); 337 AppBannerSettingsHelper::SetTotalEngagementToTrigger(engagement);
335 } 338 }
336 339
337 } // namespace banners 340 } // namespace banners
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698