Lines Matching refs:drive

9 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
18 #include "chrome/browser/drive/drive_app_registry.h"
19 #include "chrome/browser/drive/event_logger.h"
28 #include "google_apis/drive/auth_service.h"
48 // List of connection types of drive.
62 void FillEntryPropertiesValueForDrive(const drive::ResourceEntry& entry_proto,
68 const drive::PlatformFileInfoProto& file_info = entry_proto.file_info();
76 const drive::FileSpecificInfo& file_specific_info =
112 // http://support.google.com/drive/answer/1628467
187 file_path_ = drive::util::ExtractDrivePath(local_path_);
188 file_owner_profile_ = drive::util::ExtractProfileFromPath(local_path_);
193 CompleteGetEntryProperties(drive::FILE_ERROR_FAILED);
198 drive::FileSystemInterface* const file_system =
199 drive::util::GetFileSystemByProfile(file_owner_profile_);
202 CompleteGetEntryProperties(drive::FILE_ERROR_FAILED);
212 void OnGetFileInfo(drive::FileError error,
213 scoped_ptr<drive::ResourceEntry> entry) {
216 if (error != drive::FILE_ERROR_OK) {
231 drive::FileSystemInterface* const file_system =
232 drive::util::GetFileSystemByProfile(running_profile_);
234 CompleteGetEntryProperties(drive::FILE_ERROR_FAILED);
243 void OnGetRunningPath(drive::FileError error,
247 if (error != drive::FILE_ERROR_OK) {
253 drive::FileSystemInterface* const file_system =
254 drive::util::GetFileSystemByProfile(running_profile_);
256 // The drive is disable for the running profile.
267 void OnGetShareInfo(drive::FileError error,
268 scoped_ptr<drive::ResourceEntry> entry) {
271 if (error != drive::FILE_ERROR_OK) {
286 drive::FileSystemInterface* const file_system =
287 drive::util::GetFileSystemByProfile(file_owner_profile_);
288 drive::DriveAppRegistry* const app_registry =
289 drive::util::GetDriveAppRegistryByProfile(file_owner_profile_);
292 CompleteGetEntryProperties(drive::FILE_ERROR_FAILED);
299 CompleteGetEntryProperties(drive::FILE_ERROR_OK);
303 const drive::FileSpecificInfo& file_specific_info =
306 // Get drive WebApps that can accept this file. We just need to extract the
307 // doc icon for the drive app, which is set as default.
308 std::vector<drive::DriveAppInfo> drive_apps;
322 const drive::DriveAppInfo& app_info = drive_apps[i];
324 // The drive app is set as default. Files.app should use the doc icon.
325 const GURL doc_icon = drive::util::FindPreferredIcon(
326 app_info.document_icons, drive::util::kPreferredIconSize);
332 CompleteGetEntryProperties(drive::FILE_ERROR_OK);
335 void CompleteGetEntryProperties(drive::FileError error) {
339 callback_.Run(properties_.Pass(), drive::FileErrorToBaseFileError(error));
352 scoped_ptr<drive::ResourceEntry> owner_resource_entry_;
524 drive::FileSystemInterface* const file_system =
525 drive::util::GetFileSystemByProfile(GetProfile());
530 drive::util::ExtractDrivePath(file_manager::util::GetLocalPathFromURL(
545 OnPinStateSet(drive::FileError error) {
548 if (error == drive::FILE_ERROR_OK) {
551 SetError(drive::FileErrorToString(error));
561 drive::DriveIntegrationService* integration_service =
562 drive::DriveIntegrationServiceFactory::FindForProfile(GetProfile());
566 drive::JobListInterface* job_list = integration_service->job_list();
568 std::vector<drive::JobInfo> jobs = job_list->GetJobInfoList();
573 if (drive::IsActiveFileTransferJobInfo(jobs[i]))
579 typedef std::map<base::FilePath, std::vector<drive::JobID> > PathToIdMap;
582 if (drive::IsActiveFileTransferJobInfo(jobs[i]))
592 file_path = drive::util::ExtractDrivePath(file_path);
612 drive::FileSystemInterface* const file_system =
613 drive::util::GetFileSystemByProfile(GetProfile());
626 drive::FileError error,
629 if (error != drive::FILE_ERROR_OK) {
681 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile());
693 drive::FileSystemInterface* const file_system =
694 drive::util::GetFileSystemByProfile(GetProfile());
703 options = drive::SEARCH_METADATA_EXCLUDE_DIRECTORIES;
706 options = drive::SEARCH_METADATA_SHARED_WITH_ME;
709 options = drive::SEARCH_METADATA_OFFLINE;
712 options = drive::SEARCH_METADATA_ALL;
729 drive::FileError error,
730 scoped_ptr<drive::MetadataSearchResultVector> results) {
731 if (error != drive::FILE_ERROR_OK) {
739 const drive::MetadataSearchResultVector& results_ref = *results.get();
752 scoped_ptr<drive::MetadataSearchResultVector> search_result_info_list,
790 switch (drive::util::GetDriveConnectionStatus(GetProfile())) {
791 case drive::util::DRIVE_DISCONNECTED_NOSERVICE:
795 case drive::util::DRIVE_DISCONNECTED_NONETWORK:
799 case drive::util::DRIVE_DISCONNECTED_NOTREADY:
803 case drive::util::DRIVE_CONNECTED_METERED:
806 case drive::util::DRIVE_CONNECTED:
814 drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile());
825 drive::DriveServiceInterface* const drive_service =
826 drive::util::GetDriveServiceByProfile(GetProfile());
861 DCHECK(drive::util::IsUnderDriveMountPoint(path));
863 const base::FilePath drive_path = drive::util::ExtractDrivePath(path);
865 drive::FileSystemInterface* const file_system =
866 drive::util::GetFileSystemByProfile(GetProfile());
880 drive::FileError error,
882 if (error != drive::FILE_ERROR_OK) {
899 const base::FilePath drive_path = drive::util::ExtractDrivePath(path);
900 Profile* const owner_profile = drive::util::ExtractProfileFromPath(path);
905 drive::FileSystemInterface* const owner_file_system =
906 drive::util::GetFileSystemByProfile(owner_profile);
915 google_apis::drive::PermissionRole role =
916 google_apis::drive::PERMISSION_ROLE_READER;
922 role = google_apis::drive::PERMISSION_ROLE_WRITER;
925 role = google_apis::drive::PERMISSION_ROLE_COMMENTER;
928 role = google_apis::drive::PERMISSION_ROLE_READER;
943 drive::FileError error) {
944 SendResponse(error == drive::FILE_ERROR_OK);
961 drive::FileSystemInterface* const file_system =
962 drive::util::GetFileSystemByProfile(GetProfile());
972 if (!drive::util::IsUnderDriveMountPoint(path)) {
977 base::FilePath file_path = drive::util::ExtractDrivePath(path);
987 drive::FileError error,
988 scoped_ptr<drive::ResourceEntry> entry) {
991 if (error != drive::FILE_ERROR_OK) {
1008 scopes.push_back("https://www.googleapis.com/auth/drive.readonly");