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

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: 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void AddToHomescreenManager::Start(content::WebContents* web_contents) { 72 void AddToHomescreenManager::Start(content::WebContents* web_contents) {
73 bool check_webapk_compatible = false; 73 bool check_webapk_compatible = false;
74 if (ChromeWebApkHost::AreWebApkEnabled() && 74 if (ChromeWebApkHost::AreWebApkEnabled() &&
75 content::IsOriginSecure(web_contents->GetLastCommittedURL())) { 75 content::IsOriginSecure(web_contents->GetLastCommittedURL())) {
76 check_webapk_compatible = true; 76 check_webapk_compatible = true;
77 } else { 77 } else {
78 ShowDialog(); 78 ShowDialog();
79 } 79 }
80 80
81 data_fetcher_ = new AddToHomescreenDataFetcher( 81 data_fetcher_ = new AddToHomescreenDataFetcher(
82 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInDp(), 82 web_contents, ShortcutHelper::GetIdealHomescreenIconSizeInPx(),
83 ShortcutHelper::GetMinimumHomescreenIconSizeInDp(), 83 ShortcutHelper::GetMinimumHomescreenIconSizeInPx(),
84 ShortcutHelper::GetIdealSplashImageSizeInDp(), 84 ShortcutHelper::GetIdealSplashImageSizeInPx(),
85 ShortcutHelper::GetMinimumSplashImageSizeInDp(), 85 ShortcutHelper::GetMinimumSplashImageSizeInPx(),
86 check_webapk_compatible, this); 86 check_webapk_compatible, this);
87 } 87 }
88 88
89 AddToHomescreenManager::~AddToHomescreenManager() { 89 AddToHomescreenManager::~AddToHomescreenManager() {
90 if (data_fetcher_) { 90 if (data_fetcher_) {
91 data_fetcher_->set_weak_observer(nullptr); 91 data_fetcher_->set_weak_observer(nullptr);
92 data_fetcher_ = nullptr; 92 data_fetcher_ = nullptr;
93 } 93 }
94 } 94 }
95 95
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground( 179 SkBitmap AddToHomescreenManager::FinalizeLauncherIconInBackground(
180 const SkBitmap& bitmap, 180 const SkBitmap& bitmap,
181 const GURL& url, 181 const GURL& url,
182 bool* is_generated) { 182 bool* is_generated) {
183 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 183 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
184 184
185 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url, 185 return ShortcutHelper::FinalizeLauncherIconInBackground(bitmap, url,
186 is_generated); 186 is_generated);
187 } 187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698