| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "chrome/browser/google_apis/drive_service_interface.h" | 48 #include "chrome/browser/google_apis/drive_service_interface.h" |
| 49 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 49 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
| 50 #include "chrome/browser/google_apis/operation_registry.h" | 50 #include "chrome/browser/google_apis/operation_registry.h" |
| 51 #include "chrome/browser/google_apis/time_util.h" | 51 #include "chrome/browser/google_apis/time_util.h" |
| 52 #include "chrome/browser/lifetime/application_lifetime.h" | 52 #include "chrome/browser/lifetime/application_lifetime.h" |
| 53 #include "chrome/browser/profiles/profile.h" | 53 #include "chrome/browser/profiles/profile.h" |
| 54 #include "chrome/browser/ui/browser.h" | 54 #include "chrome/browser/ui/browser.h" |
| 55 #include "chrome/browser/ui/browser_window.h" | 55 #include "chrome/browser/ui/browser_window.h" |
| 56 #include "chrome/browser/ui/views/select_file_dialog_extension.h" | 56 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 57 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 57 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 58 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 58 #include "chrome/common/extensions/extension.h" | 59 #include "chrome/common/extensions/extension.h" |
| 59 #include "chrome/common/extensions/extension_constants.h" | 60 #include "chrome/common/extensions/extension_constants.h" |
| 60 #include "chrome/common/extensions/extension_icon_set.h" | 61 #include "chrome/common/extensions/extension_icon_set.h" |
| 61 #include "chrome/common/extensions/extension_manifest_constants.h" | 62 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 62 #include "chrome/common/pref_names.h" | 63 #include "chrome/common/pref_names.h" |
| 63 #include "chromeos/disks/disk_mount_manager.h" | 64 #include "chromeos/disks/disk_mount_manager.h" |
| 64 #include "content/public/browser/child_process_security_policy.h" | 65 #include "content/public/browser/child_process_security_policy.h" |
| 65 #include "content/public/browser/render_process_host.h" | 66 #include "content/public/browser/render_process_host.h" |
| 66 #include "content/public/browser/render_view_host.h" | 67 #include "content/public/browser/render_view_host.h" |
| 67 #include "content/public/browser/storage_partition.h" | 68 #include "content/public/browser/storage_partition.h" |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 | 942 |
| 942 for (FileHandlerList::iterator i = file_handlers.begin(); | 943 for (FileHandlerList::iterator i = file_handlers.begin(); |
| 943 i != file_handlers.end(); ++i) { | 944 i != file_handlers.end(); ++i) { |
| 944 DictionaryValue* task = new DictionaryValue; | 945 DictionaryValue* task = new DictionaryValue; |
| 945 std::string task_id = file_handler_util::MakeTaskID(extension->id(), | 946 std::string task_id = file_handler_util::MakeTaskID(extension->id(), |
| 946 file_handler_util::kTaskApp, (*i)->id); | 947 file_handler_util::kTaskApp, (*i)->id); |
| 947 task->SetString("taskId", task_id); | 948 task->SetString("taskId", task_id); |
| 948 task->SetString("title", (*i)->title); | 949 task->SetString("title", (*i)->title); |
| 949 task->SetBoolean("isDefault", false); | 950 task->SetBoolean("isDefault", false); |
| 950 | 951 |
| 951 GURL best_icon = extension->GetIconURL(kPreferredIconSize, | 952 GURL best_icon = extensions::IconsInfo::GetIconURL( |
| 952 ExtensionIconSet::MATCH_BIGGER); | 953 extension, kPreferredIconSize, ExtensionIconSet::MATCH_BIGGER); |
| 953 if (!best_icon.is_empty()) | 954 if (!best_icon.is_empty()) |
| 954 task->SetString("iconUrl", best_icon.spec()); | 955 task->SetString("iconUrl", best_icon.spec()); |
| 955 else | 956 else |
| 956 task->SetString("iconUrl", kDefaultIcon); | 957 task->SetString("iconUrl", kDefaultIcon); |
| 957 | 958 |
| 958 task->SetBoolean("driveApp", false); | 959 task->SetBoolean("driveApp", false); |
| 959 result_list->Append(task); | 960 result_list->Append(task); |
| 960 } | 961 } |
| 961 } | 962 } |
| 962 | 963 |
| (...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3235 this, name.size())); | 3236 this, name.size())); |
| 3236 return true; | 3237 return true; |
| 3237 } | 3238 } |
| 3238 | 3239 |
| 3239 void ValidatePathNameLengthFunction::OnFilePathLimitRetrieved( | 3240 void ValidatePathNameLengthFunction::OnFilePathLimitRetrieved( |
| 3240 size_t current_length, | 3241 size_t current_length, |
| 3241 size_t max_length) { | 3242 size_t max_length) { |
| 3242 SetResult(new base::FundamentalValue(current_length <= max_length)); | 3243 SetResult(new base::FundamentalValue(current_length <= max_length)); |
| 3243 SendResponse(true); | 3244 SendResponse(true); |
| 3244 } | 3245 } |
| OLD | NEW |