Bug 1197133: Use dispatcher for listener getTitle

r=dburns

--HG--
extra : commitid : 8vtmyidCi3x
extra : rebase_source : e508e807147c163799b8bbf54149963f287ed91d
This commit is contained in:
Andreas Tolfsen 2015-08-21 11:04:06 +01:00
Родитель 1bb1ddb8be
Коммит a58ec6fa20
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -183,6 +183,7 @@ function removeMessageListenerId(messageName, handler) {
removeMessageListener(messageName + listenerId, handler);
}
let getTitleFn = dispatch(getTitle);
let getElementSizeFn = dispatch(getElementSize);
let getActiveElementFn = dispatch(getActiveElement);
let clickElementFn = dispatch(clickElement);
@ -209,7 +210,7 @@ function startListeners() {
addMessageListenerId("Marionette:pollForReadyState", pollForReadyState);
addMessageListenerId("Marionette:cancelRequest", cancelRequest);
addMessageListenerId("Marionette:getCurrentUrl", getCurrentUrlFn);
addMessageListenerId("Marionette:getTitle", getTitle);
addMessageListenerId("Marionette:getTitle", getTitleFn);
addMessageListenerId("Marionette:getPageSource", getPageSource);
addMessageListenerId("Marionette:goBack", goBack);
addMessageListenerId("Marionette:goForward", goForward);
@ -313,7 +314,7 @@ function deleteSession(msg) {
removeMessageListenerId("Marionette:get", get);
removeMessageListenerId("Marionette:pollForReadyState", pollForReadyState);
removeMessageListenerId("Marionette:cancelRequest", cancelRequest);
removeMessageListenerId("Marionette:getTitle", getTitle);
removeMessageListenerId("Marionette:getTitle", getTitleFn);
removeMessageListenerId("Marionette:getPageSource", getPageSource);
removeMessageListenerId("Marionette:getCurrentUrl", getCurrentUrlFn);
removeMessageListenerId("Marionette:goBack", goBack);
@ -1332,10 +1333,10 @@ function getCurrentUrl(isB2G) {
}
/**
* Get the current Title of the window
* Get the title of the current browsing context.
*/
function getTitle(msg) {
sendResponse({value: curFrame.top.document.title}, msg.json.command_id);
function getTitle() {
return curFrame.top.document.title;
}
/**