OLD | NEW |
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_tasks.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 const std::set<std::string> mime_types = | 232 const std::set<std::string> mime_types = |
233 GetUniqueMimeTypes(params->mime_types); | 233 GetUniqueMimeTypes(params->mime_types); |
234 | 234 |
235 // If there weren't any mime_types, and all the suffixes were blank, | 235 // If there weren't any mime_types, and all the suffixes were blank, |
236 // then we "succeed", but don't actually associate with anything. | 236 // then we "succeed", but don't actually associate with anything. |
237 // Otherwise, any time we set the default on a file with no extension | 237 // Otherwise, any time we set the default on a file with no extension |
238 // on the local drive, we'd fail. | 238 // on the local drive, we'd fail. |
239 // TODO(gspencer): Fix file manager so that it never tries to set default in | 239 // TODO(gspencer): Fix file manager so that it never tries to set default in |
240 // cases where extensionless local files are part of the selection. | 240 // cases where extensionless local files are part of the selection. |
241 if (suffixes.empty() && mime_types.empty()) { | 241 if (suffixes.empty() && mime_types.empty()) { |
242 return RespondNow( | 242 return RespondNow(OneArgument(base::MakeUnique<base::Value>(true))); |
243 OneArgument(base::MakeUnique<base::FundamentalValue>(true))); | |
244 } | 243 } |
245 | 244 |
246 file_manager::file_tasks::UpdateDefaultTask( | 245 file_manager::file_tasks::UpdateDefaultTask( |
247 profile->GetPrefs(), params->task_id, suffixes, mime_types); | 246 profile->GetPrefs(), params->task_id, suffixes, mime_types); |
248 return RespondNow(NoArguments()); | 247 return RespondNow(NoArguments()); |
249 } | 248 } |
250 | 249 |
251 } // namespace extensions | 250 } // namespace extensions |
OLD | NEW |