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

Unified Diff: ios/chrome/browser/payments/payment_request_manager.mm

Issue 2630423002: PaymentRequest JS should be injected only if PaymentRequest is enabled. (Closed)
Patch Set: Created 3 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/payments/payment_request_manager.mm
diff --git a/ios/chrome/browser/payments/payment_request_manager.mm b/ios/chrome/browser/payments/payment_request_manager.mm
index b3565d766578ca8268976046475c4fed96b2a101..0673ad7223d86bd9c56a9fbe3ba856db3437db5f 100644
--- a/ios/chrome/browser/payments/payment_request_manager.mm
+++ b/ios/chrome/browser/payments/payment_request_manager.mm
@@ -203,10 +203,12 @@ const std::string kCommandPrefix = "paymentRequest";
}
- (void)initializeWebViewForPaymentRequest {
- DCHECK(_webStateEnabled);
+ if (_enabled) {
+ DCHECK(_webStateEnabled);
- [_paymentRequestJsManager inject];
- _isScriptInjected = YES;
+ [_paymentRequestJsManager inject];
+ _isScriptInjected = YES;
+ }
}
- (BOOL)handleScriptCommand:(const base::DictionaryValue&)JSONCommand {
@@ -319,10 +321,10 @@ const std::string kCommandPrefix = "paymentRequest";
- (void)webState:(web::WebState*)webState
didCommitNavigationWithDetails:
(const web::LoadCommittedDetails&)load_details {
- _isScriptInjected = NO;
[self dismissUI];
- [self initializeWebViewForPaymentRequest];
+ _isScriptInjected = NO;
[self enableCurrentWebState];
+ [self initializeWebViewForPaymentRequest];
}
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698