This repository was archived by the owner on Dec 1, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Bug 1261488 - ToC & sidebar proto-impl (rebased & unforked) #376
Merged
dmose
merged 18 commits into
mozilla:akita
from
dmose:unforked-toc-sidebar-prototype-1261762
Apr 27, 2016
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
4db40cf
Bug 1261488 - prototype ToC view, r=Standard8
mancas 42d9f70
Bug 1261488 - Add RoomPresence view into ToC, r=Standard8
mancas a0bd0c0
Bug 1261488 - Teach StandaloneRoomView + friends about TableOfContent…
2e45915
Bug 1261488 - SidebarView and auto-join the room, r=Standard8
mancas fd2626b
Bug 1261488 - WebRTC connection on standalone, r=Standard8
mancas cf31c11
Bug 1261488 - Sidebar desktop side, part 1, r=Standard8
mancas c67df45
Bug 1261488 - Sidebar desktop side, part 2, r=Standard8
mancas e35029a
Bug 1261488 - Move about:loop* definitions into the Loop add-on, r=St…
8bfffbf
Bug 1261488 - About:toc page added, r=Standard8
mancas b815e94
Bug 1261488 - Fixup AboutLoop to have fewer errors, r=Standard8
a0a7398
Bug 1261488 - Make about:looptoc use the fixed AboutLoop infrastructu…
7a7c08f
Bug 1261488 - Switch sidebar to be per-window; point to about:loopcon…
1c907ed
Bug 1261488 - Sidebar cleanup, r=Standard8
mancas 869c9f3
Bug 1261488 - Some sidebar creation improvements, r=Standard8
238bb52
Bug 1261488 - Get SidebarControllerView rendering, r=Standard8
04a3169
Bug 1261488 - Sidebar css, r=Standard8
mancas 3d56519
Bug 1261488 - Cleanup some unit test bits, r=Standard8
10e2330
Bug 1261488 - Fix review comments, r=Standard8
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", | |
| "resource:///modules/CustomizableUI.jsm"); | ||
| XPCOMUtils.defineLazyModuleGetter(this, "Task", | ||
| "resource://gre/modules/Task.jsm"); | ||
| XPCOMUtils.defineLazyModuleGetter(this, "AboutLoop", | ||
| "chrome://loop/content/modules/AboutLoop.jsm"); | ||
|
|
||
| // See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error". | ||
| const PREF_LOG_LEVEL = "loop.debug.loglevel"; | ||
|
|
@@ -347,6 +349,41 @@ var WindowListener = { | |
|
|
||
| this.maybeAddCopyPanel(); | ||
| this.updateToolbarState(); | ||
|
|
||
| this.addSidebar(); | ||
| }, | ||
|
|
||
| /* XXX akita make this into it's own object. */ | ||
| addSidebar: function() { | ||
| let ownerDocument = gBrowser.ownerDocument; | ||
| var browser = ownerDocument.getElementById("browser"); | ||
|
|
||
| let sidebarBrowser = document.createElementNS(kNSXUL, "browser"); | ||
| sidebarBrowser.setAttribute("id", "loop-side-browser"); | ||
| sidebarBrowser.setAttribute("disable-history", "true"); | ||
| sidebarBrowser.setAttribute("disable-global-history", "true"); | ||
|
|
||
| // XXX akita something like these seem likely to be required once we | ||
| // electrolyze this along with a URI_MUST_LOAD_IN_CHILD in | ||
| // AboutLoop.jsm | ||
| // sidebarBrowser.setAttribute("message-manager-group", "social"); | ||
| // sidebarBrowser.setAttribute("message", "true"); | ||
| // sidebarBrowser.setAttribute("remote", "true"); | ||
|
|
||
| sidebarBrowser.setAttribute("type", "content"); | ||
|
|
||
| this.sidebar = sidebarBrowser; | ||
| this.sidebar.width = 250; | ||
|
|
||
| browser.appendChild(sidebarBrowser); | ||
| }, | ||
|
|
||
| loadSidebar: function(token) { | ||
| log.info("loadSidebar called:", token, this.sidebar); | ||
| let url = "about:loopconversation#" + token; | ||
| Services.perms.add(Services.io.newURI(url, null, null), "camera", | ||
| Services.perms.ALLOW_ACTION, Services.perms.EXPIRE_SESSION); | ||
| this.sidebar.setAttribute("src", url); | ||
| }, | ||
|
|
||
| /** | ||
|
|
@@ -1360,6 +1397,11 @@ function startup(data) { | |
| return; | ||
| } | ||
|
|
||
| // register about: handlers | ||
| AboutLoop.conversation.register(); // eslint-disable-line no-undef | ||
| AboutLoop.panel.register(); // eslint-disable-line no-undef | ||
| AboutLoop.toc.register(); // eslint-disable-line no-undef | ||
|
|
||
| createLoopButton(); | ||
|
|
||
| // Attach to hidden window (for OS X). | ||
|
|
@@ -1431,6 +1473,11 @@ function shutdown(data, reason) { | |
| // Stop waiting for browser windows to open. | ||
| wm.removeListener(WindowListener); | ||
|
|
||
| // unregister about: handlers | ||
| AboutLoop.conversation.unregister(); // eslint-disable-line no-undef | ||
| AboutLoop.panel.unregister(); // eslint-disable-line no-undef | ||
| AboutLoop.toc.unregister(); // eslint-disable-line no-undef | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I think this was mentioned in Mark's original review comments. Do we still need to go through and address his original comments now that we've unforked?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see the comment you're talking about
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I got confused; never mind! |
||
|
|
||
| // If the app is shutting down, don't worry about cleaning up, just let | ||
| // it fade away... | ||
| if (reason == APP_SHUTDOWN) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| /* This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
| "use strict"; | ||
|
|
||
| /* Basic code borrowed and adapted from PocketAbout stuff in mozilla-central | ||
| */ | ||
|
|
||
| const { interfaces: Ci, results: Cr, manager: Cm, utils: Cu } = Components; | ||
|
|
||
| Cu.import("resource://gre/modules/Services.jsm"); | ||
| Cu.import("resource://gre/modules/XPCOMUtils.jsm"); | ||
|
|
||
| // See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error". | ||
| const PREF_LOG_LEVEL = "loop.debug.loglevel"; | ||
|
|
||
| XPCOMUtils.defineLazyGetter(this, "log", () => { | ||
| let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI; | ||
| let consoleOptions = { | ||
| maxLogLevelPref: PREF_LOG_LEVEL, | ||
| prefix: "Loop" | ||
| }; | ||
| return new ConsoleAPI(consoleOptions); | ||
| }); | ||
|
|
||
|
|
||
| function AboutPage(chromeURL, aboutHost, classID, description, uriFlags) { | ||
| this.chromeURL = chromeURL; | ||
| this.aboutHost = aboutHost; | ||
| this.classID = Components.ID(classID); | ||
| this.description = description; | ||
| this.uriFlags = uriFlags; | ||
| } | ||
|
|
||
| AboutPage.prototype = { | ||
| QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]), | ||
| getURIFlags: function(aURI) { // eslint-disable-line no-unused-vars | ||
| return this.uriFlags; | ||
| }, | ||
|
|
||
| newChannel: function(aURI, aLoadInfo) { | ||
| let newURI = Services.io.newURI(this.chromeURL, null, null); | ||
| let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, | ||
| aLoadInfo); | ||
| channel.originalURI = aURI; | ||
|
|
||
| if (this.uriFlags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { | ||
| let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI); | ||
| channel.owner = principal; | ||
| } | ||
| return channel; | ||
| }, | ||
|
|
||
| createInstance: function(outer, iid) { | ||
| if (outer != null) { | ||
| throw Cr.NS_ERROR_NO_AGGREGATION; | ||
| } | ||
| return this.QueryInterface(iid); | ||
| }, | ||
|
|
||
| register: function() { | ||
| Cm.QueryInterface(Ci.nsIComponentRegistrar).registerFactory( | ||
| this.classID, this.description, | ||
| "@mozilla.org/network/protocol/about;1?what=" + this.aboutHost, this); | ||
| }, | ||
|
|
||
| unregister: function() { | ||
| Cm.QueryInterface(Ci.nsIComponentRegistrar).unregisterFactory( | ||
| this.classID, this); | ||
| } | ||
| }; | ||
|
|
||
| /* exported AboutLoop */ | ||
| var AboutLoop = {}; | ||
|
|
||
| // Note that about:loopconversation and about:looppanel are used in some | ||
| // checks in mozilla-central (eg getUserMedia-related), so if we want to | ||
| // make changes to the URL names themselves, we'll need to change them | ||
| // there too... | ||
| XPCOMUtils.defineLazyGetter(AboutLoop, "conversation", () => { | ||
| return new AboutPage("chrome://loop/content/panels/sidebar.html", | ||
| "loopconversation", | ||
| "E79DB45D-2D6D-48BE-B179-6A16C95E97BA", | ||
| "About Loop Conversation", | ||
| Ci.nsIAboutModule.ALLOW_SCRIPT | | ||
| Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT | | ||
| Ci.nsIAboutModule.MAKE_UNLINKABLE | | ||
| Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT | | ||
| Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD); | ||
| }); | ||
|
|
||
| XPCOMUtils.defineLazyGetter(AboutLoop, "panel", () => { | ||
| return new AboutPage("chrome://loop/content/panels/panel.html", | ||
| "looppanel", | ||
| "A5DE152B-DE58-42BC-A68C-33E00B17EC2C", | ||
| "About Loop Panel", | ||
| Ci.nsIAboutModule.ALLOW_SCRIPT | | ||
| Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT | | ||
| Ci.nsIAboutModule.MAKE_UNLINKABLE | | ||
| Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT); | ||
| }); | ||
|
|
||
| XPCOMUtils.defineLazyGetter(AboutLoop, "toc", () => { | ||
| return new AboutPage("chrome://loop/content/panels/toc.html", | ||
| "looptoc", | ||
| "A1220CE0-E5D1-45B6-BEBA-3706166A2AA4", | ||
| "About Loop ToC", | ||
| Ci.nsIAboutModule.ALLOW_SCRIPT | | ||
| Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT | | ||
| Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT | | ||
| Ci.nsIAboutModule.MAKE_UNLINKABLE); // XXX akita-sidebar load in child? | ||
| }); | ||
|
|
||
| this.EXPORTED_SYMBOLS = ["AboutLoop"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sidebar is already URI_MUST_LOAD_IN_CHILD. I think this probably doesn't apply, however, lets change the
XXXtoXXX akitaand verify it before too much longer.Actually I think having the must load in child forces it into a remote browser, but specifying the browser element remote by default optimises the process.
So just update the
XXXfor now please.