/*	
 Copyright 2015 Adobe Systems Incorporated.  All rights reserved. 

Purpose- 
This file has the implementation of Dreamweaver side utility functions which are exposed to Device Preview.
*/

/*jslint vars: true, maxerr: 50 */
/*global GenericLiveEditBridger */

function DevicePreviewBridger(documentDOM) {
    'use strict';
    this.logDebugMsg("creating SelectorHud Bridger");
    this.setDocumentDOM(documentDOM);
}

DevicePreviewBridger.prototype = new GenericLiveEditBridger();
DevicePreviewBridger.prototype.constructor = DevicePreviewBridger;
DevicePreviewBridger.prototype.baseClass = GenericLiveEditBridger.prototype.constructor;

DevicePreviewBridger.prototype.updateScrollParams = function (argsObj) {
    'use strict';
    var theDOM = this.getDocumentDOM();

    if (theDOM && argsObj) {
        theDOM.devicePreviewUpdateScrollParams(argsObj.xPercentageScrolled, argsObj.yPercentageScrolled);
    }
};

DevicePreviewBridger.prototype.isDevicePreviewEnabled = function (argsObj) {
    'use strict';
    var theDOM = this.getDocumentDOM(),
        isEnabled = false;

    if (theDOM) {
        isEnabled = theDOM.isDevicePreviewServiceEnabled();
    }
    
    if (argsObj.callbackFunc) {
        argsObj.callbackFunc(isEnabled);
    }
};