38 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
40 const Cc = Components.classes;
41 const Ci = Components.interfaces;
44 this._tabBrowser = aTabBrowser;
51 onLocationChange:
function SBTabProgressListener_onLocationChange(aWebProgress, aRequest, aLocation) {
55 const nsIScrollable =
Ci.nsIScrollable;
56 var scrollable = this._tabBrowser
59 .QueryInterface(nsIScrollable);
60 scrollable.setDefaultScrollbarPreferences(nsIScrollable.ScrollOrientation_Y,
61 nsIScrollable.Scrollbar_Auto);
62 scrollable.setDefaultScrollbarPreferences(nsIScrollable.ScrollOrientation_X,
63 nsIScrollable.Scrollbar_Auto);
65 if (this._tabBrowser.selectedBrowser.webNavigation.sessionHistory) {
78 Components.classes[
"@mozilla.org/network/io-service;1"]
79 .getService(Components.interfaces.nsIIOService);
81 aLocation = ioService.newURI(
"about:blank",
null,
null);
85 this._tabBrowser.selectedTab.outerPlaylistShowing);
87 var mediaTab = this._tabBrowser.mediaTab;
89 mediaTab && this._tabBrowser.selectedTab == mediaTab);
92 this._tabBrowser.notifyTabContentChange();
104 if (this._tabBrowser.selectedTab == mediaTab &&
105 !
this._tabBrowser.currentMediaListView &&
106 (!node || node.searchtype.indexOf(
"internal") > -1) &&
107 (!node || node.searchtype.indexOf(
"external") == -1))
109 document.getElementById(
"nav-bar").setAttribute(
"collapsed",
"true");
111 document.getElementById(
"nav-bar").removeAttribute(
"collapsed");
115 if (this._tabBrowser.selectedTab == mediaTab &&
116 this._tabBrowser.currentMediaListView)
118 document.getElementById(
"mediapages-container")
119 .removeAttribute(
"collapsed");
121 document.getElementById(
"mediapages-container")
122 .setAttribute(
"collapsed",
"true");
129 var historyButtons = document.getElementById(
"back-forward-buttons");
130 if (className.indexOf(
"history") > -1) {
131 historyButtons.setAttribute(
"isCollapse",
"false");
133 historyButtons.removeAttribute(
"isCollapse");
137 var searchBox = document.getElementById(
"searchbar-container");
138 if (className.indexOf(
"nosearchbox") > -1) {
139 searchBox.setAttribute(
"isCollapse",
"true");
141 searchBox.removeAttribute(
"isCollapse");
145 var stopreloadButton = document.getElementById(
"stopreload-container");
146 if (className.indexOf(
"stopreload") > -1) {
147 stopreloadButton.setAttribute(
"isCollapse",
"false");
149 stopreloadButton.removeAttribute(
"isCollapse");
155 Components.utils.reportError(
"SBTabProgressListener::onLocationChange\n\n" + err );
159 onStateChange:
function SBTabProgressListener_onStateChange(aWebProgress, aRequest,
aState, aStatus) {
160 const nsIWebProgressListener =
161 Ci.nsIWebProgressListener;
164 if (aWebProgress.DOMWindow != aWebProgress.DOMWindow.parent ||
165 !(
aState & nsIWebProgressListener.STATE_IS_WINDOW)) {
169 if (
aState & nsIWebProgressListener.STATE_START) {
171 this._tabBrowser.loading =
true;
173 else if (
aState & nsIWebProgressListener.STATE_STOP) {
175 this._tabBrowser.loading =
false;
182 const NS_ERROR_PARSED_DATA_CACHED = 0x805D0021;
183 if (Components.isSuccessCode(aStatus) ||
184 aStatus == NS_ERROR_PARSED_DATA_CACHED)
186 this._tabBrowser.notifyTabContentChange();
190 if (
"_sessionStore" in this._tabBrowser) {
191 if (this._tabBrowser._sessionStore.tabStateRestored) {
192 this._tabBrowser._sessionStore.saveTabState(this._tabBrowser);
200 onProgressChange:
function() { },
201 onStatusChange:
function() { },
202 onSecurityChange:
function() { },
sbOSDControlService prototype className
sbOSDControlService prototype QueryInterface
function SBTabProgressListener(aTabBrowser)
function SBDataSetBoolValue(aKey, aBoolValue)
Set a boolean value. Changes the value of the data remote to the boolean passed in, regardless of its value before.
ContinuingWebProgressListener prototype onStateChange
function SBDataSetStringValue(aKey, aStringValue)
Set a string value. Changes the value of the data remote to the boolean passed in, regardless of its value before.