| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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 function couponCodeCallback(result) { | |
| 6 response = "getCouponCode returned: " + result; | |
| 7 console.log(response); | |
| 8 } | |
| 9 | |
| 10 function consentCallback(result) { | |
| 11 if (result == true) { | |
| 12 chrome.offersPrivate.getCouponCode("COUPON_CODE", couponCodeCallback); | |
| 13 return; | |
| 14 } | |
| 15 console.log("User declined ECHO!"); | |
| 16 } | |
| 17 | |
| 18 window.onload = function() { | |
| 19 chrome.offersPrivate.getUserConsent(consentCallback); | |
| 20 } | |
| OLD | NEW |