All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hubspot.chrome.devtools.client.core.deviceorientation.DeviceOrientation Maven / Gradle / Ivy

package com.hubspot.chrome.devtools.client.core.deviceorientation;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.hubspot.chrome.devtools.base.ChromeRequest;
import com.hubspot.chrome.devtools.base.ChromeSessionCore;

public final class DeviceOrientation {
  ChromeSessionCore chromeSession;

  ObjectMapper objectMapper;

  public DeviceOrientation(ChromeSessionCore chromeSession, ObjectMapper objectMapper) {
    this.chromeSession = chromeSession;
    this.objectMapper = objectMapper;
  }

  /**
   * Clears the overridden Device Orientation.
   */
  public void clearDeviceOrientationOverride() {
    ChromeRequest chromeRequest = new ChromeRequest("DeviceOrientation.clearDeviceOrientationOverride");
    chromeSession.send(chromeRequest);
  }

  /**
   * Clears the overridden Device Orientation.
   */
  public void clearDeviceOrientationOverrideAsync() {
    ChromeRequest chromeRequest = new ChromeRequest("DeviceOrientation.clearDeviceOrientationOverride");
    chromeSession.sendAsync(chromeRequest);
  }

  /**
   * Overrides the Device Orientation.
   *
   * @param alpha  Mock alpha
   * @param beta  Mock beta
   * @param gamma  Mock gamma
   */
  public void setDeviceOrientationOverride(Number alpha, Number beta, Number gamma) {
    ChromeRequest chromeRequest = new ChromeRequest("DeviceOrientation.setDeviceOrientationOverride");
    chromeRequest
        .putParams("alpha", alpha)
        .putParams("beta", beta)
        .putParams("gamma", gamma);
    chromeSession.send(chromeRequest);
  }

  /**
   * Overrides the Device Orientation.
   *
   * @param alpha  Mock alpha
   * @param beta  Mock beta
   * @param gamma  Mock gamma
   */
  public void setDeviceOrientationOverrideAsync(Number alpha, Number beta, Number gamma) {
    ChromeRequest chromeRequest = new ChromeRequest("DeviceOrientation.setDeviceOrientationOverride");
    chromeRequest
        .putParams("alpha", alpha)
        .putParams("beta", beta)
        .putParams("gamma", gamma);
    chromeSession.sendAsync(chromeRequest);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy