1 // Copyright 2019 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 
5 #ifndef CHROME_BROWSER_UI_TRANSLATE_SOURCE_LANGUAGE_COMBOBOX_MODEL_H_
6 #define CHROME_BROWSER_UI_TRANSLATE_SOURCE_LANGUAGE_COMBOBOX_MODEL_H_
7 
8 #include <memory>
9 
10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "base/strings/string16.h"
13 #include "ui/base/l10n/l10n_util.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.
20 class SourceLanguageComboboxModel : public ui::ComboboxModel {
21  public:
22   SourceLanguageComboboxModel(int default_index, TranslateBubbleModel* model);
23   ~SourceLanguageComboboxModel() override;
24 
25   // Overridden from ui::ComboboxModel:
26   int GetItemCount() const override;
27   base::string16 GetItemAt(int index) const override;
28   int GetDefaultIndex() const override;
29 
30  private:
31   const int default_index_;
32   TranslateBubbleModel* model_;
33 
34   DISALLOW_COPY_AND_ASSIGN(SourceLanguageComboboxModel);
35 };
36 
37 #endif  // CHROME_BROWSER_UI_TRANSLATE_SOURCE_LANGUAGE_COMBOBOX_MODEL_H_
38