| 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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // directory will be opened in the file manager. If the target is a file, the | 35 // directory will be opened in the file manager. If the target is a file, the |
| 36 // file will be opened using a file handler, a file browser handler, or the | 36 // file will be opened using a file handler, a file browser handler, or the |
| 37 // browser (open in a tab). The default handler has precedence over other | 37 // browser (open in a tab). The default handler has precedence over other |
| 38 // handlers, if defined for the type of the target file. | 38 // handlers, if defined for the type of the target file. |
| 39 void OpenItem(const base::FilePath& file_path); | 39 void OpenItem(const base::FilePath& file_path); |
| 40 | 40 |
| 41 // Opens the file manager for the folder containing the item specified by | 41 // Opens the file manager for the folder containing the item specified by |
| 42 // |file_path|, with the item selected. | 42 // |file_path|, with the item selected. |
| 43 void ShowItemInFolder(const base::FilePath& file_path); | 43 void ShowItemInFolder(const base::FilePath& file_path); |
| 44 | 44 |
| 45 // Opens the file specified by |file_path| with the browser. This function takes | |
| 46 // care of the following intricacies: | |
| 47 // | |
| 48 // - If the file is a Drive hosted document, the hosted document will be | |
| 49 // opened in the browser by extracting the right URL for the file. | |
| 50 // - If the file is a CRX file, the CRX file will be installed. | |
| 51 // - If the file is on Drive, the file will be downloaded from Drive as | |
| 52 // needed. | |
| 53 // | |
| 54 // Returns false if failed to open. This happens if the file type is unknown. | |
| 55 bool OpenFileWithBrowser(Browser* browser, const base::FilePath& file_path); | |
| 56 | |
| 57 // Checks whether a pepper plugin for |file_extension| is enabled. | |
| 58 bool ShouldBeOpenedWithPlugin( | |
| 59 Profile* profile, | |
| 60 const base::FilePath::StringType& file_extension); | |
| 61 | |
| 62 // Returns the MIME type of |file_path|. Returns "" if the MIME type is | 45 // Returns the MIME type of |file_path|. Returns "" if the MIME type is |
| 63 // unknown. | 46 // unknown. |
| 64 std::string GetMimeTypeForPath(const base::FilePath& file_path); | 47 std::string GetMimeTypeForPath(const base::FilePath& file_path); |
| 65 | 48 |
| 66 } // namespace util | 49 } // namespace util |
| 67 } // namespace file_manager | 50 } // namespace file_manager |
| 68 | 51 |
| 69 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_UTIL_H_ | 52 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_UTIL_H_ |
| OLD | NEW |