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 // This file provides utility functions for fileBrowserPrivate API. | 5 // This file provides utility functions for fileBrowserPrivate API. |
6 | 6 |
7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ |
8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ | 8 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // via private API. | 41 // via private API. |
42 void VolumeInfoToVolumeMetadata( | 42 void VolumeInfoToVolumeMetadata( |
43 Profile* profile, | 43 Profile* profile, |
44 const VolumeInfo& volume_info, | 44 const VolumeInfo& volume_info, |
45 extensions::api::file_browser_private::VolumeMetadata* volume_metadata); | 45 extensions::api::file_browser_private::VolumeMetadata* volume_metadata); |
46 | 46 |
47 // Returns the WebContents of the tab associated with the dispatcher. Returns | 47 // Returns the WebContents of the tab associated with the dispatcher. Returns |
48 // NULL on error. | 48 // NULL on error. |
49 content::WebContents* GetWebContents(ExtensionFunctionDispatcher* dispatcher); | 49 content::WebContents* GetWebContents(ExtensionFunctionDispatcher* dispatcher); |
50 | 50 |
51 // Returns the ID of the tab associated with the dispatcher. Returns 0 on | |
52 // error. | |
53 int32 GetTabId(ExtensionFunctionDispatcher* dispatcher); | |
54 | |
55 // Returns the local FilePath associated with |url|. If the file isn't of the | 51 // Returns the local FilePath associated with |url|. If the file isn't of the |
56 // type FileSystemBackend handles, returns an empty | 52 // type FileSystemBackend handles, returns an empty |
57 // FilePath. |render_view_host| and |profile| are needed to obtain the | 53 // FilePath. |render_view_host| and |profile| are needed to obtain the |
58 // FileSystemContext currently in use. | 54 // FileSystemContext currently in use. |
59 // | 55 // |
60 // Local paths will look like "/home/chronos/user/Downloads/foo/bar.txt" or | 56 // Local paths will look like "/home/chronos/user/Downloads/foo/bar.txt" or |
61 // "/special/drive/foo/bar.txt". | 57 // "/special/drive/foo/bar.txt". |
62 base::FilePath GetLocalPathFromURL( | 58 base::FilePath GetLocalPathFromURL( |
63 content::RenderViewHost* render_view_host, | 59 content::RenderViewHost* render_view_host, |
64 Profile* profile, | 60 Profile* profile, |
(...skipping 22 matching lines...) Expand all Loading... |
87 void GetSelectedFileInfo(content::RenderViewHost* render_view_host, | 83 void GetSelectedFileInfo(content::RenderViewHost* render_view_host, |
88 Profile* profile, | 84 Profile* profile, |
89 const std::vector<GURL>& file_urls, | 85 const std::vector<GURL>& file_urls, |
90 GetSelectedFileInfoLocalPathOption local_path_option, | 86 GetSelectedFileInfoLocalPathOption local_path_option, |
91 GetSelectedFileInfoCallback callback); | 87 GetSelectedFileInfoCallback callback); |
92 | 88 |
93 } // namespace util | 89 } // namespace util |
94 } // namespace file_manager | 90 } // namespace file_manager |
95 | 91 |
96 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ | 92 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ |
OLD | NEW |