OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 * @return {boolean} | 414 * @return {boolean} |
415 */ | 415 */ |
416 isHostedMode() { | 416 isHostedMode() { |
417 return true; | 417 return true; |
418 } | 418 } |
419 }; | 419 }; |
420 | 420 |
421 /** | 421 /** |
422 * @unrestricted | 422 * @unrestricted |
423 */ | 423 */ |
424 var InspectorFrontendAPIImpl = class { | 424 Host.InspectorFrontendAPIImpl = class { |
425 constructor() { | 425 constructor() { |
426 this._debugFrontend = | 426 this._debugFrontend = |
427 !!Runtime.queryParam('debugFrontend') || (window['InspectorTest'] && win
dow['InspectorTest']['debugTest']); | 427 !!Runtime.queryParam('debugFrontend') || (window['InspectorTest'] && win
dow['InspectorTest']['debugTest']); |
428 | 428 |
429 var descriptors = InspectorFrontendHostAPI.EventDescriptors; | 429 var descriptors = InspectorFrontendHostAPI.EventDescriptors; |
430 for (var i = 0; i < descriptors.length; ++i) | 430 for (var i = 0; i < descriptors.length; ++i) |
431 this[descriptors[i][1]] = this._dispatch.bind(this, descriptors[i][0], des
criptors[i][2], descriptors[i][3]); | 431 this[descriptors[i][1]] = this._dispatch.bind(this, descriptors[i][0], des
criptors[i][2], descriptors[i][3]); |
432 } | 432 } |
433 | 433 |
434 /** | 434 /** |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 return proto[name].apply(InspectorFrontendHost, args); | 507 return proto[name].apply(InspectorFrontendHost, args); |
508 } | 508 } |
509 | 509 |
510 // Attach the events object. | 510 // Attach the events object. |
511 InspectorFrontendHost.events = new Common.Object(); | 511 InspectorFrontendHost.events = new Common.Object(); |
512 } | 512 } |
513 | 513 |
514 // FIXME: This file is included into both apps, since the devtools_app needs t
he InspectorFrontendHostAPI only, | 514 // FIXME: This file is included into both apps, since the devtools_app needs t
he InspectorFrontendHostAPI only, |
515 // so the host instance should not initialized there. | 515 // so the host instance should not initialized there. |
516 initializeInspectorFrontendHost(); | 516 initializeInspectorFrontendHost(); |
517 window.InspectorFrontendAPI = new InspectorFrontendAPIImpl(); | 517 window.InspectorFrontendAPI = new Host.InspectorFrontendAPIImpl(); |
518 Common.setLocalizationPlatform(InspectorFrontendHost.platform()); | 518 Common.setLocalizationPlatform(InspectorFrontendHost.platform()); |
519 })(); | 519 })(); |
520 | 520 |
521 /** | 521 /** |
522 * @type {!Common.EventTarget} | 522 * @type {!Common.EventTarget} |
523 */ | 523 */ |
524 InspectorFrontendHost.events; | 524 InspectorFrontendHost.events; |
525 | 525 |
526 /** | 526 /** |
527 * @param {!Object<string, string>=} prefs | 527 * @param {!Object<string, string>=} prefs |
528 * @return {boolean} | 528 * @return {boolean} |
529 */ | 529 */ |
530 Host.isUnderTest = function(prefs) { | 530 Host.isUnderTest = function(prefs) { |
531 if (InspectorFrontendHost.isUnderTest()) | 531 if (InspectorFrontendHost.isUnderTest()) |
532 return true; | 532 return true; |
533 | 533 |
534 if (prefs) | 534 if (prefs) |
535 return prefs['isUnderTest'] === 'true'; | 535 return prefs['isUnderTest'] === 'true'; |
536 return Common.settings.createSetting('isUnderTest', false).get(); | 536 return Common.settings.createSetting('isUnderTest', false).get(); |
537 }; | 537 }; |
OLD | NEW |