| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_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> |
| 11 #include <utility> | 11 #include <utility> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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/browser/ui/webui/web_ui_util.h" | 59 #include "chrome/browser/ui/webui/web_ui_util.h" |
| 60 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 60 #include "chrome/common/extensions/extension.h" | 61 #include "chrome/common/extensions/extension.h" |
| 61 #include "chrome/common/extensions/extension_constants.h" | 62 #include "chrome/common/extensions/extension_constants.h" |
| 62 #include "chrome/common/extensions/extension_icon_set.h" | 63 #include "chrome/common/extensions/extension_icon_set.h" |
| 63 #include "chrome/common/extensions/extension_manifest_constants.h" | 64 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 64 #include "chrome/common/extensions/web_intents_handler.h" | 65 #include "chrome/common/extensions/web_intents_handler.h" |
| 65 #include "chrome/common/pref_names.h" | 66 #include "chrome/common/pref_names.h" |
| 66 #include "chromeos/disks/disk_mount_manager.h" | 67 #include "chromeos/disks/disk_mount_manager.h" |
| 67 #include "content/public/browser/child_process_security_policy.h" | 68 #include "content/public/browser/child_process_security_policy.h" |
| 68 #include "content/public/browser/render_process_host.h" | 69 #include "content/public/browser/render_process_host.h" |
| 69 #include "content/public/browser/render_view_host.h" | 70 #include "content/public/browser/render_view_host.h" |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 | 933 |
| 933 for (FileHandlerList::iterator i = file_handlers.begin(); | 934 for (FileHandlerList::iterator i = file_handlers.begin(); |
| 934 i != file_handlers.end(); ++i) { | 935 i != file_handlers.end(); ++i) { |
| 935 DictionaryValue* task = new DictionaryValue; | 936 DictionaryValue* task = new DictionaryValue; |
| 936 std::string task_id = file_handler_util::MakeTaskID(extension->id(), | 937 std::string task_id = file_handler_util::MakeTaskID(extension->id(), |
| 937 file_handler_util::kTaskApp, (*i)->id); | 938 file_handler_util::kTaskApp, (*i)->id); |
| 938 task->SetString("taskId", task_id); | 939 task->SetString("taskId", task_id); |
| 939 task->SetString("title", (*i)->title); | 940 task->SetString("title", (*i)->title); |
| 940 task->SetBoolean("isDefault", false); | 941 task->SetBoolean("isDefault", false); |
| 941 | 942 |
| 942 GURL best_icon = extension->GetIconURL(kPreferredIconSize, | 943 GURL best_icon = extensions::IconsInfo::GetIconURL( |
| 943 ExtensionIconSet::MATCH_BIGGER); | 944 extension, kPreferredIconSize,ExtensionIconSet::MATCH_BIGGER); |
| 944 if (!best_icon.is_empty()) | 945 if (!best_icon.is_empty()) |
| 945 task->SetString("iconUrl", best_icon.spec()); | 946 task->SetString("iconUrl", best_icon.spec()); |
| 946 else | 947 else |
| 947 task->SetString("iconUrl", kDefaultIcon); | 948 task->SetString("iconUrl", kDefaultIcon); |
| 948 | 949 |
| 949 task->SetBoolean("driveApp", false); | 950 task->SetBoolean("driveApp", false); |
| 950 result_list->Append(task); | 951 result_list->Append(task); |
| 951 } | 952 } |
| 952 } | 953 } |
| 953 | 954 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 extension, web_intents::kActionView, mime_types, &title)) | 986 extension, web_intents::kActionView, mime_types, &title)) |
| 986 continue; | 987 continue; |
| 987 | 988 |
| 988 DictionaryValue* task = new DictionaryValue; | 989 DictionaryValue* task = new DictionaryValue; |
| 989 std::string task_id = file_handler_util::MakeTaskID(extension->id(), | 990 std::string task_id = file_handler_util::MakeTaskID(extension->id(), |
| 990 file_handler_util::kTaskWebIntent, web_intents::kActionView); | 991 file_handler_util::kTaskWebIntent, web_intents::kActionView); |
| 991 task->SetString("taskId", task_id); | 992 task->SetString("taskId", task_id); |
| 992 task->SetString("title", title); | 993 task->SetString("title", title); |
| 993 task->SetBoolean("isDefault", false); | 994 task->SetBoolean("isDefault", false); |
| 994 | 995 |
| 995 GURL best_icon = extension->GetIconURL(kPreferredIconSize, | 996 GURL best_icon = extensions::IconsInfo::GetIconURL( |
| 996 ExtensionIconSet::MATCH_BIGGER); | 997 extension, kPreferredIconSize,ExtensionIconSet::MATCH_BIGGER); |
| 997 if (!best_icon.is_empty()) | 998 if (!best_icon.is_empty()) |
| 998 task->SetString("iconUrl", best_icon.spec()); | 999 task->SetString("iconUrl", best_icon.spec()); |
| 999 else | 1000 else |
| 1000 task->SetString("iconUrl", kDefaultIcon); | 1001 task->SetString("iconUrl", kDefaultIcon); |
| 1001 | 1002 |
| 1002 task->SetBoolean("driveApp", false); | 1003 task->SetBoolean("driveApp", false); |
| 1003 result_list->Append(task); | 1004 result_list->Append(task); |
| 1004 } | 1005 } |
| 1005 | 1006 |
| 1006 return true; | 1007 return true; |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3033 // Keep the refcount until the zipping is complete on utility process. | 3034 // Keep the refcount until the zipping is complete on utility process. |
| 3034 AddRef(); | 3035 AddRef(); |
| 3035 return true; | 3036 return true; |
| 3036 } | 3037 } |
| 3037 | 3038 |
| 3038 void ZipSelectionFunction::OnZipDone(bool success) { | 3039 void ZipSelectionFunction::OnZipDone(bool success) { |
| 3039 SetResult(new base::FundamentalValue(success)); | 3040 SetResult(new base::FundamentalValue(success)); |
| 3040 SendResponse(true); | 3041 SendResponse(true); |
| 3041 Release(); | 3042 Release(); |
| 3042 } | 3043 } |
| OLD | NEW |