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

Side by Side Diff: chrome/browser/android/webapk/webapk_update_data_fetcher.cc

Issue 2773353002: Make minimum PWA icon size the same accross all device densities
Patch Set: Merge branch 'master' into min_size Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/webapk/webapk_update_data_fetcher.h" 5 #include "chrome/browser/android/webapk/webapk_update_data_fetcher.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 last_fetched_url_ = url; 105 last_fetched_url_ = url;
106 106
107 if (!IsInScope(url, scope_)) { 107 if (!IsInScope(url, scope_)) {
108 OnWebManifestNotWebApkCompatible(); 108 OnWebManifestNotWebApkCompatible();
109 return; 109 return;
110 } 110 }
111 111
112 InstallableParams params; 112 InstallableParams params;
113 params.ideal_primary_icon_size_in_px = 113 params.ideal_primary_icon_size_in_px =
114 ShortcutHelper::GetIdealHomescreenIconSizeInPx(); 114 ShortcutHelper::GetIdealHomescreenIconSizeInPx();
115 params.minimum_primary_icon_size_in_px =
116 ShortcutHelper::GetMinimumHomescreenIconSizeInPx();
117 params.check_installable = true; 115 params.check_installable = true;
118 params.fetch_valid_primary_icon = true; 116 params.fetch_valid_primary_icon = true;
119 InstallableManager::CreateForWebContents(web_contents()); 117 InstallableManager::CreateForWebContents(web_contents());
120 InstallableManager* installable_manager = 118 InstallableManager* installable_manager =
121 InstallableManager::FromWebContents(web_contents()); 119 InstallableManager::FromWebContents(web_contents());
122 installable_manager->GetData( 120 installable_manager->GetData(
123 params, base::Bind(&WebApkUpdateDataFetcher::OnDidGetInstallableData, 121 params, base::Bind(&WebApkUpdateDataFetcher::OnDidGetInstallableData,
124 weak_ptr_factory_.GetWeakPtr())); 122 weak_ptr_factory_.GetWeakPtr()));
125 } 123 }
126 124
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 info.theme_color, info.background_color); 205 info.theme_color, info.background_color);
208 } 206 }
209 207
210 void WebApkUpdateDataFetcher::OnWebManifestNotWebApkCompatible() { 208 void WebApkUpdateDataFetcher::OnWebManifestNotWebApkCompatible() {
211 if (!is_initial_fetch_) 209 if (!is_initial_fetch_)
212 return; 210 return;
213 211
214 Java_WebApkUpdateDataFetcher_onWebManifestForInitialUrlNotWebApkCompatible( 212 Java_WebApkUpdateDataFetcher_onWebManifestForInitialUrlNotWebApkCompatible(
215 base::android::AttachCurrentThread(), java_ref_); 213 base::android::AttachCurrentThread(), java_ref_);
216 } 214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698