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

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: 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 | 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/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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_)
213 return; 213 return;
214 214
215 is_installable_check_complete_ = true; 215 if (is_installable_check_complete_)
216 return;
pkotwicz 2017/02/27 23:30:38 Nit: You can remove the else In Chrome we prefer
F 2017/02/28 23:09:42 Done.
217 else
218 is_installable_check_complete_ = true;
216 219
217 bool webapk_compatible = false; 220 bool webapk_compatible = false;
218 if (check_webapk_compatibility_) { 221 if (check_webapk_compatibility_) {
219 webapk_compatible = (data.error_code == NO_ERROR_DETECTED && 222 webapk_compatible = (data.error_code == NO_ERROR_DETECTED &&
220 AreWebManifestUrlsWebApkCompatible(data.manifest)); 223 AreWebManifestUrlsWebApkCompatible(data.manifest));
221 weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible); 224 weak_observer_->OnDidDetermineWebApkCompatibility(webapk_compatible);
222 225
223 if (webapk_compatible) { 226 if (webapk_compatible) {
224 // WebAPKs are wholly defined by the Web Manifest. Ignore the <meta> tag 227 // WebAPKs are wholly defined by the Web Manifest. Ignore the <meta> tag
225 // data received in OnDidGetWebApplicationInfo(). 228 // data received in OnDidGetWebApplicationInfo().
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 void AddToHomescreenDataFetcher::NotifyObserver(const SkBitmap& primary_icon) { 347 void AddToHomescreenDataFetcher::NotifyObserver(const SkBitmap& primary_icon) {
345 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 348 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
346 if (!web_contents() || !weak_observer_ || is_icon_saved_) 349 if (!web_contents() || !weak_observer_ || is_icon_saved_)
347 return; 350 return;
348 351
349 is_icon_saved_ = true; 352 is_icon_saved_ = true;
350 primary_icon_ = primary_icon; 353 primary_icon_ = primary_icon;
351 is_ready_ = true; 354 is_ready_ = true;
352 weak_observer_->OnDataAvailable(shortcut_info_, primary_icon_, badge_icon_); 355 weak_observer_->OnDataAvailable(shortcut_info_, primary_icon_, badge_icon_);
353 } 356 }
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