| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/file_manager/open_with_browser.h" | 5 #include "chrome/browser/chromeos/file_manager/open_with_browser.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 FILE_PATH_LITERAL(".jpg"), | 45 FILE_PATH_LITERAL(".jpg"), |
| 46 FILE_PATH_LITERAL(".jpeg"), | 46 FILE_PATH_LITERAL(".jpeg"), |
| 47 FILE_PATH_LITERAL(".png"), | 47 FILE_PATH_LITERAL(".png"), |
| 48 FILE_PATH_LITERAL(".webp"), | 48 FILE_PATH_LITERAL(".webp"), |
| 49 FILE_PATH_LITERAL(".gif"), | 49 FILE_PATH_LITERAL(".gif"), |
| 50 FILE_PATH_LITERAL(".txt"), | 50 FILE_PATH_LITERAL(".txt"), |
| 51 FILE_PATH_LITERAL(".html"), | 51 FILE_PATH_LITERAL(".html"), |
| 52 FILE_PATH_LITERAL(".htm"), | 52 FILE_PATH_LITERAL(".htm"), |
| 53 FILE_PATH_LITERAL(".mhtml"), | 53 FILE_PATH_LITERAL(".mhtml"), |
| 54 FILE_PATH_LITERAL(".mht"), | 54 FILE_PATH_LITERAL(".mht"), |
| 55 FILE_PATH_LITERAL(".xhtml"), |
| 56 FILE_PATH_LITERAL(".xht"), |
| 57 FILE_PATH_LITERAL(".shtml"), |
| 55 FILE_PATH_LITERAL(".svg"), | 58 FILE_PATH_LITERAL(".svg"), |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 // Returns true if |file_path| is viewable in the browser (ex. HTML file). | 61 // Returns true if |file_path| is viewable in the browser (ex. HTML file). |
| 59 bool IsViewableInBrowser(const base::FilePath& file_path) { | 62 bool IsViewableInBrowser(const base::FilePath& file_path) { |
| 60 for (size_t i = 0; i < arraysize(kFileExtensionsViewableInBrowser); i++) { | 63 for (size_t i = 0; i < arraysize(kFileExtensionsViewableInBrowser); i++) { |
| 61 if (file_path.MatchesExtension(kFileExtensionsViewableInBrowser[i])) | 64 if (file_path.MatchesExtension(kFileExtensionsViewableInBrowser[i])) |
| 62 return true; | 65 return true; |
| 63 } | 66 } |
| 64 return false; | 67 return false; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); | 190 base::FilePath::FromUTF8Unsafe("dummy").AddExtension(file_extension); |
| 188 if (file_path.MatchesExtension(kPdfExtension)) | 191 if (file_path.MatchesExtension(kPdfExtension)) |
| 189 return IsPdfPluginEnabled(profile); | 192 return IsPdfPluginEnabled(profile); |
| 190 if (file_path.MatchesExtension(kSwfExtension)) | 193 if (file_path.MatchesExtension(kSwfExtension)) |
| 191 return IsFlashPluginEnabled(profile); | 194 return IsFlashPluginEnabled(profile); |
| 192 return false; | 195 return false; |
| 193 } | 196 } |
| 194 | 197 |
| 195 } // namespace util | 198 } // namespace util |
| 196 } // namespace file_manager | 199 } // namespace file_manager |
| OLD | NEW |