| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/language_order_table_model.h" | 5 #include "chrome/browser/language_order_table_model.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/table_model_observer.h" | 10 #include "app/table_model_observer.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 if (observer_) | 104 if (observer_) |
| 105 observer_->OnItemsChanged(0, RowCount()); | 105 observer_->OnItemsChanged(0, RowCount()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 int LanguageOrderTableModel::RowCount() { | 108 int LanguageOrderTableModel::RowCount() { |
| 109 return static_cast<int>(languages_.size()); | 109 return static_cast<int>(languages_.size()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void LanguageOrderTableModel::ListToVector(const std::string& list, | 112 void LanguageOrderTableModel::ListToVector(const std::string& list, |
| 113 std::vector<std::string>* vector) { | 113 std::vector<std::string>* vector) { |
| 114 SplitString(list, ',', vector); | 114 base::SplitString(list, ',', vector); |
| 115 } | 115 } |
| 116 | 116 |
| 117 std::string LanguageOrderTableModel::VectorToList( | 117 std::string LanguageOrderTableModel::VectorToList( |
| 118 const std::vector<std::string>& vector) { | 118 const std::vector<std::string>& vector) { |
| 119 std::string list; | 119 std::string list; |
| 120 for (int i = 0 ; i < static_cast<int>(vector.size()) ; i++) { | 120 for (int i = 0 ; i < static_cast<int>(vector.size()) ; i++) { |
| 121 list += vector.at(i); | 121 list += vector.at(i); |
| 122 if (i != static_cast<int>(vector.size()) - 1) | 122 if (i != static_cast<int>(vector.size()) - 1) |
| 123 list += ','; | 123 list += ','; |
| 124 } | 124 } |
| 125 return list; | 125 return list; |
| 126 } | 126 } |
| OLD | NEW |