| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_browser_private_a
pi.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi.h" |
| 6 | 6 |
| 7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
| 8 #include <sys/statvfs.h> | 8 #include <sys/statvfs.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 #include <utime.h> | 10 #include <utime.h> |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 } | 366 } |
| 367 | 367 |
| 368 void FillDriveEntryPropertiesValue( | 368 void FillDriveEntryPropertiesValue( |
| 369 const drive::ResourceEntry& entry_proto, | 369 const drive::ResourceEntry& entry_proto, |
| 370 DictionaryValue* property_dict) { | 370 DictionaryValue* property_dict) { |
| 371 property_dict->SetBoolean("sharedWithMe", entry_proto.shared_with_me()); | 371 property_dict->SetBoolean("sharedWithMe", entry_proto.shared_with_me()); |
| 372 | 372 |
| 373 if (!entry_proto.has_file_specific_info()) | 373 if (!entry_proto.has_file_specific_info()) |
| 374 return; | 374 return; |
| 375 | 375 |
| 376 const drive::DriveFileSpecificInfo& file_specific_info = | 376 const drive::FileSpecificInfo& file_specific_info = |
| 377 entry_proto.file_specific_info(); | 377 entry_proto.file_specific_info(); |
| 378 | 378 |
| 379 property_dict->SetString("thumbnailUrl", file_specific_info.thumbnail_url()); | 379 property_dict->SetString("thumbnailUrl", file_specific_info.thumbnail_url()); |
| 380 | 380 |
| 381 property_dict->SetBoolean("isHosted", | 381 property_dict->SetBoolean("isHosted", |
| 382 file_specific_info.is_hosted_document()); | 382 file_specific_info.is_hosted_document()); |
| 383 | 383 |
| 384 property_dict->SetString("contentMimeType", | 384 property_dict->SetString("contentMimeType", |
| 385 file_specific_info.content_mime_type()); | 385 file_specific_info.content_mime_type()); |
| 386 } | 386 } |
| (...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2356 return; | 2356 return; |
| 2357 } | 2357 } |
| 2358 | 2358 |
| 2359 // The properties meaningful for directories are already filled in | 2359 // The properties meaningful for directories are already filled in |
| 2360 // FillDriveEntryPropertiesValue(). | 2360 // FillDriveEntryPropertiesValue(). |
| 2361 if (entry.get() && !entry->has_file_specific_info()) { | 2361 if (entry.get() && !entry->has_file_specific_info()) { |
| 2362 CompleteGetFileProperties(error); | 2362 CompleteGetFileProperties(error); |
| 2363 return; | 2363 return; |
| 2364 } | 2364 } |
| 2365 | 2365 |
| 2366 const drive::DriveFileSpecificInfo& file_specific_info = | 2366 const drive::FileSpecificInfo& file_specific_info = |
| 2367 entry->file_specific_info(); | 2367 entry->file_specific_info(); |
| 2368 | 2368 |
| 2369 // Get drive WebApps that can accept this file. | 2369 // Get drive WebApps that can accept this file. |
| 2370 ScopedVector<drive::DriveWebAppInfo> web_apps; | 2370 ScopedVector<drive::DriveWebAppInfo> web_apps; |
| 2371 system_service->webapps_registry()->GetWebAppsForFile( | 2371 system_service->webapps_registry()->GetWebAppsForFile( |
| 2372 file_path_, file_specific_info.content_mime_type(), &web_apps); | 2372 file_path_, file_specific_info.content_mime_type(), &web_apps); |
| 2373 if (!web_apps.empty()) { | 2373 if (!web_apps.empty()) { |
| 2374 std::string default_task_id = file_handler_util::GetDefaultTaskIdFromPrefs( | 2374 std::string default_task_id = file_handler_util::GetDefaultTaskIdFromPrefs( |
| 2375 profile_, | 2375 profile_, |
| 2376 file_specific_info.content_mime_type(), | 2376 file_specific_info.content_mime_type(), |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3111 OpenNewWindowFunction::OpenNewWindowFunction() {} | 3111 OpenNewWindowFunction::OpenNewWindowFunction() {} |
| 3112 | 3112 |
| 3113 OpenNewWindowFunction::~OpenNewWindowFunction() {} | 3113 OpenNewWindowFunction::~OpenNewWindowFunction() {} |
| 3114 | 3114 |
| 3115 bool OpenNewWindowFunction::RunImpl() { | 3115 bool OpenNewWindowFunction::RunImpl() { |
| 3116 std::string url; | 3116 std::string url; |
| 3117 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); | 3117 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); |
| 3118 file_manager_util::OpenNewWindow(profile_, GURL(url)); | 3118 file_manager_util::OpenNewWindow(profile_, GURL(url)); |
| 3119 return true; | 3119 return true; |
| 3120 } | 3120 } |
| OLD | NEW |