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/file_manager/file_tasks.h" | 5 #include "chrome/browser/chromeos/file_manager/file_tasks.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 std::vector<FullTaskDescriptor>* result) { | 448 std::vector<FullTaskDescriptor>* result) { |
449 FindAllTypesOfTasks( | 449 FindAllTypesOfTasks( |
450 profile, drive_app_registry, entries, file_urls, | 450 profile, drive_app_registry, entries, file_urls, |
451 base::Bind(&FindAllTypesOfTasksSynchronousWrapper::OnReply, | 451 base::Bind(&FindAllTypesOfTasksSynchronousWrapper::OnReply, |
452 base::Unretained(this), result)); | 452 base::Unretained(this), result)); |
453 run_loop_.Run(); | 453 run_loop_.Run(); |
454 } | 454 } |
455 | 455 |
456 private: | 456 private: |
457 void OnReply(std::vector<FullTaskDescriptor>* out, | 457 void OnReply(std::vector<FullTaskDescriptor>* out, |
458 const std::vector<FullTaskDescriptor>& result) { | 458 std::unique_ptr<std::vector<FullTaskDescriptor>> result) { |
459 *out = result; | 459 *out = *result; |
460 run_loop_.Quit(); | 460 run_loop_.Quit(); |
461 } | 461 } |
462 | 462 |
463 base::RunLoop run_loop_; | 463 base::RunLoop run_loop_; |
464 }; | 464 }; |
465 | 465 |
466 content::TestBrowserThreadBundle thread_bundle_; | 466 content::TestBrowserThreadBundle thread_bundle_; |
467 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; | 467 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; |
468 chromeos::ScopedTestCrosSettings test_cros_settings_; | 468 chromeos::ScopedTestCrosSettings test_cros_settings_; |
469 chromeos::ScopedTestUserManager test_user_manager_; | 469 chromeos::ScopedTestUserManager test_user_manager_; |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 std::vector<FullTaskDescriptor> dir_result; | 1051 std::vector<FullTaskDescriptor> dir_result; |
1052 FindFileHandlerTasks(&test_profile_, dir_entries, &dir_result); | 1052 FindFileHandlerTasks(&test_profile_, dir_entries, &dir_result); |
1053 ASSERT_EQ(1U, dir_result.size()); | 1053 ASSERT_EQ(1U, dir_result.size()); |
1054 // Confirm that only Bar.app is found and that it is a generic file handler. | 1054 // Confirm that only Bar.app is found and that it is a generic file handler. |
1055 EXPECT_EQ(kBarId, dir_result[0].task_descriptor().app_id); | 1055 EXPECT_EQ(kBarId, dir_result[0].task_descriptor().app_id); |
1056 EXPECT_TRUE(dir_result[0].is_generic_file_handler()); | 1056 EXPECT_TRUE(dir_result[0].is_generic_file_handler()); |
1057 } | 1057 } |
1058 | 1058 |
1059 } // namespace file_tasks | 1059 } // namespace file_tasks |
1060 } // namespace file_manager. | 1060 } // namespace file_manager. |
OLD | NEW |