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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp

Issue 2958333002: [Payments] Implement web payment app manifest (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
OLDNEW
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 "modules/payments/PaymentInstruments.h" 5 #include "modules/payments/PaymentInstruments.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/ScriptPromise.h" 10 #include "bindings/core/v8/ScriptPromise.h"
(...skipping 28 matching lines...) Expand all
39 return true; 39 return true;
40 case payments::mojom::blink::PaymentHandlerStatus::STORAGE_OPERATION_FAILED: 40 case payments::mojom::blink::PaymentHandlerStatus::STORAGE_OPERATION_FAILED:
41 resolver->Reject(DOMException::Create(kInvalidStateError, 41 resolver->Reject(DOMException::Create(kInvalidStateError,
42 "Storage operation is failed")); 42 "Storage operation is failed"));
43 return true; 43 return true;
44 case payments::mojom::blink::PaymentHandlerStatus:: 44 case payments::mojom::blink::PaymentHandlerStatus::
45 FETCH_INSTRUMENT_ICON_FAILED: 45 FETCH_INSTRUMENT_ICON_FAILED:
46 resolver->Reject(DOMException::Create( 46 resolver->Reject(DOMException::Create(
47 kNotFoundError, "Fetch or decode instrument icon failed")); 47 kNotFoundError, "Fetch or decode instrument icon failed"));
48 return true; 48 return true;
49 case payments::mojom::blink::PaymentHandlerStatus::
50 FETCH_PAYMENT_APP_INFO_FAILED:
51 resolver->Reject(DOMException::Create(kNotFoundError,
52 "Fetch payment app's info "
53 "(manifest or the field in the "
54 "manifest) failed"));
55 return true;
49 } 56 }
50 NOTREACHED(); 57 NOTREACHED();
51 return false; 58 return false;
52 } 59 }
53 60
54 } // namespace 61 } // namespace
55 62
56 PaymentInstruments::PaymentInstruments( 63 PaymentInstruments::PaymentInstruments(
57 const payments::mojom::blink::PaymentManagerPtr& manager) 64 const payments::mojom::blink::PaymentManagerPtr& manager)
58 : manager_(manager) {} 65 : manager_(manager) {}
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 void PaymentInstruments::onClearPaymentInstruments( 291 void PaymentInstruments::onClearPaymentInstruments(
285 ScriptPromiseResolver* resolver, 292 ScriptPromiseResolver* resolver,
286 payments::mojom::blink::PaymentHandlerStatus status) { 293 payments::mojom::blink::PaymentHandlerStatus status) {
287 DCHECK(resolver); 294 DCHECK(resolver);
288 if (rejectError(resolver, status)) 295 if (rejectError(resolver, status))
289 return; 296 return;
290 resolver->Resolve(); 297 resolver->Resolve();
291 } 298 }
292 299
293 } // namespace blink 300 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698