| 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_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/browser/google_apis/drive_service_interface.h" | 49 #include "chrome/browser/google_apis/drive_service_interface.h" |
| 50 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 50 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
| 51 #include "chrome/browser/google_apis/operation_registry.h" | 51 #include "chrome/browser/google_apis/operation_registry.h" |
| 52 #include "chrome/browser/google_apis/time_util.h" | 52 #include "chrome/browser/google_apis/time_util.h" |
| 53 #include "chrome/browser/intents/web_intents_util.h" | 53 #include "chrome/browser/intents/web_intents_util.h" |
| 54 #include "chrome/browser/profiles/profile.h" | 54 #include "chrome/browser/profiles/profile.h" |
| 55 #include "chrome/browser/ui/browser.h" | 55 #include "chrome/browser/ui/browser.h" |
| 56 #include "chrome/browser/ui/browser_window.h" | 56 #include "chrome/browser/ui/browser_window.h" |
| 57 #include "chrome/browser/ui/views/select_file_dialog_extension.h" | 57 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 58 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 58 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 59 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 59 #include "chrome/common/extensions/extension.h" | 60 #include "chrome/common/extensions/extension.h" |
| 60 #include "chrome/common/extensions/extension_constants.h" | 61 #include "chrome/common/extensions/extension_constants.h" |
| 61 #include "chrome/common/extensions/extension_icon_set.h" | 62 #include "chrome/common/extensions/extension_icon_set.h" |
| 62 #include "chrome/common/extensions/extension_manifest_constants.h" | 63 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 63 #include "chrome/common/extensions/web_intents_handler.h" | 64 #include "chrome/common/extensions/web_intents_handler.h" |
| 64 #include "chrome/common/pref_names.h" | 65 #include "chrome/common/pref_names.h" |
| 65 #include "chromeos/disks/disk_mount_manager.h" | 66 #include "chromeos/disks/disk_mount_manager.h" |
| 66 #include "content/public/browser/child_process_security_policy.h" | 67 #include "content/public/browser/child_process_security_policy.h" |
| 67 #include "content/public/browser/render_process_host.h" | 68 #include "content/public/browser/render_process_host.h" |
| 68 #include "content/public/browser/render_view_host.h" | 69 #include "content/public/browser/render_view_host.h" |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 | 943 |
| 943 for (FileHandlerList::iterator i = file_handlers.begin(); | 944 for (FileHandlerList::iterator i = file_handlers.begin(); |
| 944 i != file_handlers.end(); ++i) { | 945 i != file_handlers.end(); ++i) { |
| 945 DictionaryValue* task = new DictionaryValue; | 946 DictionaryValue* task = new DictionaryValue; |
| 946 std::string task_id = file_handler_util::MakeTaskID(extension->id(), | 947 std::string task_id = file_handler_util::MakeTaskID(extension->id(), |
| 947 file_handler_util::kTaskApp, (*i)->id); | 948 file_handler_util::kTaskApp, (*i)->id); |
| 948 task->SetString("taskId", task_id); | 949 task->SetString("taskId", task_id); |
| 949 task->SetString("title", (*i)->title); | 950 task->SetString("title", (*i)->title); |
| 950 task->SetBoolean("isDefault", false); | 951 task->SetBoolean("isDefault", false); |
| 951 | 952 |
| 952 GURL best_icon = extension->GetIconURL(kPreferredIconSize, | 953 GURL best_icon = extensions::IconsInfo::GetIconURL( |
| 953 ExtensionIconSet::MATCH_BIGGER); | 954 extension, kPreferredIconSize,ExtensionIconSet::MATCH_BIGGER); |
| 954 if (!best_icon.is_empty()) | 955 if (!best_icon.is_empty()) |
| 955 task->SetString("iconUrl", best_icon.spec()); | 956 task->SetString("iconUrl", best_icon.spec()); |
| 956 else | 957 else |
| 957 task->SetString("iconUrl", kDefaultIcon); | 958 task->SetString("iconUrl", kDefaultIcon); |
| 958 | 959 |
| 959 task->SetBoolean("driveApp", false); | 960 task->SetBoolean("driveApp", false); |
| 960 result_list->Append(task); | 961 result_list->Append(task); |
| 961 } | 962 } |
| 962 } | 963 } |
| 963 | 964 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 extension, web_intents::kActionView, mime_types, &title)) | 996 extension, web_intents::kActionView, mime_types, &title)) |
| 996 continue; | 997 continue; |
| 997 | 998 |
| 998 DictionaryValue* task = new DictionaryValue; | 999 DictionaryValue* task = new DictionaryValue; |
| 999 std::string task_id = file_handler_util::MakeTaskID(extension->id(), | 1000 std::string task_id = file_handler_util::MakeTaskID(extension->id(), |
| 1000 file_handler_util::kTaskWebIntent, web_intents::kActionView); | 1001 file_handler_util::kTaskWebIntent, web_intents::kActionView); |
| 1001 task->SetString("taskId", task_id); | 1002 task->SetString("taskId", task_id); |
| 1002 task->SetString("title", title); | 1003 task->SetString("title", title); |
| 1003 task->SetBoolean("isDefault", false); | 1004 task->SetBoolean("isDefault", false); |
| 1004 | 1005 |
| 1005 GURL best_icon = extension->GetIconURL(kPreferredIconSize, | 1006 GURL best_icon = extensions::IconsInfo::GetIconURL( |
| 1006 ExtensionIconSet::MATCH_BIGGER); | 1007 extension, kPreferredIconSize,ExtensionIconSet::MATCH_BIGGER); |
| 1007 if (!best_icon.is_empty()) | 1008 if (!best_icon.is_empty()) |
| 1008 task->SetString("iconUrl", best_icon.spec()); | 1009 task->SetString("iconUrl", best_icon.spec()); |
| 1009 else | 1010 else |
| 1010 task->SetString("iconUrl", kDefaultIcon); | 1011 task->SetString("iconUrl", kDefaultIcon); |
| 1011 | 1012 |
| 1012 task->SetBoolean("driveApp", false); | 1013 task->SetBoolean("driveApp", false); |
| 1013 result_list->Append(task); | 1014 result_list->Append(task); |
| 1014 } | 1015 } |
| 1015 | 1016 |
| 1016 return true; | 1017 return true; |
| (...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3140 // Keep the refcount until the zipping is complete on utility process. | 3141 // Keep the refcount until the zipping is complete on utility process. |
| 3141 AddRef(); | 3142 AddRef(); |
| 3142 return true; | 3143 return true; |
| 3143 } | 3144 } |
| 3144 | 3145 |
| 3145 void ZipSelectionFunction::OnZipDone(bool success) { | 3146 void ZipSelectionFunction::OnZipDone(bool success) { |
| 3146 SetResult(new base::FundamentalValue(success)); | 3147 SetResult(new base::FundamentalValue(success)); |
| 3147 SendResponse(true); | 3148 SendResponse(true); |
| 3148 Release(); | 3149 Release(); |
| 3149 } | 3150 } |
| OLD | NEW |