Backed out changeset 4f50ba79c6ff (bug 912900) for m-oth bustage

This commit is contained in:
Wes Kocher 2014-03-11 15:32:15 -07:00
Родитель cf0dca624b
Коммит d0d349e99f
5 изменённых файлов: 10 добавлений и 77 удалений

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

@ -4,8 +4,7 @@
const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
const {gDevTools} = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
Cu.import("resource:///modules/devtools/gDevTools.jsm");
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
const {require} = devtools;
@ -18,7 +17,6 @@ const {getTargetForApp, launchApp, closeApp}
const DeviceStore = require("devtools/app-manager/device-store");
const WebappsStore = require("devtools/app-manager/webapps-store");
const promise = require("sdk/core/promise");
const DEFAULT_APP_ICON = "chrome://browser/skin/devtools/app-manager/default-app-icon.png";
window.addEventListener("message", function(event) {
try {
@ -143,7 +141,7 @@ let UI = {
if (panel) panel.classList.add("selected");
},
openToolboxForApp: function(manifest) {
openToolbox: function(manifest) {
if (!this.connected) {
return;
}
@ -157,31 +155,6 @@ let UI = {
}, console.error);
},
_getTargetForTab: function (form) {
let options = {
form: form,
client: this.connection.client,
chrome: false
};
let deferred = promise.defer();
return devtools.TargetFactory.forRemoteTab(options);
},
openToolboxForTab: function (aNode) {
let index = Array.prototype.indexOf.apply(
aNode.parentNode.parentNode.parentNode.children,
[aNode.parentNode.parentNode]);
this.connection.client.listTabs(
response => {
let tab = response.tabs[index];
this._getTargetForTab(tab).then(target => {
top.UI.openAndShowToolboxForTarget(
target, tab.title, DEFAULT_APP_ICON);
}, console.error);
}
);
},
startApp: function(manifest) {
if (!this.connected) {
return promise.reject();

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

@ -44,7 +44,6 @@
<button class="help">&device.help;</button>
</a>
</div>
<div onclick="UI.setTab('browser-tabs')" class="tab sidebar-item browser-tabs" title="&device.browserTabsTooltip;">&device.browserTabs;</div>
</div>
</div>
</aside>
@ -69,9 +68,6 @@
<div class="deny-label" title="&device.denyTooltip;">&device.deny;</div>
</div>
</div>
<div class="tabpanel browser-tabs">
<section template-loop='{"arrayPath":"device.tabs","childSelector":"#browser-tab-template"}'></section>
</div>
</div>
</section>
</section>
@ -87,24 +83,12 @@
</div>
</template>
<template id="browser-tab-template">
<div class="browser-tab">
<div class="browser-tab-details">
<p template='{"type":"textContent","path":"title"}'></p>
<p class="browser-tab-url-subheading" template='{"type":"textContent","path":"url"}'></p>
</div>
<div class="browser-tab-buttons">
<button class="button-debug" template='{"type":"attribute","path":"actor","name":"data-actor"}' onclick="UI.openToolboxForTab(this)" style="display: inline-block;" title="&device.debugBrowserTabTooltip;">&device.debugBrowserTab;</button>
</div>
</div>
</template>
<template id="app-template">
<div class="app" template='{"type":"attribute","path":"running","name":"running"}'>
<img class="app-icon" template='{"type":"attribute","path":"iconURL","name":"src"}'></img>
<span class="app-name" template='{"type":"textContent","path":"name"}'></span>
<div class="app-buttons">
<button class="button-debug" template='{"type":"attribute","path":"manifestURL","name":"data-manifest"}' onclick="UI.openToolboxForApp(this.dataset.manifest)" title="&device.debugAppTooltip;">&device.debugApp;</button>
<button class="button-debug" template='{"type":"attribute","path":"manifestURL","name":"data-manifest"}' onclick="UI.openToolbox(this.dataset.manifest)" title="&device.debugAppTooltip;">&device.debugApp;</button>
<button class="button-start" template='{"type":"attribute","path":"manifestURL","name":"data-manifest"}' onclick="UI.startApp(this.dataset.manifest)" title="&device.startAppTooltip;">&device.startApp;</button>
<button class="button-stop" template='{"type":"attribute","path":"manifestURL","name":"data-manifest"}' onclick="UI.stopApp(this.dataset.manifest)" title="&device.stopAppTooltip;">&device.stopApp;</button>
</div>

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

@ -31,7 +31,6 @@ module.exports = DeviceStore = function(connection) {
this._connection = connection;
this._connection.once(Connection.Events.DESTROYED, this.destroy);
this._connection.on(Connection.Events.STATUS_CHANGED, this._onStatusChanged);
this._onTabListChanged = this._onTabListChanged.bind(this);
this._onStatusChanged();
return this;
}
@ -52,7 +51,6 @@ DeviceStore.prototype = {
_resetStore: function() {
this.object.description = {};
this.object.permissions = [];
this.object.tabs = [];
},
_onStatusChanged: function() {
@ -63,23 +61,9 @@ DeviceStore.prototype = {
}
},
_onTabListChanged: function() {
this._listTabs();
},
_listTabs: function() {
this._connection.client.listTabs((resp) => {
if (resp.error) {
this._connection.disconnect();
return;
}
this._deviceFront = getDeviceFront(this._connection.client, resp);
// Save remote browser's tabs
this.object.tabs = resp.tabs;
// Add listener to update remote browser's tabs list in app-manager
// when it changes
this._connection.client.addListener(
'tabListChanged', this._onTabListChanged);
this._feedStore();
});
},
@ -112,5 +96,5 @@ DeviceStore.prototype = {
}
this.object.permissions = permissionsArray;
});
}
},
}

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

@ -32,10 +32,6 @@
<!ENTITY device.permissions "Permissions">
<!ENTITY device.permissionsTooltip "View a table of the permissions accessible to the different types of apps">
<!ENTITY device.permissionsHelpLink "https://developer.mozilla.org/docs/Web/Apps/App_permissions">
<!ENTITY device.browserTabs "Browser Tabs">
<!ENTITY device.browserTabsTooltip "View a list of tabs in the browser of the connected device">
<!ENTITY device.debugBrowserTab "Debug">
<!ENTITY device.debugBrowserTabTooltip "Open the Developer Tools connected to this browser tab on the device">
<!ENTITY device.help "Help">
<!ENTITY connection.connectTooltip "Connect to the device">

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

@ -308,34 +308,34 @@ header {
/***************** APPS & BROWSER TABS *****************/
/***************** APPS *****************/
.apps, .browser-tabs {
.apps {
display: flex;
flex-direction: column;
overflow: auto;
}
.app, .browser-tab {
.app {
display: flex;
align-items: center;
order: 1;
}
.app-name, .browser-tab-details {
.app-name {
flex-grow: 1;
font-weight: bold;
}
.app, .browser-tab {
.app {
padding: 10px 20px;
border-bottom: 1px solid #CCC;
}
.app:hover, .browser-tab:hover {
.app:hover {
background-color: #EFEFEF;
}
@ -345,10 +345,6 @@ header {
margin-right: 10px;
}
.browser-tab-url-subheading {
font-size: 10px;
}
/***************** NOT CONNECTED *****************/