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

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

Issue 574293002: Files.app: Show thumbnail of non-image file even when the file cache is present (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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 | ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js » ('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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/drive/drive_integration_service.h" 9 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" 10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 properties->file_size.reset(new double(file_info.size())); 69 properties->file_size.reset(new double(file_info.size()));
70 properties->last_modified_time.reset(new double( 70 properties->last_modified_time.reset(new double(
71 base::Time::FromInternalValue(file_info.last_modified()).ToJsTime())); 71 base::Time::FromInternalValue(file_info.last_modified()).ToJsTime()));
72 72
73 if (!entry_proto.has_file_specific_info()) 73 if (!entry_proto.has_file_specific_info())
74 return; 74 return;
75 75
76 const drive::FileSpecificInfo& file_specific_info = 76 const drive::FileSpecificInfo& file_specific_info =
77 entry_proto.file_specific_info(); 77 entry_proto.file_specific_info();
78 78
79 // The web thumbnail is used only when the file is not present. Otherwise 79 if (!entry_proto.resource_id().empty()) {
80 // it could be out of sync.
81 if (!entry_proto.resource_id().empty() &&
82 !file_specific_info.cache_state().is_present()) {
83 properties->thumbnail_url.reset( 80 properties->thumbnail_url.reset(
84 new std::string("https://www.googledrive.com/thumb/" + 81 new std::string("https://www.googledrive.com/thumb/" +
85 entry_proto.resource_id() + "?width=500&height=500")); 82 entry_proto.resource_id() + "?width=500&height=500"));
86 } 83 }
87 if (file_specific_info.has_image_width()) { 84 if (file_specific_info.has_image_width()) {
88 properties->image_width.reset( 85 properties->image_width.reset(
89 new int(file_specific_info.image_width())); 86 new int(file_specific_info.image_width()));
90 } 87 }
91 if (file_specific_info.has_image_height()) { 88 if (file_specific_info.has_image_height()) {
92 properties->image_height.reset( 89 properties->image_height.reset(
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 return; 1026 return;
1030 } 1027 }
1031 1028
1032 const std::string url = download_url_ + "?access_token=" + access_token; 1029 const std::string url = download_url_ + "?access_token=" + access_token;
1033 SetResult(new base::StringValue(url)); 1030 SetResult(new base::StringValue(url));
1034 1031
1035 SendResponse(true); 1032 SendResponse(true);
1036 } 1033 }
1037 1034
1038 } // namespace extensions 1035 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698