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.
5 #include "chrome/browser/ui/translate/language_combobox_model.h"
7 #include "chrome/browser/ui/translate/translate_bubble_model.h"
9 LanguageComboboxModel::LanguageComboboxModel(
11 TranslateBubbleModel
* model
)
12 : default_index_(default_index
< 0 ? 0 : default_index
),
14 // view::Combobox can't treate an negative index, but |default_index| can be
15 // negative when, for example, the page's language can't be detected.
18 LanguageComboboxModel::~LanguageComboboxModel() {
21 int LanguageComboboxModel::GetItemCount() const {
22 return model_
->GetNumberOfLanguages();
25 base::string16
LanguageComboboxModel::GetItemAt(int index
) {
26 return model_
->GetLanguageNameAt(index
);
29 int LanguageComboboxModel::GetDefaultIndex() const {
30 return default_index_
;