Skip to content

Commit

Permalink
Merge fx-team to m-c. a=merge
Browse files Browse the repository at this point in the history
CLOSED TREE
  • Loading branch information
rvandermeulen committed Feb 12, 2015
2 parents 7f41ae0 + 4257ef8 commit a801fa4
Show file tree
Hide file tree
Showing 171 changed files with 6,591 additions and 1,380 deletions.
2 changes: 0 additions & 2 deletions addon-sdk/source/python-lib/cuddlefish/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@
'media.eme.apiVisible': True,
# Don't forceably kill content processes after a timeout
'dom.ipc.tabs.shutdownTimeoutSecs': 0,
# Don't show the search first run UI by default
'browser.search.highlightCount': 0,
'general.useragent.locale': "en-US",
'intl.locale.matchOS': "en-US",
'dom.indexedDB.experimental': True
Expand Down
1 change: 0 additions & 1 deletion addon-sdk/source/test/preferences/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"media.eme.enabled": true,
"media.eme.apiVisible": true,
"dom.ipc.tabs.shutdownTimeoutSecs": 0,
"browser.search.highlightCount": 0,
"general.useragent.locale": "en-US",
"intl.locale.matchOS": "en-US",
"dom.indexedDB.experimental": true
Expand Down
4 changes: 0 additions & 4 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,6 @@ pref("browser.search.showOneOffButtons", true);
// comma seperated list of of engines to hide in the search panel.
pref("browser.search.hiddenOneOffs", "");

// How many times to show the new search highlight
pref("browser.search.highlightCount", 5);

pref("browser.sessionhistory.max_entries", 50);

// handle links targeting new windows
Expand Down Expand Up @@ -1670,7 +1667,6 @@ pref("shumway.swf.whitelist", "http://g-ecx.images-amazon.com/*/AiryBasicRendere
pref("image.mem.max_decoded_image_kb", 256000);

pref("loop.enabled", true);
pref("loop.screenshare.enabled", false);
pref("loop.server", "https://loop.services.mozilla.com/v0");
pref("loop.seenToS", "unseen");
pref("loop.showPartnerLogo", true);
Expand Down
2 changes: 0 additions & 2 deletions browser/base/content/browser-doctype.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#endif
<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
%aboutHomeDTD;
<!ENTITY % searchBarDTD SYSTEM "chrome://browser/locale/searchbar.dtd">
%searchBarDTD;
<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
%syncBrandDTD;
]>
Expand Down
133 changes: 0 additions & 133 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,6 @@ var gBrowserInit = {

SocialUI.init();
TabView.init();
SearchHighlight.init();

// Telemetry for master-password - we do this after 5 seconds as it
// can cause IO if NSS/PSM has not already initialized.
Expand Down Expand Up @@ -3636,138 +3635,6 @@ const BrowserSearch = {
}
};

