Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: chrome/browser/resources/file_manager/js/audio_player.js

Issue 9570011: Disabling right-click menu in Chrome OS Photo Editor and Media Player (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/image_editor/gallery.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 document.addEventListener('DOMContentLoaded', function() { 5 document.addEventListener('DOMContentLoaded', function() {
6 // Test harness sets the search string to prevent the automatic load. 6 // Test harness sets the search string to prevent the automatic load.
7 // It calls AudioPlayer.load() explicitly after initializing 7 // It calls AudioPlayer.load() explicitly after initializing
8 // the |chrome| variable with an appropriate mock object. 8 // the |chrome| variable with an appropriate mock object.
9 if (!document.location.search) { 9 if (!document.location.search) {
10 AudioPlayer.load(); 10 AudioPlayer.load();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 'click', this.onExpandCollapse_.bind(this)); 44 'click', this.onExpandCollapse_.bind(this));
45 45
46 this.audioControls_ = new AudioControls( 46 this.audioControls_ = new AudioControls(
47 createChild(), this.advance_.bind(this)); 47 createChild(), this.advance_.bind(this));
48 48
49 this.audioControls_.attachMedia(createChild('', 'audio')); 49 this.audioControls_.attachMedia(createChild('', 'audio'));
50 } 50 }
51 51
52 AudioPlayer.load = function() { 52 AudioPlayer.load = function() {
53 document.ondragstart = function(e) { e.preventDefault() }; 53 document.ondragstart = function(e) { e.preventDefault() };
54 document.oncontextmenu = function(e) { e.preventDefault(); };
54 55
55 var player = new AudioPlayer(document.querySelector('.audio-player')); 56 var player = new AudioPlayer(document.querySelector('.audio-player'));
56 function getPlaylist() { 57 function getPlaylist() {
57 chrome.mediaPlayerPrivate.getPlaylist(player.load.bind(player)); 58 chrome.mediaPlayerPrivate.getPlaylist(player.load.bind(player));
58 } 59 }
59 getPlaylist(); 60 getPlaylist();
60 chrome.mediaPlayerPrivate.onPlaylistChanged.addListener(getPlaylist); 61 chrome.mediaPlayerPrivate.onPlaylistChanged.addListener(getPlaylist);
61 }; 62 };
62 63
63 AudioPlayer.prototype.load = function(playlist) { 64 AudioPlayer.prototype.load = function(playlist) {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 }; 264 };
264 265
265 AudioPlayer.TrackInfo.prototype.setMetadata = function(metadata) { 266 AudioPlayer.TrackInfo.prototype.setMetadata = function(metadata) {
266 if (metadata.thumbnailURL) { 267 if (metadata.thumbnailURL) {
267 this.art_.classList.remove('blank'); 268 this.art_.classList.remove('blank');
268 this.img_.src = metadata.thumbnailURL; 269 this.img_.src = metadata.thumbnailURL;
269 } 270 }
270 this.title_.textContent = metadata.title || this.getDefaultTitle(); 271 this.title_.textContent = metadata.title || this.getDefaultTitle();
271 this.artist_.textContent = metadata.artist || this.getDefaultArtist(); 272 this.artist_.textContent = metadata.artist || this.getDefaultArtist();
272 }; 273 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/image_editor/gallery.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698