OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Implements the Chrome Extensions Media Galleries API. | 5 // Implements the Chrome Extensions Media Galleries API. |
6 | 6 |
7 #include "chrome/browser/extensions/api/media_galleries/media_galleries_api.h" | 7 #include "chrome/browser/extensions/api/media_galleries/media_galleries_api.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 scoped_ptr<GetMediaFileSystems::Params> params( | 86 scoped_ptr<GetMediaFileSystems::Params> params( |
87 GetMediaFileSystems::Params::Create(*args_)); | 87 GetMediaFileSystems::Params::Create(*args_)); |
88 EXTENSION_FUNCTION_VALIDATE(params.get()); | 88 EXTENSION_FUNCTION_VALIDATE(params.get()); |
89 MediaGalleries::GetMediaFileSystemsInteractivity interactive = | 89 MediaGalleries::GetMediaFileSystemsInteractivity interactive = |
90 MediaGalleries::GET_MEDIA_FILE_SYSTEMS_INTERACTIVITY_NO; | 90 MediaGalleries::GET_MEDIA_FILE_SYSTEMS_INTERACTIVITY_NO; |
91 if (params->details.get() && params->details->interactive != MediaGalleries:: | 91 if (params->details.get() && params->details->interactive != MediaGalleries:: |
92 GET_MEDIA_FILE_SYSTEMS_INTERACTIVITY_NONE) { | 92 GET_MEDIA_FILE_SYSTEMS_INTERACTIVITY_NONE) { |
93 interactive = params->details->interactive; | 93 interactive = params->details->interactive; |
94 } | 94 } |
95 | 95 |
96 chrome::StorageMonitor::GetInstance()->Initialize(base::Bind( | 96 chrome::StorageMonitor::GetInstance()->EnsureInitialized(base::Bind( |
97 &MediaGalleriesGetMediaFileSystemsFunction::OnStorageMonitorInit, | 97 &MediaGalleriesGetMediaFileSystemsFunction::OnStorageMonitorInit, |
98 this, | 98 this, |
99 interactive)); | 99 interactive)); |
100 return true; | 100 return true; |
101 } | 101 } |
102 | 102 |
103 void MediaGalleriesGetMediaFileSystemsFunction::OnStorageMonitorInit( | 103 void MediaGalleriesGetMediaFileSystemsFunction::OnStorageMonitorInit( |
104 MediaGalleries::GetMediaFileSystemsInteractivity interactive) { | 104 MediaGalleries::GetMediaFileSystemsInteractivity interactive) { |
105 switch (interactive) { | 105 switch (interactive) { |
106 case MediaGalleries::GET_MEDIA_FILE_SYSTEMS_INTERACTIVITY_YES: { | 106 case MediaGalleries::GET_MEDIA_FILE_SYSTEMS_INTERACTIVITY_YES: { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 bool MediaGalleriesAssembleMediaFileFunction::RunImpl() { | 248 bool MediaGalleriesAssembleMediaFileFunction::RunImpl() { |
249 if (!ApiIsAccessible(&error_)) | 249 if (!ApiIsAccessible(&error_)) |
250 return false; | 250 return false; |
251 | 251 |
252 // TODO(vandebo) Update the metadata and return the new file. | 252 // TODO(vandebo) Update the metadata and return the new file. |
253 SetResult(base::Value::CreateNullValue()); | 253 SetResult(base::Value::CreateNullValue()); |
254 return true; | 254 return true; |
255 } | 255 } |
256 | 256 |
257 } // namespace extensions | 257 } // namespace extensions |
OLD | NEW |