1 // Copyright (c) 2010 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 6 function chromeos() { 7 } 8 9 chromeos.connectionManager = function() { 10 }; 11 12 chromeos.connectionManager.transaction_status_callback_ = null; 13 chromeos.connectionManager.parent_page_url_ = 'chrome://mobilesetup'; 14 15 chromeos.connectionManager.setTransactionStatus = function(status, callback) { 16 chromeos.connectionManager.transaction_status_callback_ = callback; 17 chromeos.connectionManager.reportTransactionStatus_(status); 18 }; 19 20 chromeos.connectionManager.reportTransactionStatus_ = function(status) { 21 var msg = { 22 'type': 'reportTransactionStatusMsg', 23 'domain': location.href, 24 'status': status 25 }; 26 window.parent.postMessage(msg, chromeos.connectionManager.parent_page_url_); 27 }; 28 29