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