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

Unified Diff: ui/base/win/open_file_name_win.cc

Issue 821453003: Update legacy Tuple-using code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/win/open_file_name_win.h ('k') | ui/base/win/open_file_name_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/open_file_name_win.cc
diff --git a/ui/base/win/open_file_name_win.cc b/ui/base/win/open_file_name_win.cc
index 3914fa5cfae43951dc8ace26a60bf10565df7345..167609debcbe3799bd38f31e29b4c107dfe0ba70 100644
--- a/ui/base/win/open_file_name_win.cc
+++ b/ui/base/win/open_file_name_win.cc
@@ -85,18 +85,15 @@ OpenFileName::~OpenFileName() {
}
void OpenFileName::SetFilters(
- const std::vector<Tuple2<base::string16, base::string16> >& filters) {
+ const std::vector<Tuple<base::string16, base::string16>>& filters) {
openfilename_.lpstrFilter = NULL;
filter_buffer_.clear();
if (filters.empty())
return;
- for (std::vector<Tuple2<base::string16, base::string16> >::const_iterator
- it = filters.begin();
- it != filters.end();
- ++it) {
- filter_buffer_.append(it->a);
+ for (const auto& filter : filters) {
+ filter_buffer_.append(get<0>(filter));
filter_buffer_.push_back(0);
- filter_buffer_.append(it->b);
+ filter_buffer_.append(get<1>(filter));
filter_buffer_.push_back(0);
}
filter_buffer_.push_back(0);
@@ -205,9 +202,9 @@ void OpenFileName::SetResult(const base::FilePath& directory,
}
// static
-std::vector<Tuple2<base::string16, base::string16> > OpenFileName::GetFilters(
- const OPENFILENAME* openfilename) {
- std::vector<Tuple2<base::string16, base::string16> > filters;
+std::vector<Tuple<base::string16, base::string16>>
+OpenFileName::GetFilters(const OPENFILENAME* openfilename) {
+ std::vector<Tuple<base::string16, base::string16>> filters;
const base::char16* display_string = openfilename->lpstrFilter;
if (!display_string)
« no previous file with comments | « ui/base/win/open_file_name_win.h ('k') | ui/base/win/open_file_name_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698