| 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 fileManagerPrivate 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 <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 class Profile; | 15 class Profile; |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class FilePath; | 18 class FilePath; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 class RenderViewHost; | 22 class RenderViewHost; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace drive { | 25 namespace drive { |
| 26 class EventLogger; | 26 class EventLogger; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace extensions { | 29 namespace extensions { |
| 30 namespace api { | 30 namespace api { |
| 31 namespace file_browser_private { | 31 namespace file_manager_private { |
| 32 struct VolumeMetadata; | 32 struct VolumeMetadata; |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace ui { | 37 namespace ui { |
| 38 struct SelectedFileInfo; | 38 struct SelectedFileInfo; |
| 39 } | 39 } |
| 40 | 40 |
| 41 namespace file_manager { | 41 namespace file_manager { |
| 42 | 42 |
| 43 struct VolumeInfo; | 43 struct VolumeInfo; |
| 44 | 44 |
| 45 namespace util { | 45 namespace util { |
| 46 | 46 |
| 47 // Converts the |volume_info| to VolumeMetadata to communicate with JavaScript | 47 // Converts the |volume_info| to VolumeMetadata to communicate with JavaScript |
| 48 // via private API. | 48 // via private API. |
| 49 void VolumeInfoToVolumeMetadata( | 49 void VolumeInfoToVolumeMetadata( |
| 50 Profile* profile, | 50 Profile* profile, |
| 51 const VolumeInfo& volume_info, | 51 const VolumeInfo& volume_info, |
| 52 extensions::api::file_browser_private::VolumeMetadata* volume_metadata); | 52 extensions::api::file_manager_private::VolumeMetadata* volume_metadata); |
| 53 | 53 |
| 54 // Returns the local FilePath associated with |url|. If the file isn't of the | 54 // Returns the local FilePath associated with |url|. If the file isn't of the |
| 55 // type FileSystemBackend handles, returns an empty | 55 // type FileSystemBackend handles, returns an empty |
| 56 // FilePath. |render_view_host| and |profile| are needed to obtain the | 56 // FilePath. |render_view_host| and |profile| are needed to obtain the |
| 57 // FileSystemContext currently in use. | 57 // FileSystemContext currently in use. |
| 58 // | 58 // |
| 59 // Local paths will look like "/home/chronos/user/Downloads/foo/bar.txt" or | 59 // Local paths will look like "/home/chronos/user/Downloads/foo/bar.txt" or |
| 60 // "/special/drive/foo/bar.txt". | 60 // "/special/drive/foo/bar.txt". |
| 61 base::FilePath GetLocalPathFromURL(content::RenderViewHost* render_view_host, | 61 base::FilePath GetLocalPathFromURL(content::RenderViewHost* render_view_host, |
| 62 Profile* profile, | 62 Profile* profile, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 93 void SetupProfileFileAccessPermissions(int render_view_process_id, | 93 void SetupProfileFileAccessPermissions(int render_view_process_id, |
| 94 Profile* profile); | 94 Profile* profile); |
| 95 | 95 |
| 96 // Get event logger to chrome://drive-internals page for the |profile|. | 96 // Get event logger to chrome://drive-internals page for the |profile|. |
| 97 drive::EventLogger* GetLogger(Profile* profile); | 97 drive::EventLogger* GetLogger(Profile* profile); |
| 98 | 98 |
| 99 } // namespace util | 99 } // namespace util |
| 100 } // namespace file_manager | 100 } // namespace file_manager |
| 101 | 101 |
| 102 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ | 102 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_PRIVATE_API_UTIL_H_ |
| OLD | NEW |