const SearchHighlight = {
eventsReady: false,
// The pref that controls how many times to show the highlight.
countPref: "browser.search.highlightCount",
// The current highlight to show.
currentPos: 0,
// Tracks if the popup closed very recently.
hideTimer: null,

// The list of highlights and the items in the panel to anchor them to.
highlights: [{
id: "SearchHighlight1",
anchor: "search-panel-one-offs"
}, {
id: "SearchHighlight2",
anchor: "searchbar-engine",
}],

init: function() {
this.panel = document.getElementById("PopupSearchAutoComplete");
this.panel.addEventListener("popupshowing", this.searchPanelShown.bind(this), false);
},

initEvents: function() {
if (this.eventsReady) {
return;
}

this.panel.addEventListener("popuphidden", this.searchPanelHidden.bind(this), false);

for (let highlight of this.highlights) {
highlight.panel = document.getElementById(highlight.id);
highlight.panel.addEventListener("popupshowing", this.disablePanelHiding.bind(this), false);
highlight.panel.addEventListener("popuphiding", this.enablePanelHiding.bind(this), false);

highlight.panel.querySelector("button").addEventListener("command", this.highlightButtonClicked.bind(this), false);
}

this.eventsReady = true;
},

get highlightPanel() {
return this.highlights[this.currentPos].panel;
},

showHighlight: function() {
// Check that all the events are setup.
this.initEvents();

// If a highlight is already showing then do nothing.
if (this.highlightPanel.state != "closed") {
return;
}

// Show the first highlight.
this.currentPos = 0;
this.showCurrentHighlight();
},

showCurrentHighlight: function() {
let highlight = this.highlights[this.currentPos];
let anchor = document.getAnonymousElementByAttribute(this.panel, "anonid", highlight.anchor);
highlight.panel.hidden = false;
highlight.panel.openPopup(anchor, "leftcenter topright");
},

searchPanelShown: function() {
let placement = CustomizableUI.getPlacementOfWidget("search-container");
if (placement.area == CustomizableUI.AREA_PANEL) {
// Opening a panel anchored to a panel anchored to a panel anchored to the
// window doesn't work very well
return;
}

if (!BrowserSearch.searchBar.value) {
// Don't show the panels when there is no text in the search box
return;
}

// If the panel was only very recently closed re-show the last highlight.
if (this.hideTimer) {
clearTimeout(this.hideTimer);
this.hideTimer = null;
this.showCurrentHighlight();
return;
}

// If the highlight has already been show the appropriate number of times
// do nothing.
let count = Services.prefs.getIntPref(this.countPref);
if (count <= 0)
return;

this.showHighlight();
Services.prefs.setIntPref(this.countPref, count - 1);
},

searchPanelHidden: function() {
if (this.highlightPanel.state == "closed") {
return;
}

this.highlightPanel.hidePopup();

// Set a flag when the panel was closed in the last short time.
this.hideTimer = setTimeout(() => {
this.hideTimer = null;
}, 500);
},

highlightButtonClicked: function() {
// When the button is clicked close the current highlight and open the next
// one.
this.highlightPanel.hidePopup();
this.currentPos++;
if (this.currentPos < this.highlights.length) {
this.showCurrentHighlight();
} else {
Services.prefs.setIntPref(this.countPref, 0);
this.currentPos = 0;
}
},

disablePanelHiding: function() {
this.panel.setAttribute("noautohide", "true");
},

enablePanelHiding: function() {
this.panel.setAttribute("noautohide", "false");
},
};

