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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 std::vector<ProvidingExtensionInfo> result; | 311 std::vector<ProvidingExtensionInfo> result; |
312 for (const auto& extension : registry->enabled_extensions()) { | 312 for (const auto& extension : registry->enabled_extensions()) { |
313 if (!extension->permissions_data()->HasAPIPermission( | 313 if (!extension->permissions_data()->HasAPIPermission( |
314 extensions::APIPermission::kFileSystemProvider)) { | 314 extensions::APIPermission::kFileSystemProvider)) { |
315 continue; | 315 continue; |
316 } | 316 } |
317 | 317 |
318 ProvidingExtensionInfo info; | 318 ProvidingExtensionInfo info; |
319 info.extension_id = extension->id(); | 319 info.extension_id = extension->id(); |
320 info.name = extension->name(); | 320 info.name = extension->name(); |
321 const extensions::FileSystemProviderCapabilities* capabilities = | 321 const extensions::FileSystemProviderCapabilities* const capabilities = |
322 extensions::FileSystemProviderCapabilities::Get(extension.get()); | 322 extensions::FileSystemProviderCapabilities::Get(extension.get()); |
323 info.capabilities = capabilities | 323 DCHECK(capabilities); |
324 ? *capabilities | 324 info.capabilities = *capabilities; |
325 : extensions::FileSystemProviderCapabilities(); | |
326 result.push_back(info); | 325 result.push_back(info); |
327 } | 326 } |
328 | 327 |
329 return result; | 328 return result; |
330 } | 329 } |
331 | 330 |
332 void Service::OnExtensionUnloaded( | 331 void Service::OnExtensionUnloaded( |
333 content::BrowserContext* browser_context, | 332 content::BrowserContext* browser_context, |
334 const extensions::Extension* extension, | 333 const extensions::Extension* extension, |
335 extensions::UnloadedExtensionInfo::Reason reason) { | 334 extensions::UnloadedExtensionInfo::Reason reason) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 429 } |
431 | 430 |
432 void Service::OnWatcherListChanged( | 431 void Service::OnWatcherListChanged( |
433 const ProvidedFileSystemInfo& file_system_info, | 432 const ProvidedFileSystemInfo& file_system_info, |
434 const Watchers& watchers) { | 433 const Watchers& watchers) { |
435 registry_->RememberFileSystem(file_system_info, watchers); | 434 registry_->RememberFileSystem(file_system_info, watchers); |
436 } | 435 } |
437 | 436 |
438 } // namespace file_system_provider | 437 } // namespace file_system_provider |
439 } // namespace chromeos | 438 } // namespace chromeos |
OLD | NEW |