diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-08 14:30:41 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-08-12 13:49:54 +0200 |
commit | ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 (patch) | |
tree | 498dfb8a97ff3361a9f7486863a52bb4e26bb898 /chromium/chrome/browser/resources/file_manager/common | |
parent | 4ce69f7403811819800e7c5ae1318b2647e778d1 (diff) |
Update Chromium to beta version 37.0.2062.68
Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/chrome/browser/resources/file_manager/common')
91 files changed, 0 insertions, 2141 deletions
diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/archive.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/archive.png Binary files differdeleted file mode 100644 index 2a054b38515..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/archive.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/archive_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/archive_white.png Binary files differdeleted file mode 100644 index 94ffaf0f310..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/archive_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/audio.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/audio.png Binary files differdeleted file mode 100644 index a5b4ac9e774..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/audio.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/audio_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/audio_white.png Binary files differdeleted file mode 100644 index 819e4065021..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/audio_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/chart.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/chart.png Binary files differdeleted file mode 100644 index 4f7bfa145eb..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/chart.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/chart_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/chart_white.png Binary files differdeleted file mode 100644 index 7500f3f83f6..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/chart_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/excel.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/excel.png Binary files differdeleted file mode 100644 index cb27f5c242c..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/excel.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/excel_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/excel_white.png Binary files differdeleted file mode 100644 index 0900b09a741..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/excel_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/folder.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/folder.png Binary files differdeleted file mode 100644 index 3f6e17f0892..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/folder.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/folder_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/folder_white.png Binary files differdeleted file mode 100644 index 9a56eb9b8d8..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/folder_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/form.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/form.png Binary files differdeleted file mode 100644 index c3d2087db8a..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/form.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/form_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/form_white.png Binary files differdeleted file mode 100644 index 21c18adf387..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/form_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdoc.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdoc.png Binary files differdeleted file mode 100644 index 102f1c0f432..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdoc.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdoc_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdoc_white.png Binary files differdeleted file mode 100644 index a66a338421f..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdoc_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdraw.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdraw.png Binary files differdeleted file mode 100644 index b1120418420..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdraw.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdraw_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdraw_white.png Binary files differdeleted file mode 100644 index f92f18b5f1e..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gdraw_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/generic.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/generic.png Binary files differdeleted file mode 100644 index bff3cdacba7..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/generic.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/generic_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/generic_white.png Binary files differdeleted file mode 100644 index a369f66eabc..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/generic_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/glink.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/glink.png Binary files differdeleted file mode 100644 index bff3cdacba7..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/glink.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/glink_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/glink_white.png Binary files differdeleted file mode 100644 index a369f66eabc..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/glink_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gsheet.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gsheet.png Binary files differdeleted file mode 100644 index 6fbd46b3052..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gsheet.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gsheet_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gsheet_white.png Binary files differdeleted file mode 100644 index 39cf43df5ff..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gsheet_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gslides.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gslides.png Binary files differdeleted file mode 100644 index 76523cc9746..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gslides.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gslides_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gslides_white.png Binary files differdeleted file mode 100644 index ea14b91430c..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gslides_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gtable.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gtable.png Binary files differdeleted file mode 100644 index a78b26e54f7..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gtable.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gtable_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gtable_white.png Binary files differdeleted file mode 100644 index 9198c9e99ee..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/gtable_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/image.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/image.png Binary files differdeleted file mode 100644 index 9ec2dbd5cb7..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/image.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/image_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/image_white.png Binary files differdeleted file mode 100644 index 739614ffc0a..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/image_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/pdf.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/pdf.png Binary files differdeleted file mode 100644 index ec6d679f5c9..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/pdf.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/pdf_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/pdf_white.png Binary files differdeleted file mode 100644 index 076820461c0..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/pdf_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/ppt.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/ppt.png Binary files differdeleted file mode 100644 index 0a834451830..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/ppt.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/ppt_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/ppt_white.png Binary files differdeleted file mode 100644 index f18491debb3..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/ppt_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/script.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/script.png Binary files differdeleted file mode 100644 index 054f59a78fc..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/script.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/script_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/script_white.png Binary files differdeleted file mode 100644 index 2760eb805b9..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/script_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/sites.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/sites.png Binary files differdeleted file mode 100644 index e4e0ffe720f..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/sites.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/sites_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/sites_white.png Binary files differdeleted file mode 100644 index 11646f82866..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/sites_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/video.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/video.png Binary files differdeleted file mode 100644 index 73b70f63b23..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/video.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/video_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/video_white.png Binary files differdeleted file mode 100644 index ac1c0806c9f..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/video_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/word.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/word.png Binary files differdeleted file mode 100644 index a2bf315f901..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/word.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/word_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/word_white.png Binary files differdeleted file mode 100644 index 9bc0f21f7d7..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/100/word_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/archive.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/archive.png Binary files differdeleted file mode 100644 index f51418150f7..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/archive.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/archive_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/archive_white.png Binary files differdeleted file mode 100644 index 6b522cf0c7b..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/archive_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/audio.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/audio.png Binary files differdeleted file mode 100644 index ad2f540c2c3..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/audio.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/audio_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/audio_white.png Binary files differdeleted file mode 100644 index 997d6106b00..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/audio_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/chart.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/chart.png Binary files differdeleted file mode 100644 index 5b03c369a1a..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/chart.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/chart_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/chart_white.png Binary files differdeleted file mode 100644 index 366fc85f3ac..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/chart_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/excel.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/excel.png Binary files differdeleted file mode 100644 index 22a4eb5d6fd..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/excel.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/excel_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/excel_white.png Binary files differdeleted file mode 100644 index bf0a61c07b5..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/excel_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/folder.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/folder.png Binary files differdeleted file mode 100644 index 782227f9bde..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/folder.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/folder_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/folder_white.png Binary files differdeleted file mode 100644 index 9124621632c..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/folder_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/form.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/form.png Binary files differdeleted file mode 100644 index 7908b559402..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/form.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/form_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/form_white.png Binary files differdeleted file mode 100644 index 0252d4c94fb..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/form_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdoc.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdoc.png Binary files differdeleted file mode 100644 index 80ae026b49d..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdoc.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdoc_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdoc_white.png Binary files differdeleted file mode 100644 index 366180cbea4..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdoc_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdraw.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdraw.png Binary files differdeleted file mode 100644 index c36fca643fe..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdraw.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdraw_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdraw_white.png Binary files differdeleted file mode 100644 index 98401d94722..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gdraw_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/generic.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/generic.png Binary files differdeleted file mode 100644 index 8df85a372f2..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/generic.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/generic_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/generic_white.png Binary files differdeleted file mode 100644 index 9b9b295bbac..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/generic_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/glink.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/glink.png Binary files differdeleted file mode 100644 index d60d809d64f..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/glink.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/glink_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/glink_white.png Binary files differdeleted file mode 100644 index d9a2070240e..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/glink_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gsheet.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gsheet.png Binary files differdeleted file mode 100644 index 0545e69dea8..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gsheet.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gsheet_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gsheet_white.png Binary files differdeleted file mode 100644 index 801de01d657..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gsheet_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gslides.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gslides.png Binary files differdeleted file mode 100644 index 3f1cd75575c..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gslides.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gslides_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gslides_white.png Binary files differdeleted file mode 100644 index b6c24ab20f8..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gslides_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gtable.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gtable.png Binary files differdeleted file mode 100644 index fec2061ef44..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gtable.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gtable_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gtable_white.png Binary files differdeleted file mode 100644 index 8c695c58aaa..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/gtable_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/image.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/image.png Binary files differdeleted file mode 100644 index df61101582d..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/image.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/image_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/image_white.png Binary files differdeleted file mode 100644 index 46017e6895c..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/image_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/pdf.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/pdf.png Binary files differdeleted file mode 100644 index 0f62d9e620d..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/pdf.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/pdf_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/pdf_white.png Binary files differdeleted file mode 100644 index e53bda7a989..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/pdf_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/ppt.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/ppt.png Binary files differdeleted file mode 100644 index 5f06e4bffd3..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/ppt.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/ppt_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/ppt_white.png Binary files differdeleted file mode 100644 index 9824222e668..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/ppt_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/script.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/script.png Binary files differdeleted file mode 100644 index 01a2a1ad4b6..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/script.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/script_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/script_white.png Binary files differdeleted file mode 100644 index b04a21002f1..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/script_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/sites.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/sites.png Binary files differdeleted file mode 100644 index 541c328f7fe..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/sites.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/sites_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/sites_white.png Binary files differdeleted file mode 100644 index 613e5178f1c..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/sites_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/video.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/video.png Binary files differdeleted file mode 100644 index a8346a3f200..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/video.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/video_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/video_white.png Binary files differdeleted file mode 100644 index 3cbcdba263d..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/video_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/word.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/word.png Binary files differdeleted file mode 100644 index 23b78f6782d..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/word.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/word_white.png b/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/word_white.png Binary files differdeleted file mode 100644 index 424ea80a12f..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/file_types/200/word_white.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/icon128.png b/chromium/chrome/browser/resources/file_manager/common/images/icon128.png Binary files differdeleted file mode 100644 index d4c6c555040..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/icon128.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/icon16.png b/chromium/chrome/browser/resources/file_manager/common/images/icon16.png Binary files differdeleted file mode 100644 index dc3b8d8b399..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/icon16.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/icon256.png b/chromium/chrome/browser/resources/file_manager/common/images/icon256.png Binary files differdeleted file mode 100644 index 31864fbe0bc..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/icon256.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/icon32.png b/chromium/chrome/browser/resources/file_manager/common/images/icon32.png Binary files differdeleted file mode 100644 index 47b8a55acf1..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/icon32.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/icon48.png b/chromium/chrome/browser/resources/file_manager/common/images/icon48.png Binary files differdeleted file mode 100644 index b3c7dbfe691..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/icon48.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/icon64.png b/chromium/chrome/browser/resources/file_manager/common/images/icon64.png Binary files differdeleted file mode 100644 index 3130c1c4059..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/icon64.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/images/icon96.png b/chromium/chrome/browser/resources/file_manager/common/images/icon96.png Binary files differdeleted file mode 100644 index fdc1ab1fec2..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/images/icon96.png +++ /dev/null diff --git a/chromium/chrome/browser/resources/file_manager/common/js/async_util.js b/chromium/chrome/browser/resources/file_manager/common/js/async_util.js deleted file mode 100644 index f74a9d49381..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/js/async_util.js +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) 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. - -'use strict'; - -/** - * Namespace for async utility functions. - */ -var AsyncUtil = {}; - -/** - * Asynchronous version of Array.forEach. - * This executes a provided function callback once per array element, then - * run completionCallback to notify the completion. - * The callback can be an asynchronous function, but the execution is - * sequentially done. - * - * @param {Array.<T>} array The array to be iterated. - * @param {function(function(), T, number, Array.<T>} callback The iteration - * callback. The first argument is a callback to notify the completion of - * the iteration. - * @param {function()} completionCallback Called when all iterations are - * completed. - * @param {Object=} opt_thisObject Bound to callback if given. - * @template T - */ -AsyncUtil.forEach = function( - array, callback, completionCallback, opt_thisObject) { - if (opt_thisObject) - callback = callback.bind(opt_thisObject); - - var queue = new AsyncUtil.Queue(); - for (var i = 0; i < array.length; i++) { - queue.run(function(element, index, iterationCompletionCallback) { - callback(iterationCompletionCallback, element, index, array); - }.bind(null, array[i], i)); - } - queue.run(function(iterationCompletionCallback) { - completionCallback(); // Don't pass iteration completion callback. - }); -}; - -/** - * Creates a class for executing several asynchronous closures in a fifo queue. - * Added tasks will be executed sequentially in order they were added. - * - * @constructor - */ -AsyncUtil.Queue = function() { - this.running_ = false; - this.closures_ = []; -}; - -/** - * @return {boolean} True when a task is running, otherwise false. - */ -AsyncUtil.Queue.prototype.isRunning = function() { - return this.running_; -}; - -/** - * Enqueues a closure to be executed. - * @param {function(function())} closure Closure with a completion callback to - * be executed. - */ -AsyncUtil.Queue.prototype.run = function(closure) { - this.closures_.push(closure); - if (!this.running_) - this.continue_(); -}; - -/** - * Serves the next closure from the queue. - * @private - */ -AsyncUtil.Queue.prototype.continue_ = function() { - if (!this.closures_.length) { - this.running_ = false; - return; - } - - // Run the next closure. - this.running_ = true; - var closure = this.closures_.shift(); - closure(this.continue_.bind(this)); -}; - -/** - * Cancels all pending tasks. Note that this does NOT cancel the task running - * currently. - */ -AsyncUtil.Queue.prototype.cancel = function() { - this.closures_ = []; -}; - -/** - * Creates a class for executing several asynchronous closures in a group in - * a dependency order. - * - * @constructor - */ -AsyncUtil.Group = function() { - this.addedTasks_ = {}; - this.pendingTasks_ = {}; - this.finishedTasks_ = {}; - this.completionCallbacks_ = []; -}; - -/** - * Enqueues a closure to be executed after dependencies are completed. - * - * @param {function(function())} closure Closure with a completion callback to - * be executed. - * @param {Array.<string>=} opt_dependencies Array of dependencies. If no - * dependencies, then the the closure will be executed immediately. - * @param {string=} opt_name Task identifier. Specify to use in dependencies. - */ -AsyncUtil.Group.prototype.add = function(closure, opt_dependencies, opt_name) { - var length = Object.keys(this.addedTasks_).length; - var name = opt_name || ('(unnamed#' + (length + 1) + ')'); - - var task = { - closure: closure, - dependencies: opt_dependencies || [], - name: name - }; - - this.addedTasks_[name] = task; - this.pendingTasks_[name] = task; -}; - -/** - * Runs the enqueued closured in order of dependencies. - * - * @param {function()=} opt_onCompletion Completion callback. - */ -AsyncUtil.Group.prototype.run = function(opt_onCompletion) { - if (opt_onCompletion) - this.completionCallbacks_.push(opt_onCompletion); - this.continue_(); -}; - -/** - * Runs enqueued pending tasks whose dependencies are completed. - * @private - */ -AsyncUtil.Group.prototype.continue_ = function() { - // If all of the added tasks have finished, then call completion callbacks. - if (Object.keys(this.addedTasks_).length == - Object.keys(this.finishedTasks_).length) { - for (var index = 0; index < this.completionCallbacks_.length; index++) { - var callback = this.completionCallbacks_[index]; - callback(); - } - this.completionCallbacks_ = []; - return; - } - - for (var name in this.pendingTasks_) { - var task = this.pendingTasks_[name]; - var dependencyMissing = false; - for (var index = 0; index < task.dependencies.length; index++) { - var dependency = task.dependencies[index]; - // Check if the dependency has finished. - if (!this.finishedTasks_[dependency]) - dependencyMissing = true; - } - // All dependences finished, therefore start the task. - if (!dependencyMissing) { - delete this.pendingTasks_[task.name]; - task.closure(this.finish_.bind(this, task)); - } - } -}; - -/** - * Finishes the passed task and continues executing enqueued closures. - * - * @param {Object} task Task object. - * @private - */ -AsyncUtil.Group.prototype.finish_ = function(task) { - this.finishedTasks_[task.name] = task; - this.continue_(); -}; - -/** - * Aggregates consecutive calls and executes the closure only once instead of - * several times. The first call is always called immediately, and the next - * consecutive ones are aggregated and the closure is called only once once - * |delay| amount of time passes after the last call to run(). - * - * @param {function()} closure Closure to be aggregated. - * @param {number=} opt_delay Minimum aggregation time in milliseconds. Default - * is 50 milliseconds. - * @constructor - */ -AsyncUtil.Aggregation = function(closure, opt_delay) { - /** - * @type {number} - * @private - */ - this.delay_ = opt_delay || 50; - - /** - * @type {function()} - * @private - */ - this.closure_ = closure; - - /** - * @type {number?} - * @private - */ - this.scheduledRunsTimer_ = null; - - /** - * @type {number} - * @private - */ - this.lastRunTime_ = 0; -}; - -/** - * Runs a closure. Skips consecutive calls. The first call is called - * immediately. - */ -AsyncUtil.Aggregation.prototype.run = function() { - // If recently called, then schedule the consecutive call with a delay. - if (Date.now() - this.lastRunTime_ < this.delay_) { - this.cancelScheduledRuns_(); - this.scheduledRunsTimer_ = setTimeout(this.runImmediately_.bind(this), - this.delay_ + 1); - this.lastRunTime_ = Date.now(); - return; - } - - // Otherwise, run immediately. - this.runImmediately_(); -}; - -/** - * Calls the schedule immediately and cancels any scheduled calls. - * @private - */ -AsyncUtil.Aggregation.prototype.runImmediately_ = function() { - this.cancelScheduledRuns_(); - this.closure_(); - this.lastRunTime_ = Date.now(); -}; - -/** - * Cancels all scheduled runs (if any). - * @private - */ -AsyncUtil.Aggregation.prototype.cancelScheduledRuns_ = function() { - if (this.scheduledRunsTimer_) { - clearTimeout(this.scheduledRunsTimer_); - this.scheduledRunsTimer_ = null; - } -}; diff --git a/chromium/chrome/browser/resources/file_manager/common/js/path_util.js b/chromium/chrome/browser/resources/file_manager/common/js/path_util.js deleted file mode 100644 index 3b0d4663cab..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/js/path_util.js +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) 2012 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. - -'use strict'; - -/** - * Type of a root directory. - * @enum {string} - * @const - */ -var RootType = Object.freeze({ - // Root of local directory. - DOWNLOADS: 'downloads', - - // Root of mounted archive file. - ARCHIVE: 'archive', - - // Root of removal volume. - REMOVABLE: 'removable', - - // Root of drive directory. - DRIVE: 'drive', - - // Root for entries that is not located under RootType.DRIVE. e.g. shared - // files. - DRIVE_OTHER: 'drive_other', - - // Fake root for offline available files on the drive. - DRIVE_OFFLINE: 'drive_offline', - - // Fake root for shared files on the drive. - DRIVE_SHARED_WITH_ME: 'drive_shared_with_me', - - // Fake root for recent files on the drive. - DRIVE_RECENT: 'drive_recent' -}); - -/** - * Top directory for each root type. - * TODO(mtomasz): Deprecated. Remove this. - * @enum {string} - * @const - */ -var RootDirectory = Object.freeze({ - DOWNLOADS: '/Downloads', - ARCHIVE: '/archive', - REMOVABLE: '/removable', - DRIVE: '/drive', - DRIVE_OFFLINE: '/drive_offline', // A fake root. Not the actual filesystem. - DRIVE_SHARED_WITH_ME: '/drive_shared_with_me', // A fake root. - DRIVE_RECENT: '/drive_recent' // A fake root. -}); - -/** - * Sub root directory for Drive. "root" and "other". This is not used now. - * TODO(haruki): Add namespaces support. http://crbug.com/174233. - * @enum {string} - * @const - */ -var DriveSubRootDirectory = Object.freeze({ - ROOT: 'root', - OTHER: 'other', -}); - -var PathUtil = {}; - -/** - * The default mount point. - * TODO(mtomasz): Deprecated. Use the volume manager instead. - * @type {string} - * @const - */ -PathUtil.DEFAULT_MOUNT_POINT = '/Downloads'; - -/** - * Checks if the given path represents a special search. Fake entries in - * RootDirectory correspond to special searches. - * @param {string} path Path to check. - * @return {boolean} True if the given path represents a special search. - */ -PathUtil.isSpecialSearchRoot = function(path) { - var type = PathUtil.getRootType(path); - return type == RootType.DRIVE_OFFLINE || - type == RootType.DRIVE_SHARED_WITH_ME || - type == RootType.DRIVE_RECENT; -}; - -/** - * Checks |path| and return true if it is under Google Drive or a special - * search root which represents a special search from Google Drive. - * @param {string} path Path to check. - * @return {boolean} True if the given path represents a Drive based path. - */ -PathUtil.isDriveBasedPath = function(path) { - var rootType = PathUtil.getRootType(path); - return rootType === RootType.DRIVE || - rootType === RootType.DRIVE_SHARED_WITH_ME || - rootType === RootType.DRIVE_RECENT || - rootType === RootType.DRIVE_OFFLINE; -}; - -/** - * @param {string} path Path starting with '/'. - * @return {string} Top directory (starting with '/'). - */ -PathUtil.getTopDirectory = function(path) { - var i = path.indexOf('/', 1); - return i === -1 ? path : path.substring(0, i); -}; - -/** - * Obtains the parent path of the specified path. - * @param {string} path Path string. - * @return {string} Parent path. - */ -PathUtil.getParentDirectory = function(path) { - if (path[path.length - 1] == '/') - return PathUtil.getParentDirectory(path.substring(0, path.length - 1)); - var index = path.lastIndexOf('/'); - if (index == 0) - return '/'; - else if (index == -1) - return '.'; - return path.substring(0, index); -}; - -/** - * @param {string} path Any unix-style path (may start or not start from root). - * @return {Array.<string>} Path components. - */ -PathUtil.split = function(path) { - var fromRoot = false; - if (path[0] === '/') { - fromRoot = true; - path = path.substring(1); - } - - var components = path.split('/'); - if (fromRoot) - components[0] = '/' + components[0]; - return components; -}; - -/** - * Returns a directory part of the given |path|. In other words, the path - * without its base name. - * - * Examples: - * PathUtil.dirname('abc') -> '' - * PathUtil.dirname('a/b') -> 'a' - * PathUtil.dirname('a/b/') -> 'a/b' - * PathUtil.dirname('a/b/c') -> 'a/b' - * PathUtil.dirname('/') -> '/' - * PathUtil.dirname('/abc') -> '/' - * PathUtil.dirname('/abc/def') -> '/abc' - * PathUtil.dirname('') -> '' - * - * @param {string} path The path to be parsed. - * @return {string} The directory path. - */ -PathUtil.dirname = function(path) { - var index = path.lastIndexOf('/'); - if (index < 0) - return ''; - if (index == 0) - return '/'; - return path.substring(0, index); -}; - -/** - * Returns the base name (the last component) of the given |path|. If the - * |path| ends with '/', returns an empty component. - * - * Examples: - * PathUtil.basename('abc') -> 'abc' - * PathUtil.basename('a/b') -> 'b' - * PathUtil.basename('a/b/') -> '' - * PathUtil.basename('a/b/c') -> 'c' - * PathUtil.basename('/') -> '' - * PathUtil.basename('/abc') -> 'abc' - * PathUtil.basename('/abc/def') -> 'def' - * PathUtil.basename('') -> '' - * - * @param {string} path The path to be parsed. - * @return {string} The base name. - */ -PathUtil.basename = function(path) { - var index = path.lastIndexOf('/'); - return index >= 0 ? path.substring(index + 1) : path; -}; - -/** - * Join path components into a single path. Can be called either with a list of - * components as arguments, or with an array of components as the only argument. - * - * Examples: - * Path.join('abc', 'def') -> 'abc/def' - * Path.join('/', 'abc', 'def/ghi') -> '/abc/def/ghi' - * Path.join(['/abc/def', 'ghi']) -> '/abc/def/ghi' - * - * @return {string} Resulting path. - */ -PathUtil.join = function() { - var components; - - if (arguments.length === 1 && typeof(arguments[0]) === 'object') { - components = arguments[0]; - } else { - components = arguments; - } - - var path = ''; - for (var i = 0; i < components.length; i++) { - if (components[i][0] === '/') { - path = components[i]; - continue; - } - if (path.length === 0 || path[path.length - 1] !== '/') - path += '/'; - path += components[i]; - } - return path; -}; - -/** - * @param {string} path Path starting with '/'. - * @return {RootType} RootType.DOWNLOADS, RootType.DRIVE etc. - */ -PathUtil.getRootType = function(path) { - var rootDir = PathUtil.getTopDirectory(path); - for (var type in RootDirectory) { - if (rootDir === RootDirectory[type]) - return RootType[type]; - } -}; - -/** - * @param {string} path Any path. - * @return {string} The root path. - */ -PathUtil.getRootPath = function(path) { - var type = PathUtil.getRootType(path); - - if (type == RootType.DOWNLOADS || type == RootType.DRIVE_OFFLINE || - type == RootType.DRIVE_SHARED_WITH_ME || type == RootType.DRIVE_RECENT) - return PathUtil.getTopDirectory(path); - - if (type == RootType.DRIVE || type == RootType.ARCHIVE || - type == RootType.REMOVABLE) { - var components = PathUtil.split(path); - if (components.length > 1) { - return PathUtil.join(components[0], components[1]); - } else { - return components[0]; - } - } - - return '/'; -}; - -/** - * @param {string} path A path. - * @return {boolean} True if it is a path to the root. - */ -PathUtil.isRootPath = function(path) { - return PathUtil.getRootPath(path) === path; -}; - -/** - * @param {string} path A root path. - * @return {boolean} True if the given path is root and user can unmount it. - */ -PathUtil.isUnmountableByUser = function(path) { - if (!PathUtil.isRootPath(path)) - return false; - - var type = PathUtil.getRootType(path); - return (type == RootType.ARCHIVE || type == RootType.REMOVABLE); -}; - -/** - * @param {string} parent_path The parent path. - * @param {string} child_path The child path. - * @return {boolean} True if |parent_path| is parent file path of |child_path|. - */ -PathUtil.isParentPath = function(parent_path, child_path) { - if (!parent_path || parent_path.length == 0 || - !child_path || child_path.length == 0) - return false; - - if (parent_path[parent_path.length - 1] != '/') - parent_path += '/'; - - if (child_path[child_path.length - 1] != '/') - child_path += '/'; - - return child_path.indexOf(parent_path) == 0; -}; - -/** - * Return the localized name for the root. - * TODO(hirono): Support all RootTypes and stop to use paths. - * - * @param {string|RootType} path The full path of the root (starting with slash) - * or root type. - * @return {string} The localized name. - */ -PathUtil.getRootLabel = function(path) { - var str = function(id) { - return loadTimeData.getString(id); - }; - - if (path === RootDirectory.DOWNLOADS) - return str('DOWNLOADS_DIRECTORY_LABEL'); - - if (path === RootDirectory.ARCHIVE) - return str('ARCHIVE_DIRECTORY_LABEL'); - if (PathUtil.isParentPath(RootDirectory.ARCHIVE, path)) - return path.substring(RootDirectory.ARCHIVE.length + 1); - - if (path === RootDirectory.REMOVABLE) - return str('REMOVABLE_DIRECTORY_LABEL'); - if (PathUtil.isParentPath(RootDirectory.REMOVABLE, path)) - return path.substring(RootDirectory.REMOVABLE.length + 1); - - // TODO(haruki): Add support for "drive/root" and "drive/other". - if (path === RootDirectory.DRIVE + '/' + DriveSubRootDirectory.ROOT) - return str('DRIVE_MY_DRIVE_LABEL'); - - if (path === RootDirectory.DRIVE_OFFLINE) - return str('DRIVE_OFFLINE_COLLECTION_LABEL'); - - if (path === RootDirectory.DRIVE_SHARED_WITH_ME || - path === RootType.DRIVE_SHARED_WITH_ME) - return str('DRIVE_SHARED_WITH_ME_COLLECTION_LABEL'); - - if (path === RootDirectory.DRIVE_RECENT) - return str('DRIVE_RECENT_COLLECTION_LABEL'); - - return path; -}; - -/** - * Return the label of the folder to be shown. Eg. - * - '/foo/bar/baz' -> 'baz' - * - '/hoge/fuga/ -> 'fuga' - * If the directory is root, returns the root label, which is same as - * PathUtil.getRootLabel(). - * - * @param {string} directoryPath The full path of the folder. - * @return {string} The label to be shown. - */ -PathUtil.getFolderLabel = function(directoryPath) { - var label = ''; - if (PathUtil.isRootPath(directoryPath)) - label = PathUtil.getRootLabel(directoryPath); - - if (label && label != directoryPath) - return label; - - var matches = directoryPath.match(/([^\/]*)[\/]?$/); - if (matches[1]) - return matches[1]; - - return directoryPath; -}; - -/** - * Returns if the given path can be a target path of folder shortcut. - * - * @param {string} directoryPath Directory path to be checked. - * @return {boolean} True if the path can be a target path of the shortcut. - */ -PathUtil.isEligibleForFolderShortcut = function(directoryPath) { - return !PathUtil.isSpecialSearchRoot(directoryPath) && - !PathUtil.isRootPath(directoryPath) && - PathUtil.isDriveBasedPath(directoryPath); -}; - -/** - * Extracts the extension of the path. - * - * Examples: - * PathUtil.splitExtension('abc.ext') -> ['abc', '.ext'] - * PathUtil.splitExtension('a/b/abc.ext') -> ['a/b/abc', '.ext'] - * PathUtil.splitExtension('a/b') -> ['a/b', ''] - * PathUtil.splitExtension('.cshrc') -> ['', '.cshrc'] - * PathUtil.splitExtension('a/b.backup/hoge') -> ['a/b.backup/hoge', ''] - * - * @param {string} path Path to be extracted. - * @return {Array.<string>} Filename and extension of the given path. - */ -PathUtil.splitExtension = function(path) { - var dotPosition = path.lastIndexOf('.'); - if (dotPosition <= path.lastIndexOf('/')) - dotPosition = -1; - - var filename = dotPosition != -1 ? path.substr(0, dotPosition) : path; - var extension = dotPosition != -1 ? path.substr(dotPosition) : ''; - return [filename, extension]; -}; - -/** - * Obtains location information from a path. - * - * @param {!VolumeInfo} volumeInfo Volume containing an entry pointed by path. - * @param {string} fullPath Full path. - * @return {EntryLocation} Location information. - */ -PathUtil.getLocationInfo = function(volumeInfo, fullPath) { - var rootPath; - var rootType; - if (volumeInfo.volumeType === util.VolumeType.DRIVE) { - // If the volume is drive, root path can be either mountPath + '/root' or - // mountPath + '/other'. - if ((fullPath + '/').indexOf(volumeInfo.mountPath + '/root/') === 0) { - rootPath = volumeInfo.mountPath + '/root'; - rootType = RootType.DRIVE; - } else if ((fullPath + '/').indexOf( - volumeInfo.mountPath + '/other/') === 0) { - rootPath = volumeInfo.mountPath + '/other'; - rootType = RootType.DRIVE_OTHER; - } else { - throw new Error(fullPath + ' is an invalid drive path.'); - } - } else { - // Otherwise, root path is same with a mount path of the volume. - rootPath = volumeInfo.mountPath; - switch (volumeInfo.volumeType) { - case util.VolumeType.DOWNLOADS: rootType = RootType.DOWNLOADS; break; - case util.VolumeType.REMOVABLE: rootType = RootType.REMOVABLE; break; - case util.VolumeType.ARCHIVE: rootType = RootType.ARCHIVE; break; - default: throw new Error( - 'Invalid volume type: ' + volumeInfo.volumeType); - } - } - var isRootEntry = (fullPath.substr(0, rootPath.length) || '/') === fullPath; - return new EntryLocation(volumeInfo, rootType, isRootEntry); -}; - -/** - * Location information which shows where the path points in FileManager's - * file system. - * - * @param {!VolumeInfo} volumeInfo Volume information. - * @param {RootType} rootType Root type. - * @param {boolean} isRootEntry Whether the entry is root entry or not. - * @constructor - */ -function EntryLocation(volumeInfo, rootType, isRootEntry) { - /** - * Volume information. - * @type {!VolumeInfo} - */ - this.volumeInfo = volumeInfo; - - /** - * Root type. - * @type {RootType} - */ - this.rootType = rootType; - - /** - * Whether the entry is root entry or not. - * @type {boolean} - */ - this.isRootEntry = isRootEntry; - - Object.freeze(this); -} diff --git a/chromium/chrome/browser/resources/file_manager/common/js/progress_center_common.js b/chromium/chrome/browser/resources/file_manager/common/js/progress_center_common.js deleted file mode 100644 index f19d6cbb90b..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/js/progress_center_common.js +++ /dev/null @@ -1,149 +0,0 @@ -// 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. - -'use strict'; - -/** - * Event of the ProgressCenter class. - * @enum {string} - * @const - */ -var ProgressCenterEvent = Object.freeze({ - /** - * Background page notifies item update to application windows. - */ - ITEM_UPDATED: 'itemUpdated', - - /** - * Background page notifies all the items are cleared. - */ - RESET: 'reset' -}); - -/** - * State of progress items. - * @enum {string} - * @const - */ -var ProgressItemState = Object.freeze({ - PROGRESSING: 'progressing', - COMPLETED: 'completed', - ERROR: 'error', - CANCELED: 'canceled' -}); - -/** - * Type of progress items. - * @enum {string} - * @const - */ -var ProgressItemType = Object.freeze({ - // The item is file copy operation. - COPY: 'copy', - // The item is file move operation. - MOVE: 'move', - // The item is file delete opeartion. - DELETE: 'delete', - // The item is file zip operation. - ZIP: 'zip', - // The item is general file transfer operation. - // This is used for the mixed operation of summarized item. - TRANSFER: 'transfer' -}); - -/** - * Item of the progress center. - * @constructor - */ -var ProgressCenterItem = function() { - /** - * Item ID. - * @type {string} - * @private - */ - this.id_ = null; - - /** - * State of the progress item. - * @type {ProgressItemState} - */ - this.state = ProgressItemState.PROGRESSING; - - /** - * Message of the progress item. - * @type {string} - */ - this.message = ''; - - /** - * Max value of the progress. - * @type {number} - */ - this.progressMax = 0; - - /** - * Current value of the progress. - * @type {number} - */ - this.progressValue = 0; - - /** - * Type of progress item. - * @type {ProgressItemType} - */ - this.type = null; - - /** - * Whether the item is summarized item or not. - * @type {boolean} - */ - this.summarized = false; - - /** - * Callback function to cancel the item. - * @type {function()} - */ - this.cancelCallback = null; - - Object.seal(this); -}; - -ProgressCenterItem.prototype = { - /** - * Setter of Item ID. - * @param {string} value New value of ID. - */ - set id(value) { - if (!this.id_) - this.id_ = value; - else - console.error('The ID is already set. (current ID: ' + this.id_ + ')'); - }, - - /** - * Getter of Item ID. - * @return {string} Item ID. - */ - get id() { - return this.id_; - }, - - /** - * Gets progress rate in percent. - * @return {number} Progress rate in percent. - */ - get progressRateInPercent() { - return ~~(100 * this.progressValue / this.progressMax); - }, - - /** - * Whether the item can be canceled or not. - * @return {boolean} True if the item can be canceled. - */ - get cancelable() { - return !!(this.state == ProgressItemState.PROGRESSING && - this.cancelCallback && - !this.summarized); - } -}; diff --git a/chromium/chrome/browser/resources/file_manager/common/js/util.js b/chromium/chrome/browser/resources/file_manager/common/js/util.js deleted file mode 100644 index 07df6b81d88..00000000000 --- a/chromium/chrome/browser/resources/file_manager/common/js/util.js +++ /dev/null @@ -1,1259 +0,0 @@ -// Copyright (c) 2012 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. - -'use strict'; - -/** - * Namespace for utility functions. - */ -var util = {}; - -/** - * Returns a function that console.log's its arguments, prefixed by |msg|. - * - * @param {string} msg The message prefix to use in the log. - * @param {function(...string)=} opt_callback A function to invoke after - * logging. - * @return {function(...string)} Function that logs. - */ -util.flog = function(msg, opt_callback) { - return function() { - var ary = Array.apply(null, arguments); - console.log(msg + ': ' + ary.join(', ')); - if (opt_callback) - opt_callback.apply(null, arguments); - }; -}; - -/** - * Returns a function that throws an exception that includes its arguments - * prefixed by |msg|. - * - * @param {string} msg The message prefix to use in the exception. - * @return {function(...string)} Function that throws. - */ -util.ferr = function(msg) { - return function() { - var ary = Array.apply(null, arguments); - throw new Error(msg + ': ' + ary.join(', ')); - }; -}; - -/** - * Install a sensible toString() on the FileError object. - * - * FileError.prototype.code is a numeric code describing the cause of the - * error. The FileError constructor has a named property for each possible - * error code, but provides no way to map the code to the named property. - * This toString() implementation fixes that. - */ -util.installFileErrorToString = function() { - FileError.prototype.toString = function() { - return '[object FileError: ' + util.getFileErrorMnemonic(this.code) + ']'; - }; -}; - -/** - * @param {number} code The file error code. - * @return {string} The file error mnemonic. - */ -util.getFileErrorMnemonic = function(code) { - for (var key in FileError) { - if (key.search(/_ERR$/) != -1 && FileError[key] == code) - return key; - } - - return code; -}; - -/** - * @param {number} code File error code (from FileError object). - * @return {string} Translated file error string. - */ -util.getFileErrorString = function(code) { - for (var key in FileError) { - var match = /(.*)_ERR$/.exec(key); - if (match && FileError[key] == code) { - // This would convert 1 to 'NOT_FOUND'. - code = match[1]; - break; - } - } - console.warn('File error: ' + code); - return loadTimeData.getString('FILE_ERROR_' + code) || - loadTimeData.getString('FILE_ERROR_GENERIC'); -}; - -/** - * @param {string} str String to escape. - * @return {string} Escaped string. - */ -util.htmlEscape = function(str) { - return str.replace(/[<>&]/g, function(entity) { - switch (entity) { - case '<': return '<'; - case '>': return '>'; - case '&': return '&'; - } - }); -}; - -/** - * @param {string} str String to unescape. - * @return {string} Unescaped string. - */ -util.htmlUnescape = function(str) { - return str.replace(/&(lt|gt|amp);/g, function(entity) { - switch (entity) { - case '<': return '<'; - case '>': return '>'; - case '&': return '&'; - } - }); -}; - -/** - * Iterates the entries contained by dirEntry, and invokes callback once for - * each entry. On completion, successCallback will be invoked. - * - * @param {DirectoryEntry} dirEntry The entry of the directory. - * @param {function(Entry, function())} callback Invoked for each entry. - * @param {function()} successCallback Invoked on completion. - * @param {function(FileError)} errorCallback Invoked if an error is found on - * directory entry reading. - */ -util.forEachDirEntry = function( - dirEntry, callback, successCallback, errorCallback) { - var reader = dirEntry.createReader(); - var iterate = function() { - reader.readEntries(function(entries) { - if (entries.length == 0) { - successCallback(); - return; - } - - AsyncUtil.forEach( - entries, - function(forEachCallback, entry) { - // Do not pass index nor entries. - callback(entry, forEachCallback); - }, - iterate); - }, errorCallback); - }; - iterate(); -}; - -/** - * Reads contents of directory. - * @param {DirectoryEntry} root Root entry. - * @param {string} path Directory path. - * @param {function(Array.<Entry>)} callback List of entries passed to callback. - */ -util.readDirectory = function(root, path, callback) { - var onError = function(e) { - callback([], e); - }; - root.getDirectory(path, {create: false}, function(entry) { - var reader = entry.createReader(); - var r = []; - var readNext = function() { - reader.readEntries(function(results) { - if (results.length == 0) { - callback(r, null); - return; - } - r.push.apply(r, results); - readNext(); - }, onError); - }; - readNext(); - }, onError); -}; - -/** - * Utility function to resolve multiple directories with a single call. - * - * The successCallback will be invoked once for each directory object - * found. The errorCallback will be invoked once for each - * path that could not be resolved. - * - * The successCallback is invoked with a null entry when all paths have - * been processed. - * - * @param {DirEntry} dirEntry The base directory. - * @param {Object} params The parameters to pass to the underlying - * getDirectory calls. - * @param {Array.<string>} paths The list of directories to resolve. - * @param {function(!DirEntry)} successCallback The function to invoke for - * each DirEntry found. Also invoked once with null at the end of the - * process. - * @param {function(FileError)} errorCallback The function to invoke - * for each path that cannot be resolved. - */ -util.getDirectories = function(dirEntry, params, paths, successCallback, - errorCallback) { - - // Copy the params array, since we're going to destroy it. - params = [].slice.call(params); - - var onComplete = function() { - successCallback(null); - }; - - var getNextDirectory = function() { - var path = paths.shift(); - if (!path) - return onComplete(); - - dirEntry.getDirectory( - path, params, - function(entry) { - successCallback(entry); - getNextDirectory(); - }, - function(err) { - errorCallback(err); - getNextDirectory(); - }); - }; - - getNextDirectory(); -}; - -/** - * Utility function to resolve multiple files with a single call. - * - * The successCallback will be invoked once for each directory object - * found. The errorCallback will be invoked once for each - * path that could not be resolved. - * - * The successCallback is invoked with a null entry when all paths have - * been processed. - * - * @param {DirEntry} dirEntry The base directory. - * @param {Object} params The parameters to pass to the underlying - * getFile calls. - * @param {Array.<string>} paths The list of files to resolve. - * @param {function(!FileEntry)} successCallback The function to invoke for - * each FileEntry found. Also invoked once with null at the end of the - * process. - * @param {function(FileError)} errorCallback The function to invoke - * for each path that cannot be resolved. - */ -util.getFiles = function(dirEntry, params, paths, successCallback, - errorCallback) { - // Copy the params array, since we're going to destroy it. - params = [].slice.call(params); - - var onComplete = function() { - successCallback(null); - }; - - var getNextFile = function() { - var path = paths.shift(); - if (!path) - return onComplete(); - - dirEntry.getFile( - path, params, - function(entry) { - successCallback(entry); - getNextFile(); - }, - function(err) { - errorCallback(err); - getNextFile(); - }); - }; - - getNextFile(); -}; - -/** - * Resolve a path to either a DirectoryEntry or a FileEntry, regardless of - * whether the path is a directory or file. - * - * @param {DirectoryEntry} root The root of the filesystem to search. - * @param {string} path The path to be resolved. - * @param {function(Entry)} resultCallback Called back when a path is - * successfully resolved. Entry will be either a DirectoryEntry or - * a FileEntry. - * @param {function(FileError)} errorCallback Called back if an unexpected - * error occurs while resolving the path. - */ -util.resolvePath = function(root, path, resultCallback, errorCallback) { - if (path == '' || path == '/') { - resultCallback(root); - return; - } - - root.getFile( - path, {create: false}, - resultCallback, - function(err) { - if (err.code == FileError.TYPE_MISMATCH_ERR) { - // Bah. It's a directory, ask again. - root.getDirectory( - path, {create: false}, - resultCallback, - errorCallback); - } else { - errorCallback(err); - } - }); -}; - -/** - * Locate the file referred to by path, creating directories or the file - * itself if necessary. - * @param {DirEntry} root The root entry. - * @param {string} path The file path. - * @param {function(FileEntry)} successCallback The callback. - * @param {function(FileError)} errorCallback The callback. - */ -util.getOrCreateFile = function(root, path, successCallback, errorCallback) { - var dirname = null; - var basename = null; - - var onDirFound = function(dirEntry) { - dirEntry.getFile(basename, { create: true }, - successCallback, errorCallback); - }; - - var i = path.lastIndexOf('/'); - if (i > -1) { - dirname = path.substr(0, i); - basename = path.substr(i + 1); - } else { - basename = path; - } - - if (!dirname) { - onDirFound(root); - return; - } - - util.getOrCreateDirectory(root, dirname, onDirFound, errorCallback); -}; - -/** - * Locate the directory referred to by path, creating directories along the - * way. - * @param {DirEntry} root The root entry. - * @param {string} path The directory path. - * @param {function(FileEntry)} successCallback The callback. - * @param {function(FileError)} errorCallback The callback. - */ -util.getOrCreateDirectory = function(root, path, successCallback, - errorCallback) { - var names = path.split('/'); - - var getOrCreateNextName = function(dir) { - if (!names.length) - return successCallback(dir); - - var name; - do { - name = names.shift(); - } while (!name || name == '.'); - - dir.getDirectory(name, { create: true }, getOrCreateNextName, - errorCallback); - }; - - getOrCreateNextName(root); -}; - -/** - * Renames the entry to newName. - * @param {Entry} entry The entry to be renamed. - * @param {string} newName The new name. - * @param {function(Entry)} successCallback Callback invoked when the rename - * is successfully done. - * @param {function(FileError)} errorCallback Callback invoked when an error - * is found. - */ -util.rename = function(entry, newName, successCallback, errorCallback) { - entry.getParent(function(parent) { - // Before moving, we need to check if there is an existing entry at - // parent/newName, since moveTo will overwrite it. - // Note that this way has some timing issue. After existing check, - // a new entry may be create on background. However, there is no way not to - // overwrite the existing file, unfortunately. The risk should be low, - // assuming the unsafe period is very short. - (entry.isFile ? parent.getFile : parent.getDirectory).call( - parent, newName, {create: false}, - function(entry) { - // The entry with the name already exists. - errorCallback(util.createFileError(FileError.PATH_EXISTS_ERR)); - }, - function(error) { - if (error.code != FileError.NOT_FOUND_ERR) { - // Unexpected error is found. - errorCallback(error); - return; - } - - // No existing entry is found. - entry.moveTo(parent, newName, successCallback, errorCallback); - }); - }, errorCallback); -}; - -/** - * Remove a file or a directory. - * @param {Entry} entry The entry to remove. - * @param {function()} onSuccess The success callback. - * @param {function(FileError)} onError The error callback. - */ -util.removeFileOrDirectory = function(entry, onSuccess, onError) { - if (entry.isDirectory) - entry.removeRecursively(onSuccess, onError); - else - entry.remove(onSuccess, onError); -}; - -/** - * Checks if an entry exists at |relativePath| in |dirEntry|. - * If exists, tries to deduplicate the path by inserting parenthesized number, - * such as " (1)", before the extension. If it still exists, tries the - * deduplication again by increasing the number up to 10 times. - * For example, suppose "file.txt" is given, "file.txt", "file (1).txt", - * "file (2).txt", ..., "file (9).txt" will be tried. - * - * @param {DirectoryEntry} dirEntry The target directory entry. - * @param {string} relativePath The path to be deduplicated. - * @param {function(string)} onSuccess Called with the deduplicated path on - * success. - * @param {function(FileError)} onError Called on error. - */ -util.deduplicatePath = function(dirEntry, relativePath, onSuccess, onError) { - // The trial is up to 10. - var MAX_RETRY = 10; - - // Crack the path into three part. The parenthesized number (if exists) will - // be replaced by incremented number for retry. For example, suppose - // |relativePath| is "file (10).txt", the second check path will be - // "file (11).txt". - var match = /^(.*?)(?: \((\d+)\))?(\.[^.]*?)?$/.exec(relativePath); - var prefix = match[1]; - var copyNumber = match[2] ? parseInt(match[2], 10) : 0; - var ext = match[3] ? match[3] : ''; - - // The path currently checking the existence. - var trialPath = relativePath; - - var onNotResolved = function(err) { - // We expect to be unable to resolve the target file, since we're going - // to create it during the copy. However, if the resolve fails with - // anything other than NOT_FOUND, that's trouble. - if (err.code != FileError.NOT_FOUND_ERR) { - onError(err); - return; - } - - // Found a path that doesn't exist. - onSuccess(trialPath); - }; - - var numRetry = MAX_RETRY; - var onResolved = function(entry) { - if (--numRetry == 0) { - // Hit the limit of the number of retrial. - // Note that we cannot create FileError object directly, so here we use - // Object.create instead. - onError(util.createFileError(FileError.PATH_EXISTS_ERR)); - return; - } - - ++copyNumber; - trialPath = prefix + ' (' + copyNumber + ')' + ext; - util.resolvePath(dirEntry, trialPath, onResolved, onNotResolved); - }; - - // Check to see if the target exists. - util.resolvePath(dirEntry, trialPath, onResolved, onNotResolved); -}; - -/** - * Convert a number of bytes into a human friendly format, using the correct - * number separators. - * - * @param {number} bytes The number of bytes. - * @return {string} Localized string. - */ -util.bytesToString = function(bytes) { - // Translation identifiers for size units. - var UNITS = ['SIZE_BYTES', - 'SIZE_KB', - 'SIZE_MB', - 'SIZE_GB', - 'SIZE_TB', - 'SIZE_PB']; - - // Minimum values for the units above. - var STEPS = [0, - Math.pow(2, 10), - Math.pow(2, 20), - Math.pow(2, 30), - Math.pow(2, 40), - Math.pow(2, 50)]; - - var str = function(n, u) { - // TODO(rginda): Switch to v8Locale's number formatter when it's - // available. - return strf(u, n.toLocaleString()); - }; - - var fmt = function(s, u) { - var rounded = Math.round(bytes / s * 10) / 10; - return str(rounded, u); - }; - - // Less than 1KB is displayed like '80 bytes'. - if (bytes < STEPS[1]) { - return str(bytes, UNITS[0]); - } - - // Up to 1MB is displayed as rounded up number of KBs. - if (bytes < STEPS[2]) { - var rounded = Math.ceil(bytes / STEPS[1]); - return str(rounded, UNITS[1]); - } - - // This loop index is used outside the loop if it turns out |bytes| - // requires the largest unit. - var i; - - for (i = 2 /* MB */; i < UNITS.length - 1; i++) { - if (bytes < STEPS[i + 1]) - return fmt(STEPS[i], UNITS[i]); - } - - return fmt(STEPS[i], UNITS[i]); -}; - -/** - * Utility function to read specified range of bytes from file - * @param {File} file The file to read. - * @param {number} begin Starting byte(included). - * @param {number} end Last byte(excluded). - * @param {function(File, Uint8Array)} callback Callback to invoke. - * @param {function(FileError)} onError Error handler. - */ -util.readFileBytes = function(file, begin, end, callback, onError) { - var fileReader = new FileReader(); - fileReader.onerror = onError; - fileReader.onloadend = function() { - callback(file, new ByteReader(fileReader.result)); - }; - fileReader.readAsArrayBuffer(file.slice(begin, end)); -}; - -/** - * Write a blob to a file. - * Truncates the file first, so the previous content is fully overwritten. - * @param {FileEntry} entry File entry. - * @param {Blob} blob The blob to write. - * @param {function(Event)} onSuccess Completion callback. The first argument is - * a 'writeend' event. - * @param {function(FileError)} onError Error handler. - */ -util.writeBlobToFile = function(entry, blob, onSuccess, onError) { - var truncate = function(writer) { - writer.onerror = onError; - writer.onwriteend = write.bind(null, writer); - writer.truncate(0); - }; - - var write = function(writer) { - writer.onwriteend = onSuccess; - writer.write(blob); - }; - - entry.createWriter(truncate, onError); -}; - -/** - * Returns a string '[Ctrl-][Alt-][Shift-][Meta-]' depending on the event - * modifiers. Convenient for writing out conditions in keyboard handlers. - * - * @param {Event} event The keyboard event. - * @return {string} Modifiers. - */ -util.getKeyModifiers = function(event) { - return (event.ctrlKey ? 'Ctrl-' : '') + - (event.altKey ? 'Alt-' : '') + - (event.shiftKey ? 'Shift-' : '') + - (event.metaKey ? 'Meta-' : ''); -}; - -/** - * @param {HTMLElement} element Element to transform. - * @param {Object} transform Transform object, - * contains scaleX, scaleY and rotate90 properties. - */ -util.applyTransform = function(element, transform) { - element.style.webkitTransform = - transform ? 'scaleX(' + transform.scaleX + ') ' + - 'scaleY(' + transform.scaleY + ') ' + - 'rotate(' + transform.rotate90 * 90 + 'deg)' : - ''; -}; - -/** - * Makes filesystem: URL from the path. - * @param {string} path File or directory path. - * @return {string} URL. - */ -util.makeFilesystemUrl = function(path) { - path = path.split('/').map(encodeURIComponent).join('/'); - var prefix = 'external'; - return 'filesystem:' + chrome.runtime.getURL(prefix + path); -}; - -/** - * Extracts path from filesystem: URL. - * @param {string} url Filesystem URL. - * @return {string} The path. - */ -util.extractFilePath = function(url) { - var match = - /^filesystem:[\w-]*:\/\/[\w]*\/(external|persistent|temporary)(\/.*)$/. - exec(url); - var path = match && match[2]; - if (!path) return null; - return decodeURIComponent(path); -}; - -/** - * Traverses a directory tree whose root is the given entry, and invokes - * callback for each entry. Upon completion, successCallback will be called. - * On error, errorCallback will be called. - * - * @param {Entry} entry The root entry. - * @param {function(Entry):boolean} callback Callback invoked for each entry. - * If this returns false, entries under it won't be traversed. Note that - * its siblings (and their children) will be still traversed. - * @param {function()} successCallback Called upon successful completion. - * @param {function(error)} errorCallback Called upon error. - */ -util.traverseTree = function(entry, callback, successCallback, errorCallback) { - if (!callback(entry)) { - successCallback(); - return; - } - - util.forEachDirEntry( - entry, - function(child, iterationCallback) { - util.traverseTree(child, callback, iterationCallback, errorCallback); - }, - successCallback, - errorCallback); -}; - -/** - * A shortcut function to create a child element with given tag and class. - * - * @param {HTMLElement} parent Parent element. - * @param {string=} opt_className Class name. - * @param {string=} opt_tag Element tag, DIV is omitted. - * @return {Element} Newly created element. - */ -util.createChild = function(parent, opt_className, opt_tag) { - var child = parent.ownerDocument.createElement(opt_tag || 'div'); - if (opt_className) - child.className = opt_className; - parent.appendChild(child); - return child; -}; - -/** - * Update the app state. - * - * @param {string} path Path to be put in the address bar after the hash. - * If null the hash is left unchanged. - * @param {string|Object=} opt_param Search parameter. Used directly if string, - * stringified if object. If omitted the search query is left unchanged. - */ -util.updateAppState = function(path, opt_param) { - window.appState = window.appState || {}; - if (typeof opt_param == 'string') - window.appState.params = {}; - else if (typeof opt_param == 'object') - window.appState.params = opt_param; - if (path) - window.appState.defaultPath = path; - util.saveAppState(); - return; -}; - -/** - * Return a translated string. - * - * Wrapper function to make dealing with translated strings more concise. - * Equivalent to loadTimeData.getString(id). - * - * @param {string} id The id of the string to return. - * @return {string} The translated string. - */ -function str(id) { - return loadTimeData.getString(id); -} - -/** - * Return a translated string with arguments replaced. - * - * Wrapper function to make dealing with translated strings more concise. - * Equivalent to loadTimeData.getStringF(id, ...). - * - * @param {string} id The id of the string to return. - * @param {...string} var_args The values to replace into the string. - * @return {string} The translated string with replaced values. - */ -function strf(id, var_args) { - return loadTimeData.getStringF.apply(loadTimeData, arguments); -} - -/** - * Adapter object that abstracts away the the difference between Chrome app APIs - * v1 and v2. Is only necessary while the migration to v2 APIs is in progress. - * TODO(mtomasz): Clean up this. crbug.com/240606. - */ -util.platform = { - /** - * @return {boolean} True if Files.app is running as an open files or a select - * folder dialog. False otherwise. - */ - runningInBrowser: function() { - return !window.appID; - }, - - /** - * @param {function(Object)} callback Function accepting a preference map. - */ - getPreferences: function(callback) { - chrome.storage.local.get(callback); - }, - - /** - * @param {string} key Preference name. - * @param {function(string)} callback Function accepting the preference value. - */ - getPreference: function(key, callback) { - chrome.storage.local.get(key, function(items) { - callback(items[key]); - }); - }, - - /** - * @param {string} key Preference name. - * @param {string|Object} value Preference value. - * @param {function()=} opt_callback Completion callback. - */ - setPreference: function(key, value, opt_callback) { - if (typeof value != 'string') - value = JSON.stringify(value); - - var items = {}; - items[key] = value; - chrome.storage.local.set(items, opt_callback); - } -}; - -/** - * Attach page load handler. - * @param {function()} handler Application-specific load handler. - */ -util.addPageLoadHandler = function(handler) { - document.addEventListener('DOMContentLoaded', function() { - handler(); - }); -}; - -/** - * Save app launch data to the local storage. - */ -util.saveAppState = function() { - if (window.appState) - util.platform.setPreference(window.appID, window.appState); -}; - -/** - * AppCache is a persistent timestamped key-value storage backed by - * HTML5 local storage. - * - * It is not designed for frequent access. In order to avoid costly - * localStorage iteration all data is kept in a single localStorage item. - * There is no in-memory caching, so concurrent access is _almost_ safe. - * - * TODO(kaznacheev) Reimplement this based on Indexed DB. - */ -util.AppCache = function() {}; - -/** - * Local storage key. - */ -util.AppCache.KEY = 'AppCache'; - -/** - * Max number of items. - */ -util.AppCache.CAPACITY = 100; - -/** - * Default lifetime. - */ -util.AppCache.LIFETIME = 30 * 24 * 60 * 60 * 1000; // 30 days. - -/** - * @param {string} key Key. - * @param {function(number)} callback Callback accepting a value. - */ -util.AppCache.getValue = function(key, callback) { - util.AppCache.read_(function(map) { - var entry = map[key]; - callback(entry && entry.value); - }); -}; - -/** - * Update the cache. - * - * @param {string} key Key. - * @param {string} value Value. Remove the key if value is null. - * @param {number=} opt_lifetime Maximum time to keep an item (in milliseconds). - */ -util.AppCache.update = function(key, value, opt_lifetime) { - util.AppCache.read_(function(map) { - if (value != null) { - map[key] = { - value: value, - expire: Date.now() + (opt_lifetime || util.AppCache.LIFETIME) - }; - } else if (key in map) { - delete map[key]; - } else { - return; // Nothing to do. - } - util.AppCache.cleanup_(map); - util.AppCache.write_(map); - }); -}; - -/** - * @param {function(Object)} callback Callback accepting a map of timestamped - * key-value pairs. - * @private - */ -util.AppCache.read_ = function(callback) { - util.platform.getPreference(util.AppCache.KEY, function(json) { - if (json) { - try { - callback(JSON.parse(json)); - } catch (e) { - // The local storage item somehow got messed up, start fresh. - } - } - callback({}); - }); -}; - -/** - * @param {Object} map A map of timestamped key-value pairs. - * @private - */ -util.AppCache.write_ = function(map) { - util.platform.setPreference(util.AppCache.KEY, JSON.stringify(map)); -}; - -/** - * Remove over-capacity and obsolete items. - * - * @param {Object} map A map of timestamped key-value pairs. - * @private - */ -util.AppCache.cleanup_ = function(map) { - // Sort keys by ascending timestamps. - var keys = []; - for (var key in map) { - if (map.hasOwnProperty(key)) - keys.push(key); - } - keys.sort(function(a, b) { return map[a].expire > map[b].expire }); - - var cutoff = Date.now(); - - var obsolete = 0; - while (obsolete < keys.length && - map[keys[obsolete]].expire < cutoff) { - obsolete++; - } - - var overCapacity = Math.max(0, keys.length - util.AppCache.CAPACITY); - - var itemsToDelete = Math.max(obsolete, overCapacity); - for (var i = 0; i != itemsToDelete; i++) { - delete map[keys[i]]; - } -}; - -/** - * Load an image. - * - * @param {Image} image Image element. - * @param {string} url Source url. - * @param {Object=} opt_options Hash array of options, eg. width, height, - * maxWidth, maxHeight, scale, cache. - * @param {function()=} opt_isValid Function returning false iff the task - * is not valid and should be aborted. - * @return {?number} Task identifier or null if fetched immediately from - * cache. - */ -util.loadImage = function(image, url, opt_options, opt_isValid) { - return ImageLoaderClient.loadToImage(url, - image, - opt_options || {}, - function() {}, - function() { image.onerror(); }, - opt_isValid); -}; - -/** - * Cancels loading an image. - * @param {number} taskId Task identifier returned by util.loadImage(). - */ -util.cancelLoadImage = function(taskId) { - ImageLoaderClient.getInstance().cancel(taskId); -}; - -/** - * Finds proerty descriptor in the object prototype chain. - * @param {Object} object The object. - * @param {string} propertyName The property name. - * @return {Object} Property descriptor. - */ -util.findPropertyDescriptor = function(object, propertyName) { - for (var p = object; p; p = Object.getPrototypeOf(p)) { - var d = Object.getOwnPropertyDescriptor(p, propertyName); - if (d) - return d; - } - return null; -}; - -/** - * Calls inherited property setter (useful when property is - * overriden). - * @param {Object} object The object. - * @param {string} propertyName The property name. - * @param {*} value Value to set. - */ -util.callInheritedSetter = function(object, propertyName, value) { - var d = util.findPropertyDescriptor(Object.getPrototypeOf(object), - propertyName); - d.set.call(object, value); -}; - -/** - * Returns true if the board of the device matches the given prefix. - * @param {string} boardPrefix The board prefix to match against. - * (ex. "x86-mario". Prefix is used as the actual board name comes with - * suffix like "x86-mario-something". - * @return {boolean} True if the board of the device matches the given prefix. - */ -util.boardIs = function(boardPrefix) { - // The board name should be lower-cased, but making it case-insensitive for - // backward compatibility just in case. - var board = str('CHROMEOS_RELEASE_BOARD'); - var pattern = new RegExp('^' + boardPrefix, 'i'); - return board.match(pattern) != null; -}; - -/** - * Adds an isFocused method to the current window object. - */ -util.addIsFocusedMethod = function() { - var focused = true; - - window.addEventListener('focus', function() { - focused = true; - }); - - window.addEventListener('blur', function() { - focused = false; - }); - - /** - * @return {boolean} True if focused. - */ - window.isFocused = function() { - return focused; - }; -}; - -/** - * Makes a redirect to the specified Files.app's window from another window. - * @param {number} id Window id. - * @param {string} url Target url. - * @return {boolean} True if the window has been found. False otherwise. - */ -util.redirectMainWindow = function(id, url) { - // TODO(mtomasz): Implement this for Apps V2, once the photo importer is - // restored. - return false; -}; - -/** - * Checks, if the Files.app's window is in a full screen mode. - * - * @param {AppWindow} appWindow App window to be maximized. - * @return {boolean} True if the full screen mode is enabled. - */ -util.isFullScreen = function(appWindow) { - if (appWindow) { - return appWindow.isFullscreen(); - } else { - console.error('App window not passed. Unable to check status of ' + - 'the full screen mode.'); - return false; - } -}; - -/** - * Toggles the full screen mode. - * - * @param {AppWindow} appWindow App window to be maximized. - * @param {boolean} enabled True for enabling, false for disabling. - */ -util.toggleFullScreen = function(appWindow, enabled) { - if (appWindow) { - if (enabled) - appWindow.fullscreen(); - else - appWindow.restore(); - return; - } - - console.error( - 'App window not passed. Unable to toggle the full screen mode.'); -}; - -/** - * The type of a file operation. - * @enum {string} - */ -util.FileOperationType = { - COPY: 'COPY', - MOVE: 'MOVE', - ZIP: 'ZIP', -}; - -/** - * The type of a file operation error. - * @enum {number} - */ -util.FileOperationErrorType = { - UNEXPECTED_SOURCE_FILE: 0, - TARGET_EXISTS: 1, - FILESYSTEM_ERROR: 2, -}; - -/** - * The kind of an entry changed event. - * @enum {number} - */ -util.EntryChangedKind = { - CREATED: 0, - DELETED: 1, -}; - -/** - * Obtains whether an entry is fake or not. - * @param {Entry|Object} entry Entry of fake entry. - * @return {boolean} True if the given entry is fake. - */ -util.isFakeEntry = function(entry) { - return !('getParent' in entry); -}; - -/** - * Creates a FileError instance with given code. - * Note that we cannot create FileError instance by "new FileError(code)", - * unfortunately, so here we use Object.create. - * @param {number} code Error code for the FileError. - * @return {FileError} FileError instance - */ -util.createFileError = function(code) { - return Object.create(FileError.prototype, { - code: { get: function() { return code; } } - }); -}; - -/** - * Compares two entries. - * @param {Entry|Object} entry1 The entry to be compared. Can be a fake. - * @param {Entry|Object} entry2 The entry to be compared. Can be a fake. - * @return {boolean} True if the both entry represents a same file or - * directory. Returns true if both entries are null. - */ -util.isSameEntry = function(entry1, entry2) { - // Currently, we can assume there is only one root. - // When we support multi-file system, we need to look at filesystem, too. - return (entry1 && entry2 && entry1.fullPath === entry2.fullPath) || - (!entry1 && !entry2); -}; - -/** - * @param {Entry|Object} parent The parent entry. Can be a fake. - * @param {Entry|Object} child The child entry. Can be a fake. - * @return {boolean} True if parent entry is actualy the parent of the child - * entry. - */ -util.isParentEntry = function(parent, child) { - // Currently, we can assume there is only one root. - // When we support multi-file system, we need to look at filesystem, too. - return PathUtil.isParentPath(parent.fullPath, child.fullPath); -}; - -/** - * Views files in the browser. - * - * @param {Array.<string>} urls URLs of files to view. - * @param {function(bool)} callback Callback notifying success or not. - */ -util.viewFilesInBrowser = function(urls, callback) { - var taskId = chrome.runtime.id + '|file|view-in-browser'; - chrome.fileBrowserPrivate.executeTask(taskId, urls, callback); -}; - -/** - * Visit the URL. - * - * If the browser is opening, the url is opened in a new tag, otherwise the url - * is opened in a new window. - * - * @param {string} url URL to visit. - */ -util.visitURL = function(url) { - var params = {url: url}; - chrome.tabs.create(params, function() { - if (chrome.runtime.lastError) - chrome.windows.create(params); - }); -}; - -/** - * Returns normalized current locale, or default locale - 'en'. - * @return {string} Current locale - */ -util.getCurrentLocaleOrDefault = function() { - // chrome.i18n.getMessage('@@ui_locale') can't be used in packed app. - // Instead, we pass it from C++-side with strings. - return str('UI_LOCALE') || 'en'; -}; - -/** - * Converts array of entries to an array of corresponding URLs. - * @param {Array.<Entry>} entries Input array of entries. - * @return {Array.<string>} Output array of URLs. - */ -util.entriesToURLs = function(entries) { - // TODO(mtomasz): Make all callers use entries instead of URLs, and then - // remove this utility function. - console.warn('Converting entries to URLs is deprecated.'); - return entries.map(function(entry) { - return entry.toURL(); - }); -}; - -/** - * Converts array of URLs to an array of corresponding Entries. - * - * @param {Array.<string>} urls Input array of URLs. - * @param {function(Array.<Entry>)} callback Completion callback with array of - * Entries. - */ -util.URLsToEntries = function(urls, callback) { - var result = []; - AsyncUtil.forEach( - urls, - function(forEachCallback, url) { - webkitResolveLocalFileSystemURL(url, function(entry) { - result.push(entry); - forEachCallback(); - }, function() { - // Not an error. Possibly, the file is not accessible anymore. - console.warn('Failed to resolve the file with url: ' + url + '.'); - forEachCallback(); - }); - }, - function() { - callback(result); - }); -}; - -/** - * Error type of VolumeManager. - * @enum {string} - * @const - */ -util.VolumeError = Object.freeze({ - /* Internal errors */ - NOT_MOUNTED: 'not_mounted', - TIMEOUT: 'timeout', - - /* System events */ - UNKNOWN: 'error_unknown', - INTERNAL: 'error_internal', - UNKNOWN_FILESYSTEM: 'error_unknown_filesystem', - UNSUPPORTED_FILESYSTEM: 'error_unsupported_filesystem', - INVALID_ARCHIVE: 'error_invalid_archive', - AUTHENTICATION: 'error_authentication', - PATH_UNMOUNTED: 'error_path_unmounted' -}); - -/** - * List of connection types of drive. - * - * Keep this in sync with the kDriveConnectionType* constants in - * private_api_dirve.cc. - * - * @enum {string} - * @const - */ -util.DriveConnectionType = Object.freeze({ - OFFLINE: 'offline', // Connection is offline or drive is unavailable. - METERED: 'metered', // Connection is metered. Should limit traffic. - ONLINE: 'online' // Connection is online. -}); - -/** - * List of reasons of DriveConnectionType. - * - * Keep this in sync with the kDriveConnectionReason constants in - * private_api_drive.cc. - * - * @enum {string} - * @const - */ -util.DriveConnectionReason = Object.freeze({ - NOT_READY: 'not_ready', // Drive is not ready or authentication is failed. - NO_NETWORK: 'no_network', // Network connection is unavailable. - NO_SERVICE: 'no_service' // Drive service is unavailable. -}); - -/** - * The type of each volume. - * @enum {string} - * @const - */ -util.VolumeType = Object.freeze({ - DRIVE: 'drive', - DOWNLOADS: 'downloads', - REMOVABLE: 'removable', - ARCHIVE: 'archive' -}); |