OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 /** | 5 /** |
6 * This class provides a "bridge" for communicating between the javascript and | 6 * This class provides a "bridge" for communicating between the javascript and |
7 * the browser. | 7 * the browser. |
8 */ | 8 */ |
9 var BrowserBridge = (function() { | 9 var BrowserBridge = (function() { |
10 'use strict'; | 10 'use strict'; |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 receivedCompletedConnectionTestSuite: function() { | 345 receivedCompletedConnectionTestSuite: function() { |
346 for (var i = 0; i < this.connectionTestsObservers_.length; i++) | 346 for (var i = 0; i < this.connectionTestsObservers_.length; i++) |
347 this.connectionTestsObservers_[i].onCompletedConnectionTestSuite(); | 347 this.connectionTestsObservers_[i].onCompletedConnectionTestSuite(); |
348 }, | 348 }, |
349 | 349 |
350 receivedHSTSResult: function(info) { | 350 receivedHSTSResult: function(info) { |
351 for (var i = 0; i < this.hstsObservers_.length; i++) | 351 for (var i = 0; i < this.hstsObservers_.length; i++) |
352 this.hstsObservers_[i].onHSTSQueryResult(info); | 352 this.hstsObservers_[i].onHSTSQueryResult(info); |
353 }, | 353 }, |
354 | 354 |
355 receivedONCFileParse: function(error) { | 355 /** |
| 356 * @param {!{message: string, success: boolean}} params Parameter dict. |
| 357 */ |
| 358 receivedONCFileParse: function(params) { |
356 for (var i = 0; i < this.crosONCFileParseObservers_.length; i++) | 359 for (var i = 0; i < this.crosONCFileParseObservers_.length; i++) |
357 this.crosONCFileParseObservers_[i].onONCFileParse(error); | 360 this.crosONCFileParseObservers_[i].onONCFileParse(params.message, |
| 361 params.success); |
358 }, | 362 }, |
359 | 363 |
360 receivedStoreDebugLogs: function(status) { | 364 receivedStoreDebugLogs: function(status) { |
361 for (var i = 0; i < this.storeDebugLogsObservers_.length; i++) | 365 for (var i = 0; i < this.storeDebugLogsObservers_.length; i++) |
362 this.storeDebugLogsObservers_[i].onStoreDebugLogs(status); | 366 this.storeDebugLogsObservers_[i].onStoreDebugLogs(status); |
363 }, | 367 }, |
364 | 368 |
365 receivedSetNetworkDebugMode: function(status) { | 369 receivedSetNetworkDebugMode: function(status) { |
366 for (var i = 0; i < this.setNetworkDebugModeObservers_.length; i++) | 370 for (var i = 0; i < this.setNetworkDebugModeObservers_.length; i++) |
367 this.setNetworkDebugModeObservers_[i].onSetNetworkDebugMode(status); | 371 this.setNetworkDebugModeObservers_[i].onSetNetworkDebugMode(status); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 * observer.onHSTSQueryResult(result); | 568 * observer.onHSTSQueryResult(result); |
565 */ | 569 */ |
566 addHSTSObserver: function(observer) { | 570 addHSTSObserver: function(observer) { |
567 this.hstsObservers_.push(observer); | 571 this.hstsObservers_.push(observer); |
568 }, | 572 }, |
569 | 573 |
570 /** | 574 /** |
571 * Adds a listener for ONC file parse status. The observer will be called | 575 * Adds a listener for ONC file parse status. The observer will be called |
572 * back with: | 576 * back with: |
573 * | 577 * |
574 * observer.onONCFileParse(error); | 578 * observer.onONCFileParse(error, success); |
575 */ | 579 */ |
576 addCrosONCFileParseObserver: function(observer) { | 580 addCrosONCFileParseObserver: function(observer) { |
577 this.crosONCFileParseObservers_.push(observer); | 581 this.crosONCFileParseObservers_.push(observer); |
578 }, | 582 }, |
579 | 583 |
580 /** | 584 /** |
581 * Adds a listener for storing log file status. The observer will be called | 585 * Adds a listener for storing log file status. The observer will be called |
582 * back with: | 586 * back with: |
583 * | 587 * |
584 * observer.onStoreDebugLogs(status); | 588 * observer.onStoreDebugLogs(status); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 helper.removeObserver(this); | 786 helper.removeObserver(this); |
783 --this.observingCount_; | 787 --this.observingCount_; |
784 this.updatedData_[name] = data; | 788 this.updatedData_[name] = data; |
785 if (this.observingCount_ == 0) | 789 if (this.observingCount_ == 0) |
786 this.callback_(this.updatedData_); | 790 this.callback_(this.updatedData_); |
787 } | 791 } |
788 }; | 792 }; |
789 | 793 |
790 return BrowserBridge; | 794 return BrowserBridge; |
791 })(); | 795 })(); |
OLD | NEW |