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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc

Issue 2720083002: Make OnDataTimedout and OnDidPerformInstallableCheck mutually exclusive. (Closed)
Patch Set: Correcting mistakes Created 3 years, 9 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 | chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc » ('j') | 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/webapps/add_to_homescreen_data_fetcher.h" 5 #include "chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 if (!is_icon_saved_) { 202 if (!is_icon_saved_) {
203 badge_icon_.reset(); 203 badge_icon_.reset();
204 CreateLauncherIcon(SkBitmap()); 204 CreateLauncherIcon(SkBitmap());
205 } 205 }
206 } 206 }
207 207
208 void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck( 208 void AddToHomescreenDataFetcher::OnDidPerformInstallableCheck(
209 const InstallableData& data) { 209 const InstallableData& data) {
210 badge_icon_.reset(); 210 badge_icon_.reset();
211 211
212 if (!web_contents() || !weak_observer_) 212 if (!web_contents() || !weak_observer_ || is_installable_check_complete_)
213 return; 213 return;
214 214
215 is_installable_check_complete_ = true; 215 is_installable_check_complete_ = true;
216 216
217 bool webapk_compatible = false; 217 bool webapk_compatible = false;
218 if (check_webapk_compatibility_) { 218 if (check_webapk_compatibility_) {
219 webapk_compatible = (data.error_code == NO_ERROR_DETECTED && 219 webapk_compatible = (data.error_code == NO_ERROR_DETECTED &&
220 AreWebManifestUrlsWebApkCompatible(data.manifest)); 220 AreWebManifestUrlsWebApkCompatible(data.manifest));
221 weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible); 221 weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible);
222 222
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 void AddToHomescreenDataFetcher::NotifyObserver(const SkBitmap& primary_icon) { 344 void AddToHomescreenDataFetcher::NotifyObserver(const SkBitmap& primary_icon) {
345 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 345 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
346 if (!web_contents() || !weak_observer_ || is_icon_saved_) 346 if (!web_contents() || !weak_observer_ || is_icon_saved_)
347 return; 347 return;
348 348
349 is_icon_saved_ = true; 349 is_icon_saved_ = true;
350 primary_icon_ = primary_icon; 350 primary_icon_ = primary_icon;
351 is_ready_ = true; 351 is_ready_ = true;
352 weak_observer_->OnDataAvailable(shortcut_info_, primary_icon_, badge_icon_); 352 weak_observer_->OnDataAvailable(shortcut_info_, primary_icon_, badge_icon_);
353 } 353 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/webapps/add_to_homescreen_data_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698