| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/browser/payments/payment_app_info_fetcher.h" | 5 #include "content/browser/payments/payment_app_info_fetcher.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "content/browser/frame_host/render_frame_host_impl.h" | 9 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 10 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 11 #include "content/browser/web_contents/web_contents_impl.h" | 11 #include "content/browser/web_contents/web_contents_impl.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/manifest_icon_downloader.h" | 13 #include "content/public/browser/manifest_icon_downloader.h" |
| 14 #include "content/public/browser/manifest_icon_selector.h" | 14 #include "content/public/browser/manifest_icon_selector.h" |
| 15 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // TODO(gogerald): Choose appropriate icon size dynamically on different | 21 // TODO(gogerald): Choose appropriate icon size dynamically on different |
| 22 // platforms. | 22 // platforms. |
| 23 const int kPaymentAppIdealIconSize = 64; | 23 // Here we choose a large ideal icon size to be big enough for all platforms. |
| 24 // Note that we only scale down for this icon size but not scale up. |
| 25 const int kPaymentAppIdealIconSize = 0xFFFF; |
| 24 const int kPaymentAppMinimumIconSize = 0; | 26 const int kPaymentAppMinimumIconSize = 0; |
| 25 | 27 |
| 26 } // namespace | 28 } // namespace |
| 27 | 29 |
| 28 PaymentAppInfoFetcher::PaymentAppInfoFetcher() | 30 PaymentAppInfoFetcher::PaymentAppInfoFetcher() |
| 29 : context_process_id_(-1), context_frame_id_(-1) {} | 31 : context_process_id_(-1), context_frame_id_(-1) {} |
| 30 PaymentAppInfoFetcher::~PaymentAppInfoFetcher() {} | 32 PaymentAppInfoFetcher::~PaymentAppInfoFetcher() {} |
| 31 | 33 |
| 32 void PaymentAppInfoFetcher::Start( | 34 void PaymentAppInfoFetcher::Start( |
| 33 const GURL& context_url, | 35 const GURL& context_url, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 void PaymentAppInfoFetcher::PostPaymentAppInfoFetchResultToIOThread() { | 150 void PaymentAppInfoFetcher::PostPaymentAppInfoFetchResultToIOThread() { |
| 149 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 151 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 150 | 152 |
| 151 BrowserThread::PostTask( | 153 BrowserThread::PostTask( |
| 152 BrowserThread::IO, FROM_HERE, | 154 BrowserThread::IO, FROM_HERE, |
| 153 base::BindOnce(std::move(callback_), fetched_payment_app_name_, | 155 base::BindOnce(std::move(callback_), fetched_payment_app_name_, |
| 154 fetched_payment_app_icon_)); | 156 fetched_payment_app_icon_)); |
| 155 } | 157 } |
| 156 | 158 |
| 157 } // namespace content | 159 } // namespace content |
| OLD | NEW |