deviceorientation.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Package deviceorientation provides the Chrome DevTools Protocol
  2. // commands, types, and events for the DeviceOrientation domain.
  3. //
  4. // Generated by the cdproto-gen command.
  5. package deviceorientation
  6. // Code generated by cdproto-gen. DO NOT EDIT.
  7. import (
  8. "context"
  9. "github.com/chromedp/cdproto/cdp"
  10. )
  11. // ClearDeviceOrientationOverrideParams clears the overridden Device
  12. // Orientation.
  13. type ClearDeviceOrientationOverrideParams struct{}
  14. // ClearDeviceOrientationOverride clears the overridden Device Orientation.
  15. //
  16. // See: https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation#method-clearDeviceOrientationOverride
  17. func ClearDeviceOrientationOverride() *ClearDeviceOrientationOverrideParams {
  18. return &ClearDeviceOrientationOverrideParams{}
  19. }
  20. // Do executes DeviceOrientation.clearDeviceOrientationOverride against the provided context.
  21. func (p *ClearDeviceOrientationOverrideParams) Do(ctx context.Context) (err error) {
  22. return cdp.Execute(ctx, CommandClearDeviceOrientationOverride, nil, nil)
  23. }
  24. // SetDeviceOrientationOverrideParams overrides the Device Orientation.
  25. type SetDeviceOrientationOverrideParams struct {
  26. Alpha float64 `json:"alpha"` // Mock alpha
  27. Beta float64 `json:"beta"` // Mock beta
  28. Gamma float64 `json:"gamma"` // Mock gamma
  29. }
  30. // SetDeviceOrientationOverride overrides the Device Orientation.
  31. //
  32. // See: https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation#method-setDeviceOrientationOverride
  33. //
  34. // parameters:
  35. //
  36. // alpha - Mock alpha
  37. // beta - Mock beta
  38. // gamma - Mock gamma
  39. func SetDeviceOrientationOverride(alpha float64, beta float64, gamma float64) *SetDeviceOrientationOverrideParams {
  40. return &SetDeviceOrientationOverrideParams{
  41. Alpha: alpha,
  42. Beta: beta,
  43. Gamma: gamma,
  44. }
  45. }
  46. // Do executes DeviceOrientation.setDeviceOrientationOverride against the provided context.
  47. func (p *SetDeviceOrientationOverrideParams) Do(ctx context.Context) (err error) {
  48. return cdp.Execute(ctx, CommandSetDeviceOrientationOverride, p, nil)
  49. }
  50. // Command names.
  51. const (
  52. CommandClearDeviceOrientationOverride = "DeviceOrientation.clearDeviceOrientationOverride"
  53. CommandSetDeviceOrientationOverride = "DeviceOrientation.setDeviceOrientationOverride"
  54. )