OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_FILE_MANAGER_UTIL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_FILE_MANAGER_UTIL_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/file_path.h" |
| 10 #include "chrome/browser/ui/shell_dialogs.h" |
| 11 #include "googleurl/src/gurl.h" |
| 12 |
| 13 class Profile; |
| 14 |
| 15 // Helper class for wiring file browser component extension with the rest of UI. |
| 16 class FileManagerUtil { |
| 17 public: |
| 18 // Gets base file browser url for. |
| 19 static GURL GetFileBrowserUrlWithParams( |
| 20 SelectFileDialog::Type type, |
| 21 const string16& title, |
| 22 const FilePath& default_path, |
| 23 const SelectFileDialog::FileTypeInfo* file_types, |
| 24 int file_type_index, |
| 25 const FilePath::StringType& default_extension); |
| 26 |
| 27 // Opens file browser UI in its own tab on file system location defined with |
| 28 // |default_path|. |
| 29 static void ShowFullTabUrl(Profile* profile, |
| 30 const FilePath& default_path); |
| 31 |
| 32 private: |
| 33 FileManagerUtil() {} |
| 34 // Helper to convert numeric dialog type to a string. |
| 35 static std::string GetDialogTypeAsString(SelectFileDialog::Type dialog_type); |
| 36 // Gets base file browser url. |
| 37 static GURL GetFileBrowserUrl(); |
| 38 // Help to convert potential dialog arguments into json. |
| 39 static std::string GetArgumentsJson( |
| 40 SelectFileDialog::Type type, |
| 41 const string16& title, |
| 42 const FilePath& default_path, |
| 43 const SelectFileDialog::FileTypeInfo* file_types, |
| 44 int file_type_index, |
| 45 const FilePath::StringType& default_extension); |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(FileManagerUtil); |
| 48 }; |
| 49 |
| 50 #endif // CHROME_BROWSER_EXTENSIONS_FILE_MANAGER_UTIL_H_ |
OLD | NEW |