OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/drive/drive_api_util.h" | 5 #include "chrome/browser/drive/drive_api_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 const char* mime_type; | 29 const char* mime_type; |
30 const char* extension; | 30 const char* extension; |
31 }; | 31 }; |
32 | 32 |
33 const HostedDocumentKind kHostedDocumentKinds[] = { | 33 const HostedDocumentKind kHostedDocumentKinds[] = { |
34 {kGoogleDocumentMimeType, ".gdoc"}, | 34 {kGoogleDocumentMimeType, ".gdoc"}, |
35 {kGoogleSpreadsheetMimeType, ".gsheet"}, | 35 {kGoogleSpreadsheetMimeType, ".gsheet"}, |
36 {kGooglePresentationMimeType, ".gslides"}, | 36 {kGooglePresentationMimeType, ".gslides"}, |
37 {kGoogleDrawingMimeType, ".gdraw"}, | 37 {kGoogleDrawingMimeType, ".gdraw"}, |
38 {kGoogleTableMimeType, ".gtable"}, | 38 {kGoogleTableMimeType, ".gtable"}, |
39 {kGoogleFormMimeType, ".gform"} | 39 {kGoogleFormMimeType, ".gform"}, |
| 40 {kGoogleMapMimeType, ".gmaps"}, |
40 }; | 41 }; |
41 | 42 |
42 const char kUnknownHostedDocumentExtension[] = ".glink"; | 43 const char kUnknownHostedDocumentExtension[] = ".glink"; |
43 | 44 |
44 } // namespace | 45 } // namespace |
45 | 46 |
46 std::string EscapeQueryStringValue(const std::string& str) { | 47 std::string EscapeQueryStringValue(const std::string& str) { |
47 std::string result; | 48 std::string result; |
48 result.reserve(str.size()); | 49 result.reserve(str.size()); |
49 for (size_t i = 0; i < str.size(); ++i) { | 50 for (size_t i = 0; i < str.size(); ++i) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 const std::string extension = base::FilePath(path.Extension()).AsUTF8Unsafe(); | 331 const std::string extension = base::FilePath(path.Extension()).AsUTF8Unsafe(); |
331 for (size_t i = 0; i < arraysize(kHostedDocumentKinds); ++i) { | 332 for (size_t i = 0; i < arraysize(kHostedDocumentKinds); ++i) { |
332 if (extension == kHostedDocumentKinds[i].extension) | 333 if (extension == kHostedDocumentKinds[i].extension) |
333 return true; | 334 return true; |
334 } | 335 } |
335 return extension == kUnknownHostedDocumentExtension; | 336 return extension == kUnknownHostedDocumentExtension; |
336 } | 337 } |
337 | 338 |
338 } // namespace util | 339 } // namespace util |
339 } // namespace drive | 340 } // namespace drive |
OLD | NEW |