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

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

Issue 2589503002: Use exact pixel sizes instead of dip in webapp/WebAPK installability code (Closed)
Patch Set: Merge branch 'master' into dp_px Created 4 years 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/guid.h" 9 #include "base/guid.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void AddToHomescreenManager::Start(content::WebContents* web_contents) { 76 void AddToHomescreenManager::Start(content::WebContents* web_contents) {
77 bool check_webapk_compatible = false; 77 bool check_webapk_compatible = false;
78 if (ChromeWebApkHost::AreWebApkEnabled() && 78 if (ChromeWebApkHost::AreWebApkEnabled() &&
79 content::IsOriginSecure(web_contents->GetLastCommittedURL())) { 79 content::IsOriginSecure(web_contents->GetLastCommittedURL())) {
80 check_webapk_compatible = true; 80 check_webapk_compatible = true;
81 } else { 81 } else {
82 ShowDialog(); 82 ShowDialog();
83 } 83 }
84 84
85 data_fetcher_ = new AddToHomescreenDataFetcher( 85 data_fetcher_ = new AddToHomescreenDataFetcher(
86 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInDp(), 86 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInPx(),
87 ShortcutHelper::GetMinimumHomescreenIconSizeInDp(), 87 ShortcutHelper::GetMinimumHomescreenIconSizeInPx(),
88 ShortcutHelper::GetIdealSplashImageSizeInDp(), 88 ShortcutHelper::GetIdealSplashImageSizeInPx(),
89 ShortcutHelper::GetMinimumSplashImageSizeInDp(), 89 ShortcutHelper::GetMinimumSplashImageSizeInPx(),
90 check_webapk_compatible, this); 90 check_webapk_compatible, this);
91 } 91 }
92 92
93 AddToHomescreenManager::~AddToHomescreenManager() { 93 AddToHomescreenManager::~AddToHomescreenManager() {
94 if (data_fetcher_) { 94 if (data_fetcher_) {
95 data_fetcher_->set_weak_observer(nullptr); 95 data_fetcher_->set_weak_observer(nullptr);
96 data_fetcher_ = nullptr; 96 data_fetcher_ = nullptr;
97 } 97 }
98 } 98 }
99 99
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground( 190 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground(
191 const SkBitmap& bitmap, 191 const SkBitmap& bitmap,
192 const GURL& url, 192 const GURL& url,
193 bool* is_generated) { 193 bool* is_generated) {
194 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 194 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
195 195
196 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, 196 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url,
197 is_generated); 197 is_generated);
198 } 198 }
OLDNEW
« no previous file with comments | « chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc ('k') | chrome/browser/banners/app_banner_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698