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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_manager.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 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_manager.h" 5 #include "chrome/browser/android/webapps/add_to_homescreen_manager.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bool check_webapk_compatible = false; 78 bool check_webapk_compatible = false;
79 if (ChromeWebApkHost::CanInstallWebApk() && 79 if (ChromeWebApkHost::CanInstallWebApk() &&
80 InstallableManager::IsContentSecure(web_contents)) { 80 InstallableManager::IsContentSecure(web_contents)) {
81 check_webapk_compatible = true; 81 check_webapk_compatible = true;
82 } else { 82 } else {
83 ShowDialog(); 83 ShowDialog();
84 } 84 }
85 85
86 data_fetcher_ = new AddToHomescreenDataFetcher( 86 data_fetcher_ = new AddToHomescreenDataFetcher(
87 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInPx(), 87 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInPx(),
88 ShortcutHelper::GetMinimumHomescreenIconSizeInPx(),
89 ShortcutHelper::GetIdealSplashImageSizeInPx(), 88 ShortcutHelper::GetIdealSplashImageSizeInPx(),
90 ShortcutHelper::GetMinimumSplashImageSizeInPx(),
91 ShortcutHelper::GetIdealBadgeIconSizeInPx(), 89 ShortcutHelper::GetIdealBadgeIconSizeInPx(),
92 check_webapk_compatible, this); 90 check_webapk_compatible, this);
93 } 91 }
94 92
95 AddToHomescreenManager::~AddToHomescreenManager() { 93 AddToHomescreenManager::~AddToHomescreenManager() {
96 if (data_fetcher_) { 94 if (data_fetcher_) {
97 data_fetcher_->set_weak_observer(nullptr); 95 data_fetcher_->set_weak_observer(nullptr);
98 data_fetcher_ = nullptr; 96 data_fetcher_ = nullptr;
99 } 97 }
100 } 98 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 196
199 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground( 197 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground(
200 const SkBitmap& bitmap, 198 const SkBitmap& bitmap,
201 const GURL& url, 199 const GURL& url,
202 bool* is_generated) { 200 bool* is_generated) {
203 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 201 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
204 202
205 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, 203 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url,
206 is_generated); 204 is_generated);
207 } 205 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698