Index: chrome/browser/resources/file_manager/slideshow.html |
=================================================================== |
--- chrome/browser/resources/file_manager/slideshow.html (revision 82536) |
+++ chrome/browser/resources/file_manager/slideshow.html (working copy) |
@@ -45,7 +45,7 @@ |
} |
#prevbutton > div { |
- background: url('shared/images/mediaplayer_prev.png'); |
+ background: url('chrome://resources/images/mediaplayer_prev.png'); |
background-repeat: no-repeat; |
background-position: 4px 8px; |
width: 100%; |
@@ -75,7 +75,7 @@ |
} |
#nextbutton > div { |
- background: url('shared/images/mediaplayer_next.png'); |
+ background: url('chrome://resources/images/mediaplayer_next.png'); |
background-repeat: no-repeat; |
background-position: 4px 8px; |
width: 100%; |
@@ -99,8 +99,8 @@ |
} |
</style> |
-<script src="shared/js/local_strings.js"></script> |
-<script src="shared/js/media_common.js"></script> |
+<script src="chrome://resources/js/local_strings.js"></script> |
+<script src="chrome://resources/js/media_common.js"></script> |
<script> |
document.addEventListener('DOMContentLoaded', load); |
@@ -119,7 +119,7 @@ |
var currentPicture = null; |
var prevPicture = null; |
var currentFileOffset = 0; |
-var filelist; |
+var filelist = []; |
var moveRight = false; |
var lastimg = null; |
@@ -146,7 +146,7 @@ |
}, 10); |
} |
-function transitionTo(path, fromTheRight) { |
+function transitionTo(filePath, fromTheRight) { |
if (currentPicture) { |
if (prevPicture) { |
$('main').removeChild(prevPicture); |
@@ -166,20 +166,16 @@ |
lastimg = image; |
image.onload = loadedPicture; |
image.onerror = loadedPicture; |
- document.location.hash = path; |
- image.src = 'file://' + path; |
+ image.src = filePath; |
currentPicture.appendChild(image); |
moveRight = fromTheRight; |
} |
-function browseFileResult(info, results) { |
- filelist = results; |
- if (info.currentOffset) { |
- currentFileOffset = info.currentOffset; |
- } else { |
- currentFileOffset = 0; |
+function browseFileResult() { |
+ currentFileOffset = 0; |
+ if (filelist.length > 0) { |
+ transitionTo(filelist[currentFileOffset], true); |
} |
- transitionTo(filelist[currentFileOffset].path, true); |
} |
function keyPressed(e) { |
@@ -187,14 +183,14 @@ |
if (e.keyCode == 37) { |
if (currentFileOffset > 0) { |
currentFileOffset--; |
- transitionTo(filelist[currentFileOffset].path, false); |
+ transitionTo(filelist[currentFileOffset], false); |
} |
} |
// Right Pressed |
if (e.keyCode == 39) { |
if (currentFileOffset < (filelist.length - 1)) { |
currentFileOffset++; |
- transitionTo(filelist[currentFileOffset].path, true); |
+ transitionTo(filelist[currentFileOffset], true); |
} |
} |
} |
@@ -202,34 +198,33 @@ |
function load() { |
localStrings = new LocalStrings(); |
- document.onkeydown = keyPressed; |
- if (document.location.href.indexOf('#') != -1) { |
- var currentpathArray = document.location.href.split('#'); |
- var path = currentpathArray[1]; |
- chrome.send('getChildren', [path]); |
+ var views = chrome.extension.getViews(); |
+ for (var i = 0; i < views.length; i++) { |
+ if (views[i].g_slideshow_data) { |
+ filelist = views[i].g_slideshow_data; |
+ views[i].g_slideshow_data = null; |
+ } |
} |
+ |
+ browseFileResult(); |
} |
function prevButtonClick() { |
if (currentFileOffset > 0) { |
currentFileOffset--; |
- transitionTo(filelist[currentFileOffset].path, false); |
+ transitionTo(filelist[currentFileOffset], false); |
} |
} |
function nextButtonClick() { |
if (currentFileOffset < (filelist.length - 1)) { |
currentFileOffset++; |
- transitionTo(filelist[currentFileOffset].path, true); |
+ transitionTo(filelist[currentFileOffset], true); |
} |
} |
-function toggleFullscreen() { |
- chrome.send('toggleFullscreen', ['']); |
-} |
- |
</script> |
-<body> |
+<body onkeydown="keyPressed(event)"> |
<div id="main"></div> |
<div id="glow"></div> |
<div id="playercontrols"> |