Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: chrome/browser/extensions/api/file_system/file_system_api_unittest.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/commands/command_service.cc ('k') | chrome/browser/extensions/api/i18n/i18n_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698