| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_LANGUAGE_ORDER_TABLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_LANGUAGE_ORDER_TABLE_MODEL_H_ |
| 6 #define CHROME_BROWSER_LANGUAGE_ORDER_TABLE_MODEL_H_ | 6 #define CHROME_BROWSER_LANGUAGE_ORDER_TABLE_MODEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "app/table_model.h" | 11 #include "app/table_model.h" |
| 12 #include "app/table_model_observer.h" | 12 #include "app/table_model_observer.h" |
| 13 | 13 |
| 14 class LanguageOrderTableModel : public TableModel { | 14 class LanguageOrderTableModel : public TableModel { |
| 15 public: | 15 public: |
| 16 LanguageOrderTableModel(); | 16 LanguageOrderTableModel(); |
| 17 | 17 |
| 18 // Set Language List. | 18 // Set Language List. |
| 19 void SetAcceptLanguagesString(const std::string& language_list); | 19 void SetAcceptLanguagesString(const std::string& language_list); |
| 20 | 20 |
| 21 // Add at the end. | 21 // Add at the end. Return true if the language was added. |
| 22 void Add(const std::string& language); | 22 bool Add(const std::string& language); |
| 23 | 23 |
| 24 // Removes the entry at the specified index. | 24 // Removes the entry at the specified index. |
| 25 void Remove(int index); | 25 void Remove(int index); |
| 26 | 26 |
| 27 // Returns index corresponding to a given language. Returns -1 if the | 27 // Returns index corresponding to a given language. Returns -1 if the |
| 28 // language is not found. | 28 // language is not found. |
| 29 int GetIndex(const std::string& language); | 29 int GetIndex(const std::string& language); |
| 30 | 30 |
| 31 // Move down the entry at the specified index. | 31 // Move down the entry at the specified index. |
| 32 void MoveDown(int index); | 32 void MoveDown(int index); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 // Set of entries we're showing. | 53 // Set of entries we're showing. |
| 54 std::vector<std::string> languages_; | 54 std::vector<std::string> languages_; |
| 55 std::string comma_separated_language_list_; | 55 std::string comma_separated_language_list_; |
| 56 | 56 |
| 57 TableModelObserver* observer_; | 57 TableModelObserver* observer_; |
| 58 | 58 |
| 59 DISALLOW_COPY_AND_ASSIGN(LanguageOrderTableModel); | 59 DISALLOW_COPY_AND_ASSIGN(LanguageOrderTableModel); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 #endif // CHROME_BROWSER_LANGUAGE_ORDER_TABLE_MODEL_H_ | 62 #endif // CHROME_BROWSER_LANGUAGE_ORDER_TABLE_MODEL_H_ |
| OLD | NEW |