| 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_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 SelectFileDialog::Type type, | 47 SelectFileDialog::Type type, |
| 48 const string16& title, | 48 const string16& title, |
| 49 const FilePath& default_virtual_path, | 49 const FilePath& default_virtual_path, |
| 50 const SelectFileDialog::FileTypeInfo* file_types, | 50 const SelectFileDialog::FileTypeInfo* file_types, |
| 51 int file_type_index, | 51 int file_type_index, |
| 52 const FilePath::StringType& default_extension); | 52 const FilePath::StringType& default_extension); |
| 53 | 53 |
| 54 // Get file dialog title string from its type. | 54 // Get file dialog title string from its type. |
| 55 string16 GetTitleFromType(SelectFileDialog::Type type); | 55 string16 GetTitleFromType(SelectFileDialog::Type type); |
| 56 | 56 |
| 57 // Opens file browser UI on its own tab on drive location defined with | 57 // Shows a freshly mounted removable drive. |
| 58 // |dir|. Automatically closes this tab on |dir| unmount. | 58 // If there is another File Browser instance open this call does nothing. |
| 59 void ViewRemovableDrive(const FilePath& dir); | 59 // The mount event will cause file_manager.js to show the new drive in |
| 60 // the left panel, and that is all we want. |
| 61 // If there is no File Browser open, this call opens a new one pointing to |
| 62 // |path|. In this case the tab will automatically close on |path| unmount. |
| 63 void ViewRemovableDrive(const FilePath& path); |
| 60 | 64 |
| 61 // Opens file browser UI in its own tab on file system location defined with | 65 // Opens file browser UI in its own tab on file system location defined with |
| 62 // |dir|. | 66 // |dir|. |
| 63 void ViewFolder(const FilePath& dir); | 67 void ViewFolder(const FilePath& dir); |
| 64 | 68 |
| 65 // Opens file in the browser. | 69 // Opens file with the default File Browser handler. |
| 66 // TODO(kaznacheev): remove the obsolete enqueue parameter. | 70 // TODO(kaznacheev) remove the deprecated_enqueue parameter. |
| 67 void ViewFile(const FilePath& full_path, bool enqueue); | 71 void ViewFile(const FilePath& path, bool deprecated_enqueue); |
| 72 |
| 73 // Opens file browser on the folder containing the file, with the file selected. |
| 74 void ShowFileInFolder(const FilePath& path); |
| 68 | 75 |
| 69 // Tries to open |file| directly in the browser. Returns false if the browser | 76 // Tries to open |file| directly in the browser. Returns false if the browser |
| 70 // can't directly handle this type of file. | 77 // can't directly handle this type of file. |
| 71 bool TryViewingFile(const FilePath& file); | 78 bool TryViewingFile(Profile* profile, const FilePath& path); |
| 72 | 79 |
| 73 void InstallCRX(Profile* profile, const FilePath& full_path); | 80 void InstallCRX(Profile* profile, const FilePath& path); |
| 74 | 81 |
| 75 bool ShouldBeOpenedWithPdfPlugin(const char* file_extension); | 82 bool ShouldBeOpenedWithPdfPlugin(Profile* profile, const char* file_extension); |
| 76 | 83 |
| 77 // Converts the vector of progress status to their JSON (Value) form. | 84 // Converts the vector of progress status to their JSON (Value) form. |
| 78 base::ListValue* ProgressStatusVectorToListValue( | 85 base::ListValue* ProgressStatusVectorToListValue( |
| 79 Profile* profile, const GURL& origin_url, | 86 Profile* profile, const GURL& origin_url, |
| 80 const std::vector<gdata::GDataOperationRegistry::ProgressStatus>& list); | 87 const std::vector<gdata::GDataOperationRegistry::ProgressStatus>& list); |
| 81 | 88 |
| 82 } // namespace file_manager_util | 89 } // namespace file_manager_util |
| 83 | 90 |
| 84 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_UTIL_H_ | 91 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_UTIL_H_ |
| OLD | NEW |