Commit e19976d6 authored by dgozman@chromium.org's avatar dgozman@chromium.org

[filebrowser] Add left panel with roots.

Not the final UI yet.
Additional improvements:
- file name is selected in save-as dialog at start;
- new folder moved to context menu, button deleted.

BUG=chromium-os:20168,chromium-os:22106,chromium-os:22105,chromium-os:22032,chromium-os:20547,chromium-os:20549
TEST=Manual

Review URL: http://codereview.chromium.org/8554003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113152 0039d316-1c4b-4281-b951-d872f2087c98
parent aea57e65
...@@ -9704,9 +9704,6 @@ Some features may be unavailable. Please check that the profile exists and you ...@@ -9704,9 +9704,6 @@ Some features may be unavailable. Please check that the profile exists and you
<message name="IDS_FILE_BROWSER_ROOT_DIRECTORY_LABEL" desc="Root directory label."> <message name="IDS_FILE_BROWSER_ROOT_DIRECTORY_LABEL" desc="Root directory label.">
Files Files
</message> </message>
<message name="IDS_FILE_BROWSER_DOWNLOADS_DIRECTORY_LABEL" desc="/Downloads directory label.">
File Shelf
</message>
<message name="IDS_FILE_BROWSER_ARCHIVE_DIRECTORY_LABEL" desc="/archive directory label."> <message name="IDS_FILE_BROWSER_ARCHIVE_DIRECTORY_LABEL" desc="/archive directory label.">
Archives Archives
</message> </message>
......
...@@ -1523,9 +1523,9 @@ bool FileDialogStringsFunction::RunImpl() { ...@@ -1523,9 +1523,9 @@ bool FileDialogStringsFunction::RunImpl() {
SET_STRING(IDS, WEB_FONT_SIZE); SET_STRING(IDS, WEB_FONT_SIZE);
SET_STRING(IDS_FILE_BROWSER, ROOT_DIRECTORY_LABEL); SET_STRING(IDS_FILE_BROWSER, ROOT_DIRECTORY_LABEL);
SET_STRING(IDS_FILE_BROWSER, DOWNLOADS_DIRECTORY_LABEL);
SET_STRING(IDS_FILE_BROWSER, ARCHIVE_DIRECTORY_LABEL); SET_STRING(IDS_FILE_BROWSER, ARCHIVE_DIRECTORY_LABEL);
SET_STRING(IDS_FILE_BROWSER, REMOVABLE_DIRECTORY_LABEL); SET_STRING(IDS_FILE_BROWSER, REMOVABLE_DIRECTORY_LABEL);
SET_STRING(IDS_FILE_BROWSER, CHROMEBOOK_DIRECTORY_LABEL);
SET_STRING(IDS_FILE_BROWSER, NAME_COLUMN_LABEL); SET_STRING(IDS_FILE_BROWSER, NAME_COLUMN_LABEL);
SET_STRING(IDS_FILE_BROWSER, SIZE_COLUMN_LABEL); SET_STRING(IDS_FILE_BROWSER, SIZE_COLUMN_LABEL);
SET_STRING(IDS_FILE_BROWSER, TYPE_COLUMN_LABEL); SET_STRING(IDS_FILE_BROWSER, TYPE_COLUMN_LABEL);
......
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
<include name="IDR_FILE_MANAGER_MEDIA_ENQUEUE_ICON" file="file_manager/images/icon_add_to_queue_16x16.png" type="BINDATA" /> <include name="IDR_FILE_MANAGER_MEDIA_ENQUEUE_ICON" file="file_manager/images/icon_add_to_queue_16x16.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_ARCHIVE_MOUNT_ICON" file="file_manager/images/icon_mount_archive_16x16.png" type="BINDATA" /> <include name="IDR_FILE_MANAGER_ARCHIVE_MOUNT_ICON" file="file_manager/images/icon_mount_archive_16x16.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_ARCHIVE_UNMOUNT_ICON" file="file_manager/images/icon_unmount_archive_16x16.png" type="BINDATA" /> <include name="IDR_FILE_MANAGER_ARCHIVE_UNMOUNT_ICON" file="file_manager/images/icon_unmount_archive_16x16.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_OPEN_SIDEBAR_ICON" file="file_manager/images/open_sidebar.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_CLOSE_SIDEBAR_ICON" file="file_manager/images/close_sidebar.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_EJECT_ICON" file="file_manager/images/eject.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_ADD_DRIVE_ICON" file="file_manager/images/add_drive.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_CHROMEBOOK_24_ICON" file="file_manager/images/chromebook_24x24.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_CHROMEBOOK_28_ICON" file="file_manager/images/chromebook_28x28.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_IMG_FILETYPE_AUDIO" file="file_manager/images/filetype_audio.png" type="BINDATA" /> <include name="IDR_FILE_MANAGER_IMG_FILETYPE_AUDIO" file="file_manager/images/filetype_audio.png" type="BINDATA" />
<include name="IDR_FILE_MANAGER_IMG_FILETYPE_DEVICE" file="file_manager/images/filetype_device.png" type="BINDATA" /> <include name="IDR_FILE_MANAGER_IMG_FILETYPE_DEVICE" file="file_manager/images/filetype_device.png" type="BINDATA" />
......
...@@ -100,25 +100,176 @@ input[type='submit'][disabled]:hover { ...@@ -100,25 +100,176 @@ input[type='submit'][disabled]:hover {
padding-bottom: 8px; padding-bottom: 8px;
} }
/* Main part of the dialog between header and footer. */
.dialog-container {
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: stretch;
overflow: hidden;
-webkit-box-flex: 1;
}
/* List/grid and preview are inside this container. */
.dialog-main {
-webkit-box-flex: 1;
display:-webkit-box;
-webkit-box-orient: vertical;
-webkit-box-align: stretch;
}
/* Roots list at the left. */
.dialog-sidebar {
position: relative;
-webkit-box-flex: 0;
width: 200px;
margin-left: -200px;
background-color: rgba(240, 240, 240, 1);
margin-bottom: 15px;
margin-top: 15px;
-webkit-border-top-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-transition: margin-left 180ms ease;
overflow: hidden;
}
.dialog-container[sidebar] .dialog-sidebar {
margin-left: 15px;
}
/* Roots list at the left. */
list.roots-list {
width: 100%;
}
list.roots-list > * {
border: none;
border-radius: 0;
line-height: 35px;
margin: 0;
padding: 0 5px;
background-color: rgba(240,240,240,1);
}
list.roots-list > [lead],
list.roots-list > [selected],
list.roots-list > [anchor] {
background-color: hsl(214,91%,89%);
}
list.roots-list > [lead]:hover,
list.roots-list > [selected]:hover,
list.roots-list > [anchor]:hover {
background-color: hsl(214,91%,87%);
}
list.roots-list li.root-item {
display: -webkit-box;
-webkit-box-align: center;
-webkit-box-pack: start;
}
li.root-item > * {
display: block;
margin-right: 5px;
}
li.root-item > .text {
max-width: 130px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
li.root-item > .spacer {
-webkit-box-flex: 1;
}
img.root-eject {
opacity: 0.5;
cursor: pointer;
width: 15px;
height: 12px;
}
img.root-eject:hover {
opacity: 1;
}
/* Breadcrumbs and things under the title but above the list view. */ /* Breadcrumbs and things under the title but above the list view. */
.dialog-header { .dialog-header {
-webkit-box-orient: horizontal; -webkit-box-orient: horizontal;
-webkit-box-align: center; -webkit-box-align: center;
display: -webkit-box; display: -webkit-box;
margin: 15px; margin-top: 15px;
margin-right: 15px;
margin-bottom: 4px; margin-bottom: 4px;
} margin-left: 15px;
-webkit-transition: all 180ms ease;
}
/* Container for the detail and thumbnail (not implemented yet) list views. */ /* Container for the detail and thumbnail (not implemented yet) list views. */
.dialog-container[sidebar] .dialog-header {
margin-left: 0;
}
/* Close sidebar button. */
div.close-sidebar {
cursor: pointer;
position: absolute;
right: 0;
top: 2px;
display: none;
z-index: 10;
background-color: white;
border: 1px solid rgba(200,200,200,1);
width: 13px;
height: 24px;
}
div.close-sidebar:hover {
background-color: rgba(240,240,240,1);
}
/* Open sidebar button. */
div.open-sidebar {
cursor: pointer;
margin-right: 10px;
background-color: white;
width: 13px;
height: 24px;
}
div.open-sidebar:hover {
background-color: rgba(240,240,240,1);
}
.dialog-container[sidebar] div.open-sidebar {
display: none;;
}
.dialog-container[sidebar] div.close-sidebar {
display: block;
}
/* Container for the detail and thumbnail list views. */
.dialog-body { .dialog-body {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-box-flex: 1; -webkit-box-flex: 1;
border: 1px #aaa solid; border: 1px #aaa solid;
border-radius: 4px; border-radius: 4px;
display: -webkit-box; display: -webkit-box;
margin: 15px; margin-right: 15px;
margin-top: 0; margin-bottom: 15px;
margin-left: 15px;
overflow: hidden; overflow: hidden;
-webkit-transition: all 180ms ease;
}
.dialog-container[sidebar] .dialog-body {
-webkit-border-top-left-radius: 0;
-webkit-border-bottom-left-radius: 0;
margin-left: 0;
} }
/* Container for the ok/cancel buttons. */ /* Container for the ok/cancel buttons. */
...@@ -134,6 +285,7 @@ input[type='submit'][disabled]:hover { ...@@ -134,6 +285,7 @@ input[type='submit'][disabled]:hover {
-webkit-box-orient: horizontal; -webkit-box-orient: horizontal;
-webkit-box-flex: 1; -webkit-box-flex: 1;
display: -webkit-box; display: -webkit-box;
-webkit-box-align: center;
font-size: 15px; font-size: 15px;
line-height: 15px; line-height: 15px;
height: 18px; height: 18px;
...@@ -142,6 +294,20 @@ input[type='submit'][disabled]:hover { ...@@ -142,6 +294,20 @@ input[type='submit'][disabled]:hover {
white-space: nowrap; white-space: nowrap;
} }
.dialog-container[sidebar] .breadcrumbs {
margin-left: 10px;
}
/* Icon at the start of breadcrumb path. Corresponds to the root selected. */
.breadcrumb-icon {
margin-right: 5px;
display: block;
}
.dialog-container[sidebar] .breadcrumb-icon {
display: none;
}
/* A single directory name in the list of path breadcrumbs. */ /* A single directory name in the list of path breadcrumbs. */
.breadcrumb-path { .breadcrumb-path {
color: #265692; color: #265692;
...@@ -210,10 +376,7 @@ button.thumbnail-view > img { ...@@ -210,10 +376,7 @@ button.thumbnail-view > img {
/* The cr.ui.Grid representing the detailed file list. */ /* The cr.ui.Grid representing the detailed file list. */
.thumbnail-grid { .thumbnail-grid {
position: absolute; width: 100%;
top: 0;
left: 0;
border: 0;
overflow-y: scroll; overflow-y: scroll;
} }
...@@ -268,9 +431,7 @@ div.img-container > img { ...@@ -268,9 +431,7 @@ div.img-container > img {
/* The cr.ui.Table representing the detailed file list. */ /* The cr.ui.Table representing the detailed file list. */
.detail-table { .detail-table {
position: absolute; width: 100%;
top: 0;
left: 0;
border: 0; border: 0;
} }
......
...@@ -19,7 +19,11 @@ var harness = { ...@@ -19,7 +19,11 @@ var harness = {
console.log('Filesystem found.'); console.log('Filesystem found.');
self.filesystem = filesystem; self.filesystem = filesystem;
util.getOrCreateDirectory(filesystem.root, '/Downloads', function () {}); util.getOrCreateDirectory(filesystem.root, '/Downloads', function () {});
util.getOrCreateDirectory(filesystem.root, '/media', function () {}); util.getOrCreateDirectory(filesystem.root, '/removable', function () {});
util.getOrCreateDirectory(filesystem.root, '/removable/disk1',
function () {});
util.getOrCreateDirectory(filesystem.root, '/removable/disk2',
function () {});
}; };
window.webkitRequestFileSystem(window.PERSISTENT, 16 * 1024 * 1024, window.webkitRequestFileSystem(window.PERSISTENT, 16 * 1024 * 1024,
......
...@@ -217,7 +217,7 @@ chrome.fileBrowserPrivate = { ...@@ -217,7 +217,7 @@ chrome.fileBrowserPrivate = {
PARENT_DIRECTORY: 'Parent Directory', PARENT_DIRECTORY: 'Parent Directory',
ROOT_DIRECTORY_LABEL: 'Files', ROOT_DIRECTORY_LABEL: 'Files',
DOWNLOADS_DIRECTORY_LABEL: 'File Shelf', CHROMEBOOK_DIRECTORY_LABEL: 'Chromebook',
DOWNLOADS_DIRECTORY_WARNING: "&lt;strong&gt;Caution:&lt;/strong&gt; These files are temporary and may be automatically deleted to free up disk space. &lt;a href='javascript://'&gt;Learn More&lt;/a&gt;", DOWNLOADS_DIRECTORY_WARNING: "&lt;strong&gt;Caution:&lt;/strong&gt; These files are temporary and may be automatically deleted to free up disk space. &lt;a href='javascript://'&gt;Learn More&lt;/a&gt;",
MEDIA_DIRECTORY_LABEL: 'External Storage', MEDIA_DIRECTORY_LABEL: 'External Storage',
NAME_COLUMN_LABEL: 'Name', NAME_COLUMN_LABEL: 'Name',
......
...@@ -109,59 +109,69 @@ ...@@ -109,59 +109,69 @@
<body i18n-values=".style.fontFamily:WEB_FONT_FAMILY; <body i18n-values=".style.fontFamily:WEB_FONT_FAMILY;
.style.fontSize:WEB_FONT_SIZE"> .style.fontSize:WEB_FONT_SIZE">
<commands> <commands>
<command id="cut"></command> <command id="cut" i18n-values="label:CUT_BUTTON_LABEL"></command>
<command id="copy"></command> <command id="copy" i18n-values="label:COPY_BUTTON_LABEL"></command>
<command id="paste"></command> <command id="paste" i18n-values="label:PASTE_BUTTON_LABEL"></command>
<command id="rename"></command> <command id="rename" i18n-values="label:RENAME_BUTTON_LABEL"></command>
<command id="delete"></command> <command id="delete" i18n-values="label:DELETE_BUTTON_LABEL"></command>
<command id="newfolder" i18n-values="label:NEW_FOLDER_BUTTON_LABEL"></command>
</commands> </commands>
<menu class=file-context-menu> <menu class=file-context-menu>
<menuitem i18n-content=CUT_BUTTON_LABEL command='#cut'></menuitem> <menuitem command='#cut'></menuitem>
<menuitem i18n-content=COPY_BUTTON_LABEL command='#copy'></menuitem> <menuitem command='#copy'></menuitem>
<menuitem i18n-content=PASTE_BUTTON_LABEL command='#paste'></menuitem> <menuitem command='#paste'></menuitem>
<hr> <hr>
<menuitem i18n-content=RENAME_BUTTON_LABEL command='#rename'></menuitem> <menuitem command='#rename'></menuitem>
<menuitem i18n-content=DELETE_BUTTON_LABEL command='#delete'></menuitem> <menuitem command='#delete'></menuitem>
<hr visibleif='this.dialogType_ == "saveas-file" ||
this.dialogType_ == "full-page"'>
<menuitem command='#newfolder'
visibleif='this.dialogType_ == "saveas-file" ||
this.dialogType_ == "full-page"'></menuitem>
</menu> </menu>
<div class=dialog-title visibleif='this.dialogType_ != "full-page"' <div class=dialog-title visibleif='this.dialogType_ != "full-page"'
>[TITLE]</div> >[TITLE]</div>
<div class=dialog-header> <div class=dialog-container>
<div class=breadcrumbs></div> <div class=dialog-sidebar>
<button class=detail-view tabindex=4 <div class=close-sidebar><img src='images/close_sidebar.png'></div>
><img src='images/icon-detail-view.png'></button <list class=roots-list></list>
><button class=thumbnail-view tabindex=5
><img src='images/icon-thumb-view.png'></button>
<button i18n-content=NEW_FOLDER_BUTTON_LABEL class='new-folder'
tabindex=6
visibleif='this.dialogType_ == "saveas-file" ||
this.dialogType_ == "full-page"'
></button>
</div>
<div class=dialog-body>
<div class=filelist-panel>
<div class=list-container>
<div class=detail-table tabindex=0></div>
<grid class=thumbnail-grid tabindex=0></grid>
</div>
<div class=downloads-warning hidden>
<img src=images/warning_icon_square_26x26.png>
<div></div>
</div>
</div> </div>
<div class=preview-panel visibility=hidden> <div class=dialog-main>
<div><div class=preview-thumbnails></div></div> <div class=dialog-header>
<div><div class=preview-summary></div></div> <div class=open-sidebar><img src='images/open_sidebar.png'></div>
<div class=task-buttons></div> <div class=breadcrumbs></div>
<div> <button class=detail-view tabindex=4
<button class='delete-button task-button' command='#delete' ><img src='images/icon-detail-view.png'></button
onclick='fileManager.deleteEntries( ><button class=thumbnail-view tabindex=5
fileManager.selection.entries, false)' ><img src='images/icon-thumb-view.png'></button>
visibleif='this.dialogType_ == "full-page"' </div>
><img src='images/button-icon-delete.png' <div class=dialog-body>
><div i18n-content=DELETE_BUTTON_LABEL></div <div class=filelist-panel>
></button> <div class=list-container>
<div class=detail-table tabindex=0></div>
<grid class=thumbnail-grid tabindex=0></grid>
</div>
<div class=downloads-warning hidden>
<img src=images/warning_icon_square_26x26.png>
<div></div>
</div>
</div>
<div class=preview-panel visibility=hidden>
<div><div class=preview-thumbnails></div></div>
<div><div class=preview-summary></div></div>
<div class=task-buttons></div>
<div>
<button class='delete-button task-button' command='#delete'
onclick='fileManager.deleteEntries(
fileManager.selection.entries, false)'
visibleif='this.dialogType_ == "full-page"'
><img src='images/button-icon-delete.png'
><div i18n-content=DELETE_BUTTON_LABEL></div
></button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -88,14 +88,6 @@ ...@@ -88,14 +88,6 @@
"filesystem:*.zip" "filesystem:*.zip"
] ]
}, },
{
"id": "unmount-archive",
"default_title": "__MSG_UNMOUNT_ARCHIVE__",
"default_icon": "images/icon_unmount_archive_16x16.png",
"file_filters": [
"filesystem:*.mounted_zip"
]
},
{ {
"id": "gallery", "id": "gallery",
"default_title": "__MSG_GALLERY__", "default_title": "__MSG_GALLERY__",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment