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

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

Issue 2695473002: 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
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 Stop(); 189 Stop();
190 } 190 }
191 191
192 if (!is_active()) 192 if (!is_active())
193 return; 193 return;
194 194
195 icon_.reset(new SkBitmap(bitmap)); 195 icon_.reset(new SkBitmap(bitmap));
196 SendBannerPromptRequest(); 196 SendBannerPromptRequest();
197 } 197 }
198 198
199 void AppBannerManagerAndroid::ResetCurrentPageData() {
200 AppBannerManager::ResetCurrentPageData();
201 native_app_data_.Reset();
202 native_app_package_ = "";
203 }
204
199 void AppBannerManagerAndroid::ShowBanner() { 205 void AppBannerManagerAndroid::ShowBanner() {
200 content::WebContents* contents = web_contents(); 206 content::WebContents* contents = web_contents();
201 DCHECK(contents); 207 DCHECK(contents);
202 208
203 if (native_app_data_.is_null()) { 209 if (native_app_data_.is_null()) {
204 if (AppBannerInfoBarDelegateAndroid::Create( 210 if (AppBannerInfoBarDelegateAndroid::Create(
205 contents, GetWeakPtr(), app_title_, 211 contents, GetWeakPtr(), app_title_,
206 CreateShortcutInfo(manifest_url_, manifest_, icon_url_), 212 CreateShortcutInfo(manifest_url_, manifest_, icon_url_),
207 std::move(icon_), event_request_id(), 213 std::move(icon_), event_request_id(),
208 webapk::INSTALL_SOURCE_BANNER)) { 214 webapk::INSTALL_SOURCE_BANNER)) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 334 }
329 335
330 // static 336 // static
331 void SetTotalEngagementToTrigger(JNIEnv* env, 337 void SetTotalEngagementToTrigger(JNIEnv* env,
332 const JavaParamRef<jclass>& clazz, 338 const JavaParamRef<jclass>& clazz,
333 jdouble engagement) { 339 jdouble engagement) {
334 AppBannerSettingsHelper::SetTotalEngagementToTrigger(engagement); 340 AppBannerSettingsHelper::SetTotalEngagementToTrigger(engagement);
335 } 341 }
336 342
337 } // namespace banners 343 } // namespace banners
OLDNEW
« no previous file with comments | « chrome/browser/android/banners/app_banner_manager_android.h ('k') | chrome/browser/banners/app_banner_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698