script/dom/serviceworker/
windowclient.rs1use dom_struct::dom_struct;
6use js::context::JSContext;
7use script_bindings::codegen::GenericBindings::WindowClientBinding::WindowClientMethods;
8use script_bindings::str::USVString;
9
10use crate::dom::bindings::reflector::DomGlobal;
11use crate::dom::client::Client;
12use crate::dom::promise::{Promise, RootedPromise};
13
14#[dom_struct]
15pub(crate) struct WindowClient {
16 client: Client,
17}
18
19impl WindowClientMethods<crate::DomTypeHolder> for WindowClient {
20 fn Focus(&self, cx: &mut JSContext) -> RootedPromise {
22 Promise::new(cx, &self.global())
24 }
25
26 fn Navigate(&self, cx: &mut JSContext, _url: USVString) -> RootedPromise {
28 Promise::new(cx, &self.global())
30 }
31}