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

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

Issue 2611623003: Use exact pixel sizes instead of dip in webapp/WebAPK installability code (Closed)
Patch Set: Rebased version of pkotwicz@'s original patch Created 3 years, 11 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 return; 105 return;
106 is_initial_fetch_ = last_fetched_url_.is_empty(); 106 is_initial_fetch_ = last_fetched_url_.is_empty();
107 last_fetched_url_ = url; 107 last_fetched_url_ = url;
108 108
109 if (!IsInScope(url, scope_)) { 109 if (!IsInScope(url, scope_)) {
110 OnWebManifestNotWebApkCompatible(); 110 OnWebManifestNotWebApkCompatible();
111 return; 111 return;
112 } 112 }
113 113
114 InstallableParams params; 114 InstallableParams params;
115 params.ideal_icon_size_in_dp = 115 params.ideal_icon_size_in_px =
116 ShortcutHelper::GetIdealHomescreenIconSizeInDp(); 116 ShortcutHelper::GetIdealHomescreenIconSizeInPx();
117 params.minimum_icon_size_in_dp = 117 params.minimum_icon_size_in_px =
118 ShortcutHelper::GetMinimumHomescreenIconSizeInDp(); 118 ShortcutHelper::GetMinimumHomescreenIconSizeInPx();
119 params.check_installable = true; 119 params.check_installable = true;
120 params.fetch_valid_icon = true; 120 params.fetch_valid_icon = true;
121 InstallableManager::CreateForWebContents(web_contents()); 121 InstallableManager::CreateForWebContents(web_contents());
122 InstallableManager* installable_manager = 122 InstallableManager* installable_manager =
123 InstallableManager::FromWebContents(web_contents()); 123 InstallableManager::FromWebContents(web_contents());
124 installable_manager->GetData( 124 installable_manager->GetData(
125 params, 125 params,
126 base::Bind(&WebApkUpdateDataFetcher::OnDidGetInstallableData, 126 base::Bind(&WebApkUpdateDataFetcher::OnDidGetInstallableData,
127 weak_ptr_factory_.GetWeakPtr())); 127 weak_ptr_factory_.GetWeakPtr()));
128 } 128 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 info.background_color); 208 info.background_color);
209 } 209 }
210 210
211 void WebApkUpdateDataFetcher::OnWebManifestNotWebApkCompatible() { 211 void WebApkUpdateDataFetcher::OnWebManifestNotWebApkCompatible() {
212 if (!is_initial_fetch_) 212 if (!is_initial_fetch_)
213 return; 213 return;
214 214
215 Java_WebApkUpdateDataFetcher_onWebManifestForInitialUrlNotWebApkCompatible( 215 Java_WebApkUpdateDataFetcher_onWebManifestForInitialUrlNotWebApkCompatible(
216 base::android::AttachCurrentThread(), java_ref_); 216 base::android::AttachCurrentThread(), java_ref_);
217 } 217 }
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_helper.cc ('k') | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698