| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 receivedCompletedConnectionTestSuite: function() { | 309 receivedCompletedConnectionTestSuite: function() { |
| 310 for (var i = 0; i < this.connectionTestsObservers_.length; i++) | 310 for (var i = 0; i < this.connectionTestsObservers_.length; i++) |
| 311 this.connectionTestsObservers_[i].onCompletedConnectionTestSuite(); | 311 this.connectionTestsObservers_[i].onCompletedConnectionTestSuite(); |
| 312 }, | 312 }, |
| 313 | 313 |
| 314 receivedHSTSResult: function(info) { | 314 receivedHSTSResult: function(info) { |
| 315 for (var i = 0; i < this.hstsObservers_.length; i++) | 315 for (var i = 0; i < this.hstsObservers_.length; i++) |
| 316 this.hstsObservers_[i].onHSTSQueryResult(info); | 316 this.hstsObservers_[i].onHSTSQueryResult(info); |
| 317 }, | 317 }, |
| 318 | 318 |
| 319 receivedONCFileParse: function(status) { | 319 receivedONCFileParse: function(error) { |
| 320 for (var i = 0; i < this.crosONCFileParseObservers_.length; i++) | 320 for (var i = 0; i < this.crosONCFileParseObservers_.length; i++) |
| 321 this.crosONCFileParseObservers_[i].onONCFileParse(status); | 321 this.crosONCFileParseObservers_[i].onONCFileParse(error); |
| 322 }, | 322 }, |
| 323 | 323 |
| 324 receivedHttpCacheInfo: function(info) { | 324 receivedHttpCacheInfo: function(info) { |
| 325 this.pollableDataHelpers_.httpCacheInfo.update(info); | 325 this.pollableDataHelpers_.httpCacheInfo.update(info); |
| 326 }, | 326 }, |
| 327 | 327 |
| 328 receivedHttpThrottlingEnabledPrefChanged: function(enabled) { | 328 receivedHttpThrottlingEnabledPrefChanged: function(enabled) { |
| 329 for (var i = 0; i < this.httpThrottlingObservers_.length; i++) { | 329 for (var i = 0; i < this.httpThrottlingObservers_.length; i++) { |
| 330 this.httpThrottlingObservers_[i].onHttpThrottlingEnabledPrefChanged( | 330 this.httpThrottlingObservers_[i].onHttpThrottlingEnabledPrefChanged( |
| 331 enabled); | 331 enabled); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 * observer.onHSTSQueryResult(result); | 491 * observer.onHSTSQueryResult(result); |
| 492 */ | 492 */ |
| 493 addHSTSObserver: function(observer) { | 493 addHSTSObserver: function(observer) { |
| 494 this.hstsObservers_.push(observer); | 494 this.hstsObservers_.push(observer); |
| 495 }, | 495 }, |
| 496 | 496 |
| 497 /** | 497 /** |
| 498 * Adds a listener for ONC file parse status. The observer will be called | 498 * Adds a listener for ONC file parse status. The observer will be called |
| 499 * back with: | 499 * back with: |
| 500 * | 500 * |
| 501 * observer.onONCFileParse(status); | 501 * observer.onONCFileParse(error); |
| 502 */ | 502 */ |
| 503 addCrosONCFileParseObserver: function(observer) { | 503 addCrosONCFileParseObserver: function(observer) { |
| 504 this.crosONCFileParseObservers_.push(observer); | 504 this.crosONCFileParseObservers_.push(observer); |
| 505 }, | 505 }, |
| 506 | 506 |
| 507 /** | 507 /** |
| 508 * Adds a listener for HTTP throttling-related events. |observer| will be | 508 * Adds a listener for HTTP throttling-related events. |observer| will be |
| 509 * called back when HTTP throttling is enabled/disabled, through: | 509 * called back when HTTP throttling is enabled/disabled, through: |
| 510 * | 510 * |
| 511 * observer.onHttpThrottlingEnabledPrefChanged(enabled); | 511 * observer.onHttpThrottlingEnabledPrefChanged(enabled); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 helper.removeObserver(this); | 688 helper.removeObserver(this); |
| 689 --this.observingCount_; | 689 --this.observingCount_; |
| 690 this.updatedData_[name] = data; | 690 this.updatedData_[name] = data; |
| 691 if (this.observingCount_ == 0) | 691 if (this.observingCount_ == 0) |
| 692 this.callback_(this.updatedData_); | 692 this.callback_(this.updatedData_); |
| 693 } | 693 } |
| 694 }; | 694 }; |
| 695 | 695 |
| 696 return BrowserBridge; | 696 return BrowserBridge; |
| 697 })(); | 697 })(); |
| OLD | NEW |