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

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

Issue 256023002: Reland of r266437: [Files.app] Use getDriveEntryProperties() to retrieve metadata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/api/file_browser_private.idl » ('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_drive.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_drive.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/drive/drive_integration_service.h" 8 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
9 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" 9 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
10 #include "chrome/browser/chromeos/file_manager/file_tasks.h" 10 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 const char kDriveConnectionReasonNoService[] = "no_service"; 47 const char kDriveConnectionReasonNoService[] = "no_service";
48 48
49 // Copies properties from |entry_proto| to |properties|. |shared_with_me| is 49 // Copies properties from |entry_proto| to |properties|. |shared_with_me| is
50 // given from the running profile. 50 // given from the running profile.
51 void FillDriveEntryPropertiesValue(const drive::ResourceEntry& entry_proto, 51 void FillDriveEntryPropertiesValue(const drive::ResourceEntry& entry_proto,
52 bool shared_with_me, 52 bool shared_with_me,
53 DriveEntryProperties* properties) { 53 DriveEntryProperties* properties) {
54 properties->shared_with_me.reset(new bool(shared_with_me)); 54 properties->shared_with_me.reset(new bool(shared_with_me));
55 properties->shared.reset(new bool(entry_proto.shared())); 55 properties->shared.reset(new bool(entry_proto.shared()));
56 56
57 const drive::PlatformFileInfoProto& file_info = entry_proto.file_info();
58 properties->file_size.reset(new double(file_info.size()));
59 properties->last_modified_time.reset(new double(
60 base::Time::FromInternalValue(file_info.last_modified()).ToJsTime()));
61
57 if (!entry_proto.has_file_specific_info()) 62 if (!entry_proto.has_file_specific_info())
58 return; 63 return;
59 64
60 const drive::FileSpecificInfo& file_specific_info = 65 const drive::FileSpecificInfo& file_specific_info =
61 entry_proto.file_specific_info(); 66 entry_proto.file_specific_info();
62 67
63 if (!entry_proto.resource_id().empty()) { 68 if (!entry_proto.resource_id().empty()) {
64 properties->thumbnail_url.reset( 69 properties->thumbnail_url.reset(
65 new std::string("https://www.googledrive.com/thumb/" + 70 new std::string("https://www.googledrive.com/thumb/" +
66 entry_proto.resource_id() + "?width=500&height=500")); 71 entry_proto.resource_id() + "?width=500&height=500"));
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 this)); 891 this));
887 return true; 892 return true;
888 } 893 }
889 894
890 void FileBrowserPrivateRequestDriveShareFunction::OnAddPermission( 895 void FileBrowserPrivateRequestDriveShareFunction::OnAddPermission(
891 drive::FileError error) { 896 drive::FileError error) {
892 SendResponse(error == drive::FILE_ERROR_OK); 897 SendResponse(error == drive::FILE_ERROR_OK);
893 } 898 }
894 899
895 } // namespace extensions 900 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/api/file_browser_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698