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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_util.cc

Issue 1055183003: Add a data source field for volumes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a typo. Created 5 years, 8 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/browser/chromeos/extensions/file_system_provider/file_system_provider_api.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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698