#[non_exhaustive]pub enum ChromeCommandGroup {
WindowAndTab,
Document,
BrowserChrome,
BrowserSurface,
History,
}Expand description
A family of Chrome commands the runtime swallows in an application window.
A Chrome style browser keeps its whole accelerator table live even when it is hosted
as a child view with no browser UI, so Ctrl+N opens a real Chrome window next to the
app’s and Ctrl+P prints the app’s own markup. The runtime blocks the families below by
default; naming one in
allow_chrome_commands
lets that family run the way it would in a browser.
DevTools and zoom are not here: they follow WebviewAttributes::devtools and
WebviewAttributes::zoom_hotkeys_enabled.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WindowAndTab
Ctrl+N, Ctrl+Shift+N, Ctrl+T and the whole tab strip: new window, new incognito window, new tab, duplicate, restore, reorder, and select tab 1-8.
An app window has no tab strip for these to act on, and the windows they open are real Chrome windows the application does not own.
Document
Ctrl+P, Ctrl+S, Ctrl+U, Ctrl+O: print, print without preview, save page, view source, open file, and the PWA install and shortcut commands.
The commonest group to want back — Ctrl+P is a keystroke users expect. Note that
WebviewDispatch::print prints on request without this, and that IDC_OPEN_FILE
and IDC_SAVE_PAGE raise OS file dialogs.
BrowserChrome
Ctrl+L and its neighbours: focus the omnibox, the search box, the toolbar, the menu bar or the bookmarks bar, plus Home and open-current-URL.
An app window has none of that chrome, so these can only move keyboard focus somewhere the user cannot see; Home and open-current-URL additionally navigate the webview away from the app’s own UI.
BrowserSurface
Ctrl+H, Ctrl+J, Ctrl+D, Ctrl+Shift+Delete and the rest: history, downloads, bookmarks, settings, clear browsing data, the task manager, sign-in, about and feedback.
These load Chrome WebUI pages in place of the app’s UI, in the very webview the accelerator was pressed in, and expose the browsing data of every webview sharing the request context.
History
Alt+Left and Alt+Right: back and forward through the session history.
The browser is created at an internal placeholder URL and only then navigated to the
app’s own, so the app’s first screen already sits on a second history entry and
going back from it lands on a blank page. WebviewDispatch::go_back and
go_forward work without this.
Trait Implementations§
Source§impl Clone for ChromeCommandGroup
impl Clone for ChromeCommandGroup
impl Copy for ChromeCommandGroup
Source§impl Debug for ChromeCommandGroup
impl Debug for ChromeCommandGroup
impl Eq for ChromeCommandGroup
Source§impl Hash for ChromeCommandGroup
impl Hash for ChromeCommandGroup
Source§impl PartialEq for ChromeCommandGroup
impl PartialEq for ChromeCommandGroup
impl StructuralPartialEq for ChromeCommandGroup
Auto Trait Implementations§
impl Freeze for ChromeCommandGroup
impl RefUnwindSafe for ChromeCommandGroup
impl Send for ChromeCommandGroup
impl Sync for ChromeCommandGroup
impl Unpin for ChromeCommandGroup
impl UnsafeUnpin for ChromeCommandGroup
impl UnwindSafe for ChromeCommandGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
fn wrap_result(self) -> U
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.