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