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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 361 } |
362 | 362 |
363 bool IsHostedDocument(const std::string& mime_type) { | 363 bool IsHostedDocument(const std::string& mime_type) { |
364 for (size_t i = 0; i < arraysize(kHostedDocumentKinds); ++i) { | 364 for (size_t i = 0; i < arraysize(kHostedDocumentKinds); ++i) { |
365 if (mime_type == kHostedDocumentKinds[i].mime_type) | 365 if (mime_type == kHostedDocumentKinds[i].mime_type) |
366 return true; | 366 return true; |
367 } | 367 } |
368 return false; | 368 return false; |
369 } | 369 } |
370 | 370 |
371 bool IsHostedDocumentByExtension(const std::string& extension) { | 371 bool HasHostedDocumentExtension(const base::FilePath& path) { |
| 372 const std::string extension = base::FilePath(path.Extension()).AsUTF8Unsafe(); |
372 for (size_t i = 0; i < arraysize(kHostedDocumentKinds); ++i) { | 373 for (size_t i = 0; i < arraysize(kHostedDocumentKinds); ++i) { |
373 if (extension == kHostedDocumentKinds[i].extension) | 374 if (extension == kHostedDocumentKinds[i].extension) |
374 return true; | 375 return true; |
375 } | 376 } |
376 return false; | 377 return false; |
377 } | 378 } |
378 | 379 |
379 } // namespace util | 380 } // namespace util |
380 } // namespace drive | 381 } // namespace drive |
OLD | NEW |