forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add directions to the old media-internals UI
If the experiment to disable chrome://media-internals is enabled, then we need to tell users what is up, and how to access the new version. Of course this is dependent on the new UI getting checked in. Bug: 794255 Change-Id: I84f71e6034c53be97a943d4c3cbc3dc2c0a9aca6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767423 Commit-Queue: Ted Meyer <tmathmeyer@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Frank Liberato <liberato@chromium.org> Cr-Commit-Position: refs/heads/master@{#703988}
- Loading branch information
1 parent
cbb97c5
commit 754bb0b
Showing
4 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
64 changes: 64 additions & 0 deletions
64
content/browser/resources/media/manager_experiment_disabler.js
This file contains 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,64 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* @fileoverview Keeps track of all the existing PlayerInfo and | ||
* audio stream objects and is the entry-point for messages from the backend. | ||
* | ||
* The events captured by Manager (add, remove, update) are relayed | ||
* to the clientRenderer which it can choose to use to modify the UI. | ||
*/ | ||
var Manager = (function() { | ||
'use strict'; | ||
|
||
function createChild(parent, tag) { | ||
const node = document.createElement(tag); | ||
parent.appendChild(node); | ||
node.createTextNode = function(text) { | ||
const textNode = document.createTextNode(text); | ||
node.appendChild(textNode); | ||
}; | ||
return node; | ||
} | ||
|
||
function CreateNotice() { | ||
const newContents = document.createElement('div'); | ||
createChild(newContents, 'h1') | ||
.createTextNode('Media Internals Is being moved to devtools!'); | ||
createChild(newContents, 'h3').createTextNode('Here\'s how to use it:'); | ||
|
||
const directions = createChild(newContents, 'ol'); | ||
|
||
const devtoolsExperiments = createChild(directions, 'li'); | ||
devtoolsExperiments.createTextNode( | ||
'Ensure Devtools Experiments is enabled. '); | ||
|
||
const experimentsLink = createChild(devtoolsExperiments, 'a'); | ||
experimentsLink.href = 'chrome://flags/#enable-devtools-experiments'; | ||
experimentsLink.createTextNode('Enable Flag Here'); | ||
|
||
createChild(directions, 'li') | ||
.createTextNode('In devtools (F11) press F1 (open settings).'); | ||
createChild(directions, 'li') | ||
.createTextNode( | ||
'Select the "Experiments" tab on the side,' + | ||
' and check the "Media Element Inspection" box'); | ||
createChild(directions, 'li') | ||
.createTextNode( | ||
'Restart devtools, and find "Media" under the "More Tools" menu.'); | ||
return newContents; | ||
} | ||
|
||
function Manager(clientRenderer) { | ||
this.clientRenderer_ = clientRenderer; | ||
// Remove contents and add message. | ||
this.media_tab_ = $('players'); | ||
this.media_tab_.innerHTML = ''; | ||
this.media_tab_.appendChild(CreateNotice()); | ||
} | ||
|
||
Manager.prototype = {}; | ||
|
||
return Manager; | ||
}()); |
17 changes: 17 additions & 0 deletions
17
content/browser/resources/media/media_internals_disabled.js
This file contains 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,17 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
var media = {}; | ||
|
||
// <include src="main.js"> | ||
// <include src="util.js"> | ||
// <include src="player_info.js"> | ||
// <include src="manager.js"> | ||
// <include src="manager_experiment_disabler.js"> | ||
// <include src="client_renderer.js"> | ||
|
||
media.initialize(new Manager(new ClientRenderer())); | ||
if (cr.ui) { | ||
cr.ui.decorate('tabbox', cr.ui.TabBox); | ||
} |
This file contains 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