Jinho Bang | 22de3a9 | 2018-02-27 18:16:22 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/payments/payment_handler_permission_context.h" |
| 6 | |
Jinho Bang | bad9b929 | 2018-03-06 00:04:57 | [diff] [blame] | 7 | #include "base/logging.h" |
Jinho Bang | 22de3a9 | 2018-02-27 18:16:22 | [diff] [blame] | 8 | #include "components/content_settings/core/common/content_settings_types.h" |
Clark DuVall | 484c256 | 2020-01-23 22:05:09 | [diff] [blame] | 9 | #include "components/permissions/permission_request_id.h" |
Jinho Bang | bad9b929 | 2018-03-06 00:04:57 | [diff] [blame] | 10 | #include "content/public/browser/web_contents.h" |
Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 11 | #include "third_party/blink/public/mojom/feature_policy/feature_policy.mojom.h" |
Jinho Bang | bad9b929 | 2018-03-06 00:04:57 | [diff] [blame] | 12 | #include "url/gurl.h" |
Jinho Bang | 22de3a9 | 2018-02-27 18:16:22 | [diff] [blame] | 13 | |
| 14 | namespace payments { |
| 15 | |
| 16 | PaymentHandlerPermissionContext::PaymentHandlerPermissionContext( |
Clark DuVall | a11361ad3 | 2020-02-20 22:14:27 | [diff] [blame^] | 17 | content::BrowserContext* browser_context) |
| 18 | : PermissionContextBase(browser_context, |
Darin Fisher | 42f5e7d | 2019-10-30 07:15:45 | [diff] [blame] | 19 | ContentSettingsType::PAYMENT_HANDLER, |
Jinho Bang | 22de3a9 | 2018-02-27 18:16:22 | [diff] [blame] | 20 | blink::mojom::FeaturePolicyFeature::kNotFound) {} |
| 21 | |
| 22 | PaymentHandlerPermissionContext::~PaymentHandlerPermissionContext() {} |
| 23 | |
Jinho Bang | bad9b929 | 2018-03-06 00:04:57 | [diff] [blame] | 24 | void PaymentHandlerPermissionContext::DecidePermission( |
| 25 | content::WebContents* web_contents, |
Clark DuVall | 484c256 | 2020-01-23 22:05:09 | [diff] [blame] | 26 | const permissions::PermissionRequestID& id, |
Jinho Bang | bad9b929 | 2018-03-06 00:04:57 | [diff] [blame] | 27 | const GURL& requesting_origin, |
| 28 | const GURL& embedding_origin, |
| 29 | bool user_gesture, |
Clark DuVall | a11361ad3 | 2020-02-20 22:14:27 | [diff] [blame^] | 30 | permissions::BrowserPermissionCallback callback) { |
Jinho Bang | bad9b929 | 2018-03-06 00:04:57 | [diff] [blame] | 31 | // The user should never be prompted to authorize payment handler. |
| 32 | NOTREACHED(); |
| 33 | } |
| 34 | |
Jinho Bang | 22de3a9 | 2018-02-27 18:16:22 | [diff] [blame] | 35 | bool PaymentHandlerPermissionContext::IsRestrictedToSecureOrigins() const { |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | } // namespace payments |