[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_UI_TRANSLATE_TARGET_LANGUAGE_COMBOBOX_MODEL_H_ |
6 | #define CHROME_BROWSER_UI_TRANSLATE_TARGET_LANGUAGE_COMBOBOX_MODEL_H_ | ||||
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 7 | |
dcheng | 9603ab9 | 2016-04-08 04:17:32 | [diff] [blame] | 8 | #include <memory> |
Jan Wilken Dörrie | ad587c3 | 2021-03-11 14:09:27 | [diff] [blame] | 9 | #include <string> |
dcheng | 9603ab9 | 2016-04-08 04:17:32 | [diff] [blame] | 10 | |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 11 | #include "base/compiler_specific.h" |
avi | 655876a | 2015-12-25 07:18:15 | [diff] [blame] | 12 | #include "base/macros.h" |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 13 | #include "ui/base/models/combobox_model.h" |
14 | |||||
15 | class TranslateBubbleModel; | ||||
16 | |||||
17 | // The model for the combobox to select a language. This is used for Translate | ||||
18 | // user interface to select language. | ||||
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 19 | class TargetLanguageComboboxModel : public ui::ComboboxModel { |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 20 | public: |
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 21 | TargetLanguageComboboxModel(int default_index, TranslateBubbleModel* model); |
Peter Boström | 53c6c595 | 2021-09-17 09:41:26 | [diff] [blame^] | 22 | |
23 | TargetLanguageComboboxModel(const TargetLanguageComboboxModel&) = delete; | ||||
24 | TargetLanguageComboboxModel& operator=(const TargetLanguageComboboxModel&) = | ||||
25 | delete; | ||||
26 | |||||
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 27 | ~TargetLanguageComboboxModel() override; |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 28 | |
29 | // Overridden from ui::ComboboxModel: | ||||
dcheng | 5dd5ff6 | 2014-10-21 12:42:38 | [diff] [blame] | 30 | int GetItemCount() const override; |
Jan Wilken Dörrie | 3f97e29 | 2021-03-11 18:07:14 | [diff] [blame] | 31 | std::u16string GetItemAt(int index) const override; |
dcheng | 5dd5ff6 | 2014-10-21 12:42:38 | [diff] [blame] | 32 | int GetDefaultIndex() const override; |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 33 | |
34 | private: | ||||
35 | const int default_index_; | ||||
36 | TranslateBubbleModel* model_; | ||||
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 37 | }; |
38 | |||||
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 39 | #endif // CHROME_BROWSER_UI_TRANSLATE_TARGET_LANGUAGE_COMBOBOX_MODEL_H_ |