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

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

Issue 1958523002: Make WebAPK naming consistent 1/2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/webapps/add_to_homescreen_data_fetcher.h" 5 #include "chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return false; 156 return false;
157 if (!IsManifestValidForWebApp(web_contents, manifest)) 157 if (!IsManifestValidForWebApp(web_contents, manifest))
158 return false; 158 return false;
159 return true; 159 return true;
160 } 160 }
161 161
162 void AddToHomescreenDataFetcher::OnDidCheckHasServiceWorker( 162 void AddToHomescreenDataFetcher::OnDidCheckHasServiceWorker(
163 const std::vector<content::Manifest::Icon>& icons, 163 const std::vector<content::Manifest::Icon>& icons,
164 bool has_service_worker) { 164 bool has_service_worker) {
165 if (has_service_worker) 165 if (has_service_worker)
166 shortcut_info_.is_web_apk = true; 166 shortcut_info_.is_webapk = true;
167 DownloadIcons(icons); 167 DownloadIcons(icons);
168 } 168 }
169 169
170 void AddToHomescreenDataFetcher::DownloadIcons( 170 void AddToHomescreenDataFetcher::DownloadIcons(
171 const std::vector<content::Manifest::Icon>& icons) { 171 const std::vector<content::Manifest::Icon>& icons) {
172 GURL icon_src = ManifestIconSelector::FindBestMatchingIcon( 172 GURL icon_src = ManifestIconSelector::FindBestMatchingIcon(
173 icons, ideal_icon_size_in_dp_, minimum_icon_size_in_dp_); 173 icons, ideal_icon_size_in_dp_, minimum_icon_size_in_dp_);
174 174
175 // If fetching the Manifest icon fails, fallback to the best favicon 175 // If fetching the Manifest icon fails, fallback to the best favicon
176 // for the page. 176 // for the page.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl(actual_url); 325 dom_distiller::url_utils::GetOriginalUrlFromDistillerUrl(actual_url);
326 326
327 // If URL points to an offline content, get original URL. 327 // If URL points to an offline content, get original URL.
328 GURL online_url = offline_pages::OfflinePageUtils::GetOnlineURLForOfflineURL( 328 GURL online_url = offline_pages::OfflinePageUtils::GetOnlineURLForOfflineURL(
329 web_contents()->GetBrowserContext(), original_url); 329 web_contents()->GetBrowserContext(), original_url);
330 if (online_url.is_valid()) 330 if (online_url.is_valid())
331 return online_url; 331 return online_url;
332 332
333 return original_url; 333 return original_url;
334 } 334 }
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_info.cc ('k') | chrome/browser/notifications/notification_platform_bridge_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698