| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_UI_TRANSLATE_LANGUAGE_COMBOBOX_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TRANSLATE_LANGUAGE_COMBOBOX_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TRANSLATE_LANGUAGE_COMBOBOX_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TRANSLATE_LANGUAGE_COMBOBOX_MODEL_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 12 #include "ui/base/models/combobox_model.h" | 13 #include "ui/base/models/combobox_model.h" |
| 13 | 14 |
| 14 class TranslateBubbleModel; | 15 class TranslateBubbleModel; |
| 15 | 16 |
| 16 // The model for the combobox to select a language. This is used for Translate | 17 // The model for the combobox to select a language. This is used for Translate |
| 17 // user interface to select language. | 18 // user interface to select language. |
| 18 class LanguageComboboxModel : public ui::ComboboxModel { | 19 class LanguageComboboxModel : public ui::ComboboxModel { |
| 19 public: | 20 public: |
| 20 LanguageComboboxModel(int default_index, | 21 LanguageComboboxModel(int default_index, |
| 21 TranslateBubbleModel* model); | 22 TranslateBubbleModel* model); |
| 22 ~LanguageComboboxModel() override; | 23 ~LanguageComboboxModel() override; |
| 23 | 24 |
| 24 // Overridden from ui::ComboboxModel: | 25 // Overridden from ui::ComboboxModel: |
| 25 int GetItemCount() const override; | 26 int GetItemCount() const override; |
| 26 base::string16 GetItemAt(int index) override; | 27 base::string16 GetItemAt(int index) override; |
| 27 int GetDefaultIndex() const override; | 28 int GetDefaultIndex() const override; |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 const int default_index_; | 31 const int default_index_; |
| 31 TranslateBubbleModel* model_; | 32 TranslateBubbleModel* model_; |
| 32 | 33 |
| 33 DISALLOW_COPY_AND_ASSIGN(LanguageComboboxModel); | 34 DISALLOW_COPY_AND_ASSIGN(LanguageComboboxModel); |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 #endif // CHROME_BROWSER_UI_TRANSLATE_LANGUAGE_COMBOBOX_MODEL_H_ | 37 #endif // CHROME_BROWSER_UI_TRANSLATE_LANGUAGE_COMBOBOX_MODEL_H_ |
| OLD | NEW |