| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/chromeos/file_system_provider/service.h" | 5 #include "chrome/browser/chromeos/file_system_provider/service.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 GetProvidingExtensionInfo(extension_id, &provider_info); | 165 GetProvidingExtensionInfo(extension_id, &provider_info); |
| 166 // Store the file system descriptor. Use the mount point name as the file | 166 // Store the file system descriptor. Use the mount point name as the file |
| 167 // system provider file system id. | 167 // system provider file system id. |
| 168 // Examples: | 168 // Examples: |
| 169 // file_system_id = hello_world | 169 // file_system_id = hello_world |
| 170 // mount_point_name = b33f1337-hello_world-5aa5 | 170 // mount_point_name = b33f1337-hello_world-5aa5 |
| 171 // writable = false | 171 // writable = false |
| 172 // supports_notify_tag = false | 172 // supports_notify_tag = false |
| 173 // mount_path = /provided/b33f1337-hello_world-5aa5 | 173 // mount_path = /provided/b33f1337-hello_world-5aa5 |
| 174 // configurable = true | 174 // configurable = true |
| 175 // watchable = true |
| 175 // source = SOURCE_FILE | 176 // source = SOURCE_FILE |
| 176 ProvidedFileSystemInfo file_system_info( | 177 ProvidedFileSystemInfo file_system_info( |
| 177 extension_id, options, mount_path, | 178 extension_id, options, mount_path, |
| 178 provider_info.capabilities.configurable(), | 179 provider_info.capabilities.configurable(), |
| 180 provider_info.capabilities.watchable(), |
| 179 provider_info.capabilities.source()); | 181 provider_info.capabilities.source()); |
| 180 | 182 |
| 181 ProvidedFileSystemInterface* file_system = | 183 ProvidedFileSystemInterface* file_system = |
| 182 file_system_factory_.Run(profile_, file_system_info); | 184 file_system_factory_.Run(profile_, file_system_info); |
| 183 DCHECK(file_system); | 185 DCHECK(file_system); |
| 184 file_system_map_[FileSystemKey(extension_id, options.file_system_id)] = | 186 file_system_map_[FileSystemKey(extension_id, options.file_system_id)] = |
| 185 file_system; | 187 file_system; |
| 186 mount_point_name_to_key_map_[mount_point_name] = | 188 mount_point_name_to_key_map_[mount_point_name] = |
| 187 FileSystemKey(extension_id, options.file_system_id); | 189 FileSystemKey(extension_id, options.file_system_id); |
| 188 registry_->RememberFileSystem(file_system_info, *file_system->GetWatchers()); | 190 registry_->RememberFileSystem(file_system_info, *file_system->GetWatchers()); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 455 } |
| 454 | 456 |
| 455 void Service::OnWatcherListChanged( | 457 void Service::OnWatcherListChanged( |
| 456 const ProvidedFileSystemInfo& file_system_info, | 458 const ProvidedFileSystemInfo& file_system_info, |
| 457 const Watchers& watchers) { | 459 const Watchers& watchers) { |
| 458 registry_->RememberFileSystem(file_system_info, watchers); | 460 registry_->RememberFileSystem(file_system_info, watchers); |
| 459 } | 461 } |
| 460 | 462 |
| 461 } // namespace file_system_provider | 463 } // namespace file_system_provider |
| 462 } // namespace chromeos | 464 } // namespace chromeos |
| OLD | NEW |