mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
Remove WindowNavigateMsg
This commit is contained in:
parent
18c5ba108d
commit
0cce5776a7
4 changed files with 16 additions and 25 deletions
|
@ -8,13 +8,14 @@ use frame::{ServoCefFrame, ServoCefFrameExtensions};
|
|||
use interfaces::{CefBrowser, CefBrowserHost, CefClient, CefFrame, CefRequestContext};
|
||||
use interfaces::{cef_browser_t, cef_browser_host_t, cef_client_t, cef_frame_t};
|
||||
use interfaces::{cef_request_context_t};
|
||||
use msg::constellation_msg::TraversalDirection;
|
||||
use servo::Browser;
|
||||
use servo::servo_url::ServoUrl;
|
||||
use types::{cef_browser_settings_t, cef_string_t, cef_window_info_t, cef_window_handle_t};
|
||||
use window;
|
||||
use wrappers::CefWrap;
|
||||
|
||||
use compositing::windowing::{WindowNavigateMsg, WindowEvent};
|
||||
use compositing::windowing::WindowEvent;
|
||||
use glutin_app;
|
||||
use libc::c_int;
|
||||
use std::cell::{Cell, RefCell};
|
||||
|
@ -69,11 +70,11 @@ cef_class_impl! {
|
|||
}}
|
||||
|
||||
fn go_back(&this,) -> () {{
|
||||
this.send_window_event(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
this.send_window_event(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}}
|
||||
|
||||
fn go_forward(&this,) -> () {{
|
||||
this.send_window_event(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
this.send_window_event(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}}
|
||||
|
||||
// Returns the main (top-level) frame for the browser window.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
use NestedEventLoopListener;
|
||||
use compositing::compositor_thread::EventLoopWaker;
|
||||
use compositing::windowing::{AnimationState, MouseWindowEvent, WindowNavigateMsg};
|
||||
use compositing::windowing::{AnimationState, MouseWindowEvent};
|
||||
use compositing::windowing::{WindowEvent, WindowMethods};
|
||||
use euclid::{Point2D, Size2D, TypedPoint2D, TypedVector2D, TypedRect, ScaleFactor, TypedSize2D};
|
||||
#[cfg(target_os = "windows")]
|
||||
|
@ -20,7 +20,7 @@ use glutin::TouchPhase;
|
|||
#[cfg(target_os = "macos")]
|
||||
use glutin::os::macos::{ActivationPolicy, WindowBuilderExt};
|
||||
use msg::constellation_msg::{self, Key};
|
||||
use msg::constellation_msg::{ALT, CONTROL, KeyState, NONE, SHIFT, SUPER};
|
||||
use msg::constellation_msg::{ALT, CONTROL, KeyState, NONE, SHIFT, SUPER, TraversalDirection};
|
||||
use net_traits::net_error_list::NetError;
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
use osmesa_sys;
|
||||
|
@ -930,10 +930,10 @@ impl Window {
|
|||
fn platform_handle_key(&self, key: Key, mods: constellation_msg::KeyModifiers) {
|
||||
match (mods, key) {
|
||||
(CMD_OR_CONTROL, Key::LeftBracket) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}
|
||||
(CMD_OR_CONTROL, Key::RightBracket) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
@ -1220,10 +1220,10 @@ impl WindowMethods for Window {
|
|||
}
|
||||
|
||||
(NONE, None, Key::NavigateForward) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}
|
||||
(NONE, None, Key::NavigateBackward) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}
|
||||
|
||||
(NONE, None, Key::Escape) => {
|
||||
|
@ -1233,10 +1233,10 @@ impl WindowMethods for Window {
|
|||
}
|
||||
|
||||
(CMD_OR_ALT, None, Key::Right) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Forward(1)));
|
||||
}
|
||||
(CMD_OR_ALT, None, Key::Left) => {
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
|
||||
self.event_queue.borrow_mut().push(WindowEvent::Navigation(TraversalDirection::Back(1)));
|
||||
}
|
||||
|
||||
(NONE, None, Key::PageDown) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue