| 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/extensions/api/file_system/file_system_api.h" | 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 AcceptOption* BuildAcceptOption(const std::string& description, | 55 AcceptOption* BuildAcceptOption(const std::string& description, |
| 56 const std::string& mime_types, | 56 const std::string& mime_types, |
| 57 const std::string& extensions) { | 57 const std::string& extensions) { |
| 58 AcceptOption* option = new AcceptOption(); | 58 AcceptOption* option = new AcceptOption(); |
| 59 | 59 |
| 60 if (!description.empty()) | 60 if (!description.empty()) |
| 61 option->description.reset(new std::string(description)); | 61 option->description.reset(new std::string(description)); |
| 62 | 62 |
| 63 if (!mime_types.empty()) { | 63 if (!mime_types.empty()) { |
| 64 option->mime_types.reset(new std::vector<std::string>()); | 64 option->mime_types.reset(new std::vector<std::string>( |
| 65 base::SplitString(mime_types, ',', option->mime_types.get()); | 65 base::SplitString(mime_types, ",", |
| 66 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL))); |
| 66 } | 67 } |
| 67 | 68 |
| 68 if (!extensions.empty()) { | 69 if (!extensions.empty()) { |
| 69 option->extensions.reset(new std::vector<std::string>()); | 70 option->extensions.reset(new std::vector<std::string>( |
| 70 base::SplitString(extensions, ',', option->extensions.get()); | 71 base::SplitString(extensions, ",", |
| 72 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL))); |
| 71 } | 73 } |
| 72 | 74 |
| 73 return option; | 75 return option; |
| 74 } | 76 } |
| 75 | 77 |
| 76 #if defined(OS_WIN) | 78 #if defined(OS_WIN) |
| 77 #define ToStringType base::UTF8ToWide | 79 #define ToStringType base::UTF8ToWide |
| 78 #else | 80 #else |
| 79 #define ToStringType | 81 #define ToStringType |
| 80 #endif | 82 #endif |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 base::RunLoop().RunUntilIdle(); | 426 base::RunLoop().RunUntilIdle(); |
| 425 | 427 |
| 426 EXPECT_EQ(1, delegate.show_dialog_counter()); | 428 EXPECT_EQ(1, delegate.show_dialog_counter()); |
| 427 EXPECT_EQ(0, delegate.show_notification_counter()); | 429 EXPECT_EQ(0, delegate.show_notification_counter()); |
| 428 EXPECT_EQ(ConsentProvider::CONSENT_REJECTED, result); | 430 EXPECT_EQ(ConsentProvider::CONSENT_REJECTED, result); |
| 429 } | 431 } |
| 430 } | 432 } |
| 431 #endif | 433 #endif |
| 432 | 434 |
| 433 } // namespace extensions | 435 } // namespace extensions |
| OLD | NEW |