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

Unified Diff: chrome/browser/resources/file_manager/slideshow.html

Issue 6873100: Moving slideshow to the filebrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/file_manager/manifest.json ('k') | chrome/browser/resources/shared_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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">
« no previous file with comments | « chrome/browser/resources/file_manager/manifest.json ('k') | chrome/browser/resources/shared_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698