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 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // TODO(kinaba): fill appropriate information once multi-profile support is | 175 // TODO(kinaba): fill appropriate information once multi-profile support is |
176 // implemented. | 176 // implemented. |
177 volume_metadata->profile.display_name = profile->GetProfileUserName(); | 177 volume_metadata->profile.display_name = profile->GetProfileUserName(); |
178 volume_metadata->profile.is_current_profile = true; | 178 volume_metadata->profile.is_current_profile = true; |
179 | 179 |
180 if (!volume.source_path().empty()) { | 180 if (!volume.source_path().empty()) { |
181 volume_metadata->source_path.reset( | 181 volume_metadata->source_path.reset( |
182 new std::string(volume.source_path().AsUTF8Unsafe())); | 182 new std::string(volume.source_path().AsUTF8Unsafe())); |
183 } | 183 } |
184 | 184 |
| 185 switch (volume.volume_source()) { |
| 186 case VOLUME_SOURCE_UNKNOWN: |
| 187 volume_metadata->volume_source = file_manager_private::VOLUME_SOURCE_NONE; |
| 188 break; |
| 189 case VOLUME_SOURCE_FILE: |
| 190 volume_metadata->volume_source = file_manager_private::VOLUME_SOURCE_FILE; |
| 191 break; |
| 192 case VOLUME_SOURCE_DEVICE: |
| 193 volume_metadata->volume_source = |
| 194 file_manager_private::VOLUME_SOURCE_DEVICE; |
| 195 break; |
| 196 case VOLUME_SOURCE_NETWORK: |
| 197 volume_metadata->volume_source = |
| 198 file_manager_private::VOLUME_SOURCE_NETWORK; |
| 199 break; |
| 200 } |
| 201 |
185 if (volume.type() == VOLUME_TYPE_PROVIDED) { | 202 if (volume.type() == VOLUME_TYPE_PROVIDED) { |
186 volume_metadata->extension_id.reset(new std::string(volume.extension_id())); | 203 volume_metadata->extension_id.reset(new std::string(volume.extension_id())); |
187 | |
188 volume_metadata->file_system_id.reset( | 204 volume_metadata->file_system_id.reset( |
189 new std::string(volume.file_system_id())); | 205 new std::string(volume.file_system_id())); |
190 } | 206 } |
191 | 207 |
192 volume_metadata->volume_label.reset(new std::string(volume.volume_label())); | 208 volume_metadata->volume_label.reset(new std::string(volume.volume_label())); |
193 | 209 |
194 switch (volume.type()) { | 210 switch (volume.type()) { |
195 case VOLUME_TYPE_GOOGLE_DRIVE: | 211 case VOLUME_TYPE_GOOGLE_DRIVE: |
196 volume_metadata->volume_type = | 212 volume_metadata->volume_type = |
197 file_manager_private::VOLUME_TYPE_DRIVE; | 213 file_manager_private::VOLUME_TYPE_DRIVE; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 360 } |
345 | 361 |
346 drive::EventLogger* GetLogger(Profile* profile) { | 362 drive::EventLogger* GetLogger(Profile* profile) { |
347 drive::DriveIntegrationService* service = | 363 drive::DriveIntegrationService* service = |
348 drive::DriveIntegrationServiceFactory::FindForProfile(profile); | 364 drive::DriveIntegrationServiceFactory::FindForProfile(profile); |
349 return service ? service->event_logger() : NULL; | 365 return service ? service->event_logger() : NULL; |
350 } | 366 } |
351 | 367 |
352 } // namespace util | 368 } // namespace util |
353 } // namespace file_manager | 369 } // namespace file_manager |
OLD | NEW |