function FillHistoryMenu(aParent) {
// Lazily add the hover listeners on first showing and never remove them
if (!aParent.hasStatusListener) {
Expand Down
35 changes: 0 additions & 35 deletions browser/base/content/browser.xul
Original file line number Diff line number Diff line change
Expand Up @@ -245,41 +245,6 @@
mousethrough="always">
<box id="UITourHighlight"></box>
</panel>
<!-- Used to highlight the new search experience -->
<panel id="SearchHighlight1"
class="SearchHighlight"
type="arrow"
hidden="true"
noautofocus="true"
noautohide="true"
orient="vertical"
align="stretch">
<label class="SearchHighlightTitle">&SearchHighlight1.title;</label>
<description class="SearchHighlightText" flex="1">&SearchHighlight1.text;</description>
<hbox class="SearchHighlightFooter" align="center">
<spacer class="dot filled"/>
<spacer class="dot"/>
<spacer flex="1"/>
<button label="&SearchHighlightNext;"/>
</hbox>
</panel>
<panel id="SearchHighlight2"
class="SearchHighlight"
type="arrow"
hidden="true"
noautofocus="true"
noautohide="true"
orient="vertical"
align="stretch">
<label class="SearchHighlightTitle">&SearchHighlight2.title;</label>
<description class="SearchHighlightText" flex="1">&SearchHighlight2.text;</description>
<hbox class="SearchHighlightFooter" align="center">
<spacer class="dot"/>
<spacer class="dot filled"/>
<spacer flex="1"/>
<button label="&SearchHighlightClose;"/>
</hbox>
</panel>

<panel id="abouthome-search-panel" orient="vertical" type="arrow" hidden="true"
onclick="this.hidePopup()">
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/sanitize.xul
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
dlgbuttons="accept,cancel"
title="&sanitizeDialog2.title;"
noneverythingtitle="&sanitizeDialog2.title;"
style="width: &dialog.width2;;"
style="width: &sanitizeDialog2.width;;"
ondialogaccept="return gSanitizePromptDialog.sanitize();">

<prefpane id="SanitizeDialogPane" onpaneload="gSanitizePromptDialog.init();">
Expand Down
27 changes: 23 additions & 4 deletions browser/base/content/socialchat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
<xul:image class="chat-status-icon" xbl:inherits="src=image"/>
<xul:label class="chat-title" flex="1" xbl:inherits="value=label" crop="center"/>
</xul:hbox>
<xul:toolbarbutton anonid="webRTC-shareScreen-icon"
class="notification-anchor-icon chat-toolbarbutton"
oncommand="document.getBindingParent(this).showNotifications(this); event.stopPropagation();"/>
<xul:toolbarbutton anonid="webRTC-sharingScreen-icon"
class="notification-anchor-icon chat-toolbarbutton"
oncommand="document.getBindingParent(this).showNotifications(this); event.stopPropagation();"/>
<xul:toolbarbutton anonid="notification-icon" class="notification-anchor-icon chat-toolbarbutton"
oncommand="document.getBindingParent(this).showNotifications(); event.stopPropagation();"/>
oncommand="document.getBindingParent(this).showNotifications(this); event.stopPropagation();"/>
<xul:toolbarbutton anonid="minimize" class="chat-minimize-button chat-toolbarbutton"
oncommand="document.getBindingParent(this).toggle();"/>
<xul:toolbarbutton anonid="swap" class="chat-swap-button chat-toolbarbutton"
Expand All @@ -30,8 +36,20 @@

<implementation implements="nsIDOMEventListener">
<constructor><![CDATA[
this.content.__defineGetter__("popupnotificationanchor",
() => document.getAnonymousElementByAttribute(this, "anonid", "notification-icon"));
const kAnchorMap = new Map([
["", "notification-"],
["webRTC-shareScreen-", ""],
["webRTC-sharingScreen-", ""]
]);
for (let [getterPrefix, idPrefix] of kAnchorMap) {
let getter = getterPrefix + "popupnotificationanchor";
let anonid = (idPrefix || getterPrefix) + "icon";
this.content.__defineGetter__(getter, () => {
delete this.content[getter];
return this.content[getter] = document.getAnonymousElementByAttribute(
this, "anonid", anonid);
});
}
if (!this.chatbar) {
document.getAnonymousElementByAttribute(this, "anonid", "minimize").hidden = true;
Expand Down Expand Up @@ -136,8 +154,9 @@
</property>

<method name="showNotifications">
<parameter name="aAnchor"/>
<body><![CDATA[
PopupNotifications._reshowNotifications(this.content.popupnotificationanchor,
PopupNotifications._reshowNotifications(aAnchor,
this.content);
]]></body>
</method>
Expand Down
2 changes: 0 additions & 2 deletions browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,6 @@ skip-if = buildapp == 'mulet' || e10s # e10s: Bug 933103 - mochitest's EventUtil
skip-if = buildapp == 'mulet' || e10s # Bug 1100698 - test uses synthesizeMouse and then does a load of other stuff that breaks in e10s
[browser_save_video_frame.js]
[browser_scope.js]
[browser_searchHighlight.js]
skip-if = true
[browser_searchSuggestionUI.js]
skip-if = e10s
support-files =
Expand Down
Loading

0 comments on commit a801fa4

Please sign in to comment.