mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1190301 - Remove mute button functionality from tab audio indicator. r=mcomella
--HG-- extra : commitid : SPbzRYsOKr extra : rebase_source : 1db874dd992771834e7a8187aced886f6ed3bd6a
This commit is contained in:
parent
3e119ea097
commit
93e48eadec
@ -108,23 +108,6 @@ public class TabStripItemView extends ThemedLinearLayout
|
||||
});
|
||||
|
||||
audioPlayingView = (ThemedImageButton) findViewById(R.id.audio_playing);
|
||||
audioPlayingView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (id < 0) {
|
||||
throw new IllegalStateException("Invalid tab id:" + id);
|
||||
}
|
||||
|
||||
// TODO: Toggle icon in the UI as well (bug 1190301)
|
||||
final JSONObject args = new JSONObject();
|
||||
try {
|
||||
args.put("tabId", id);
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Tab:ToggleMuteAudio", args.toString()));
|
||||
} catch (JSONException e) {
|
||||
Log.e(LOGTAG, "Error toggling mute audio: error building json arguments", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -103,24 +103,6 @@ public class TabsLayoutItemView extends LinearLayout
|
||||
mThumbnailWrapper = (TabThumbnailWrapper) findViewById(R.id.wrapper);
|
||||
|
||||
growCloseButtonHitArea();
|
||||
|
||||
mAudioPlayingButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mTabId < 0) {
|
||||
throw new IllegalStateException("Invalid tab id:" + mTabId);
|
||||
}
|
||||
|
||||
// TODO: Toggle icon in the UI as well (bug 1190301)
|
||||
final JSONObject args = new JSONObject();
|
||||
try {
|
||||
args.put("tabId", mTabId);
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Tab:ToggleMuteAudio", args.toString()));
|
||||
} catch (JSONException e) {
|
||||
Log.e(LOGTAG, "Error toggling mute audio: error building json arguments", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void growCloseButtonHitArea() {
|
||||
|
@ -459,7 +459,6 @@ var BrowserApp = {
|
||||
Services.obs.addObserver(this, "Tab:Load", false);
|
||||
Services.obs.addObserver(this, "Tab:Selected", false);
|
||||
Services.obs.addObserver(this, "Tab:Closed", false);
|
||||
Services.obs.addObserver(this, "Tab:ToggleMuteAudio", false);
|
||||
Services.obs.addObserver(this, "Session:Back", false);
|
||||
Services.obs.addObserver(this, "Session:Forward", false);
|
||||
Services.obs.addObserver(this, "Session:Navigate", false);
|
||||
@ -1857,13 +1856,6 @@ var BrowserApp = {
|
||||
break;
|
||||
}
|
||||
|
||||
case "Tab:ToggleMuteAudio": {
|
||||
let data = JSON.parse(aData);
|
||||
let tab = this.getTabForId(data.tabId);
|
||||
tab.toggleMuteAudio();
|
||||
break;
|
||||
}
|
||||
|
||||
case "keyword-search":
|
||||
// This event refers to a search via the URL bar, not a bookmarks
|
||||
// keyword search. Note that this code assumes that the user can only
|
||||
@ -4145,14 +4137,6 @@ Tab.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
toggleMuteAudio: function() {
|
||||
if (this.browser.audioMuted) {
|
||||
this.browser.unmute();
|
||||
} else {
|
||||
this.browser.mute();
|
||||
}
|
||||
},
|
||||
|
||||
handleEvent: function(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "DOMContentLoaded": {
|
||||
|
Loading…
Reference in New Issue
Block a user