| 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 | |
| 202 if (volume.type() == VOLUME_TYPE_PROVIDED) { | 185 if (volume.type() == VOLUME_TYPE_PROVIDED) { |
| 203 volume_metadata->extension_id.reset(new std::string(volume.extension_id())); | 186 volume_metadata->extension_id.reset(new std::string(volume.extension_id())); |
| 204 volume_metadata->file_system_id.reset( | 187 volume_metadata->file_system_id.reset( |
| 205 new std::string(volume.file_system_id())); | 188 new std::string(volume.file_system_id())); |
| 206 } | 189 } |
| 207 | 190 |
| 208 volume_metadata->volume_label.reset(new std::string(volume.volume_label())); | 191 volume_metadata->volume_label.reset(new std::string(volume.volume_label())); |
| 209 | 192 |
| 210 switch (volume.type()) { | 193 switch (volume.type()) { |
| 211 case VOLUME_TYPE_GOOGLE_DRIVE: | 194 case VOLUME_TYPE_GOOGLE_DRIVE: |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 339 } |
| 357 | 340 |
| 358 drive::EventLogger* GetLogger(Profile* profile) { | 341 drive::EventLogger* GetLogger(Profile* profile) { |
| 359 drive::DriveIntegrationService* service = | 342 drive::DriveIntegrationService* service = |
| 360 drive::DriveIntegrationServiceFactory::FindForProfile(profile); | 343 drive::DriveIntegrationServiceFactory::FindForProfile(profile); |
| 361 return service ? service->event_logger() : NULL; | 344 return service ? service->event_logger() : NULL; |
| 362 } | 345 } |
| 363 | 346 |
| 364 } // namespace util | 347 } // namespace util |
| 365 } // namespace file_manager | 348 } // namespace file_manager |
| OLD | NEW |