Commit 22708903 authored by fukino's avatar fukino Committed by Commit bot

Add support for My Maps maps in Chrome OS Drive integration.

By this support, My Maps maps shown in Drive folder have correct icon, file-type description, and file extension.

BUG=397029
TEST=Manually create a form in drive.google.com and see it appears with an icon in Files.app.

Review URL: https://codereview.chromium.org/693843002

Cr-Commit-Position: refs/heads/master@{#302593}
parent b14f9258
......@@ -842,6 +842,9 @@ Press any key to continue exploring.
<message name="IDS_FILE_BROWSER_GFORM_DOCUMENT_FILE_TYPE" desc="Google form file type">
Google form
</message>
<message name="IDS_FILE_BROWSER_GMAP_DOCUMENT_FILE_TYPE" desc="Google map file type">
Google map
</message>
<message name="IDS_FILE_BROWSER_GLINK_DOCUMENT_FILE_TYPE" desc="Google Drive link file type">
Google Drive link
</message>
......
......@@ -280,6 +280,8 @@
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GENERIC_WHITE" file="cros/file_types/generic_white.png" />
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GLINK" file="cros/file_types/glink.png" />
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GLINK_WHITE" file="cros/file_types/glink_white.png" />
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GMAP" file="cros/file_types/gmap.png" />
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GMAP_WHITE" file="cros/file_types/gmap_white.png" />
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GSHEET" file="cros/file_types/gsheet.png" />
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GSHEET_WHITE" file="cros/file_types/gsheet_white.png" />
<structure type="chrome_scaled_image" name="IDR_FILETYPE_GSLIDES" file="cros/file_types/gslides.png" />
......
......@@ -429,6 +429,8 @@ bool FileManagerPrivateGetStringsFunction::RunSync() {
IDS_FILE_BROWSER_GTABLE_DOCUMENT_FILE_TYPE);
SET_STRING("GFORM_DOCUMENT_FILE_TYPE",
IDS_FILE_BROWSER_GFORM_DOCUMENT_FILE_TYPE);
SET_STRING("GMAP_DOCUMENT_FILE_TYPE",
IDS_FILE_BROWSER_GMAP_DOCUMENT_FILE_TYPE);
SET_STRING("GLINK_DOCUMENT_FILE_TYPE",
IDS_FILE_BROWSER_GLINK_DOCUMENT_FILE_TYPE);
......
......@@ -36,7 +36,8 @@ const HostedDocumentKind kHostedDocumentKinds[] = {
{kGooglePresentationMimeType, ".gslides"},
{kGoogleDrawingMimeType, ".gdraw"},
{kGoogleTableMimeType, ".gtable"},
{kGoogleFormMimeType, ".gform"}
{kGoogleFormMimeType, ".gform"},
{kGoogleMapMimeType, ".gmaps"},
};
const char kUnknownHostedDocumentExtension[] = ".glink";
......
......@@ -39,6 +39,7 @@ const char kGoogleSpreadsheetMimeType[] =
"application/vnd.google-apps.spreadsheet";
const char kGoogleTableMimeType[] = "application/vnd.google-apps.table";
const char kGoogleFormMimeType[] = "application/vnd.google-apps.form";
const char kGoogleMapMimeType[] = "application/vnd.google-apps.map";
const char kDriveFolderMimeType[] = "application/vnd.google-apps.folder";
// Escapes ' to \' in the |str|. This is designed to use for string value of
......
......@@ -177,6 +177,8 @@ TEST(DriveAPIUtilTest, HasHostedDocumentExtension) {
HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gtable")));
EXPECT_TRUE(
HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gform")));
EXPECT_TRUE(
HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gmaps")));
EXPECT_TRUE(
HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.glink")));
......@@ -186,6 +188,8 @@ TEST(DriveAPIUtilTest, HasHostedDocumentExtension) {
HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.docx")));
EXPECT_FALSE(
HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.jpg")));
EXPECT_FALSE(
HasHostedDocumentExtension(base::FilePath::FromUTF8Unsafe("xx.gmap")));
}
} // namespace util
......
......@@ -202,6 +202,20 @@ list.autocomplete-suggestions [selected] [file-type-icon='gform'] {
url('chrome://theme/IDR_FILETYPE_FORM_WHITE@2x') 2x);
}
[file-type-icon='gmap'] {
background-image: -webkit-image-set(
url('chrome://theme/IDR_FILETYPE_GMAP') 1x,
url('chrome://theme/IDR_FILETYPE_GMAP@2x') 2x);
}
tree:focus .tree-item[selected] > .tree-row > [file-type-icon='gmap'],
list:focus [selected] [file-type-icon='gmap'],
list.autocomplete-suggestions [selected] [file-type-icon='gmap'] {
background-image: -webkit-image-set(
url('chrome://theme/IDR_FILETYPE_GMAP_WHITE') 1x,
url('chrome://theme/IDR_FILETYPE_GMAP_WHITE@2x') 2x);
}
[file-type-icon='image'] {
background-image: -webkit-image-set(
url('chrome://theme/IDR_FILETYPE_IMAGE') 1x,
......
......@@ -155,6 +155,12 @@ FileType.types = [
type: 'hosted', icon: 'gform', name: 'GFORM_DOCUMENT_FILE_TYPE',
subtype: 'form', pattern: /\.gform$/i
},
{
// We use extension ".gmaps" to avoid conflict, but use singular form
// (gmap/map) in other parts to be consistent with other file type.
type: 'hosted', icon: 'gmap', name: 'GMAP_DOCUMENT_FILE_TYPE',
subtype: 'map', pattern: /\.gmaps$/i
},
// Others
{
......
......@@ -90,6 +90,7 @@
"filesystem:*.gdraw",
"filesystem:*.gtable",
"filesystem:*.gform",
"filesystem:*.gmaps",
"filesystem:*.glink"
]
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment