Auto merge of #6230 - frewsxcv:getters-get, r=nox

Part of #6224

I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6230)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-06-02 08:17:03 -05:00
commit f6fe195334
21 changed files with 62 additions and 70 deletions

View file

@ -10,13 +10,13 @@ use std::sync::mpsc::channel;
pub trait ClipboardProvider {
// blocking method to get the clipboard contents
fn get_clipboard_contents(&mut self) -> String;
fn clipboard_contents(&mut self) -> String;
// blocking method to set the clipboard contents
fn set_clipboard_contents(&mut self, &str);
}
impl ClipboardProvider for ConstellationChan {
fn get_clipboard_contents(&mut self) -> String {
fn clipboard_contents(&mut self) -> String {
let (tx, rx) = channel();
self.0.send(ConstellationMsg::GetClipboardContents(tx)).unwrap();
rx.recv().unwrap()
@ -39,7 +39,7 @@ impl DummyClipboardContext {
}
impl ClipboardProvider for DummyClipboardContext {
fn get_clipboard_contents(&mut self) -> String {
fn clipboard_contents(&mut self) -> String {
self.content.clone()
}
fn set_clipboard_contents(&mut self, s: &str) {

View file

@ -315,7 +315,7 @@ impl<T: ClipboardProvider> TextInput<T> {
KeyReaction::Nothing
},
Key::V if is_control_key(mods) => {
let contents = self.clipboard_provider.get_clipboard_contents();
let contents = self.clipboard_provider.clipboard_contents();
self.insert_string(&contents);
KeyReaction::DispatchInput
},