[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 "base/strings/string16.h" |
14 | #include "ui/base/models/combobox_model.h" | ||||
15 | |||||
16 | class TranslateBubbleModel; | ||||
17 | |||||
18 | // The model for the combobox to select a language. This is used for Translate | ||||
19 | // user interface to select language. | ||||
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 20 | class TargetLanguageComboboxModel : public ui::ComboboxModel { |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 21 | public: |
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 22 | TargetLanguageComboboxModel(int default_index, TranslateBubbleModel* model); |
23 | ~TargetLanguageComboboxModel() override; | ||||
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 24 | |
25 | // Overridden from ui::ComboboxModel: | ||||
dcheng | 5dd5ff6 | 2014-10-21 12:42:38 | [diff] [blame] | 26 | int GetItemCount() const override; |
Mohamed Amir Yosef | 6a4b570 | 2020-05-21 15:32:46 | [diff] [blame] | 27 | base::string16 GetItemAt(int index) const override; |
dcheng | 5dd5ff6 | 2014-10-21 12:42:38 | [diff] [blame] | 28 | int GetDefaultIndex() const override; |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 29 | |
30 | private: | ||||
31 | const int default_index_; | ||||
32 | TranslateBubbleModel* model_; | ||||
33 | |||||
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 34 | DISALLOW_COPY_AND_ASSIGN(TargetLanguageComboboxModel); |
[email protected] | 0cf6414 | 2013-10-19 13:52:39 | [diff] [blame] | 35 | }; |
36 | |||||
Haohao Wang | a35a46f | 2019-05-07 23:47:02 | [diff] [blame] | 37 | #endif // CHROME_BROWSER_UI_TRANSLATE_TARGET_LANGUAGE_COMBOBOX_MODEL_H_ |