Home | History | Annotate | Download | only in browser
      1 // Copyright (c) 2010 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_DEFAULT_ENCODING_COMBO_MODEL_H_
      6 #define CHROME_BROWSER_DEFAULT_ENCODING_COMBO_MODEL_H_
      7 #pragma once
      8 
      9 #include <string>
     10 #include <vector>
     11 
     12 #include "chrome/browser/character_encoding.h"
     13 #include "ui/base/models/combobox_model.h"
     14 
     15 class Profile;
     16 
     17 class DefaultEncodingComboboxModel : public ui::ComboboxModel {
     18  public:
     19   DefaultEncodingComboboxModel();
     20   virtual ~DefaultEncodingComboboxModel();
     21 
     22   // Overridden from ui::ComboboxModel.
     23   virtual int GetItemCount();
     24 
     25   virtual string16 GetItemAt(int index);
     26 
     27   std::string GetEncodingCharsetByIndex(int index);
     28 
     29   int GetSelectedEncodingIndex(Profile* profile);
     30 
     31  private:
     32   std::vector<CharacterEncoding::EncodingInfo> sorted_encoding_list_;
     33 
     34   DISALLOW_COPY_AND_ASSIGN(DefaultEncodingComboboxModel);
     35 };
     36 
     37 #endif  // CHROME_BROWSER_DEFAULT_ENCODING_COMBO_MODEL_H_
     38