Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: chrome/browser/chromeos/file_system_provider/service.cc

Issue 1127283003: Make some file_system_provider_capabilities fields optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698