diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-25 23:12:49 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-25 23:12:49 +0000 |
commit | 88a446f99abb47a61d0b6a3d4015ebd1da7f60f0 (patch) | |
tree | d2e4e279424066bebfb727400a025cf41f4f34a7 | |
parent | 81d7a828f66b94e0885f2917c3f753bc4ee13fad (diff) | |
download | chromium_src-88a446f99abb47a61d0b6a3d4015ebd1da7f60f0.zip chromium_src-88a446f99abb47a61d0b6a3d4015ebd1da7f60f0.tar.gz chromium_src-88a446f99abb47a61d0b6a3d4015ebd1da7f60f0.tar.bz2 |
browser: Delete default_encoding_combo_model.* now that native options are gone.
This was introduced by me at revision r47609.
BUG=None
TEST=None
R=thestig@chromium.org
Review URL: http://codereview.chromium.org/7493042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93990 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/default_encoding_combo_model.cc | 57 | ||||
-rw-r--r-- | chrome/browser/default_encoding_combo_model.h | 37 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 2 |
3 files changed, 0 insertions, 96 deletions
diff --git a/chrome/browser/default_encoding_combo_model.cc b/chrome/browser/default_encoding_combo_model.cc deleted file mode 100644 index 4fdb87a..0000000 --- a/chrome/browser/default_encoding_combo_model.cc +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/default_encoding_combo_model.h" - -#include "base/utf_string_conversions.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/prefs/pref_member.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/pref_names.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/base/l10n/l10n_util_collator.h" - -DefaultEncodingComboboxModel::DefaultEncodingComboboxModel() { - // Initialize the vector of all sorted encodings according to current - // UI locale. - std::string locale = g_browser_process->GetApplicationLocale(); - int size = CharacterEncoding::GetSupportCanonicalEncodingCount(); - for (int i = 0; i < size; ++i) { - sorted_encoding_list_.push_back(CharacterEncoding::EncodingInfo( - CharacterEncoding::GetEncodingCommandIdByIndex(i))); - } - l10n_util::SortVectorWithStringKey(locale, &sorted_encoding_list_, true); -} - -DefaultEncodingComboboxModel::~DefaultEncodingComboboxModel() { -} - -int DefaultEncodingComboboxModel::GetItemCount() { - return static_cast<int>(sorted_encoding_list_.size()); -} - -string16 DefaultEncodingComboboxModel::GetItemAt(int index) { - DCHECK(index >= 0 && index < GetItemCount()); - return sorted_encoding_list_[index].encoding_display_name; -} - -std::string DefaultEncodingComboboxModel::GetEncodingCharsetByIndex(int index) { - DCHECK(index >= 0 && index < GetItemCount()); - int encoding_id = sorted_encoding_list_[index].encoding_id; - return CharacterEncoding::GetCanonicalEncodingNameByCommandId(encoding_id); -} - -int DefaultEncodingComboboxModel::GetSelectedEncodingIndex(Profile* profile) { - StringPrefMember current_encoding_string; - current_encoding_string.Init(prefs::kDefaultCharset, - profile->GetPrefs(), - NULL); - const std::string current_encoding = current_encoding_string.GetValue(); - for (int i = 0; i < GetItemCount(); ++i) { - if (GetEncodingCharsetByIndex(i) == current_encoding) - return i; - } - - return 0; -} diff --git a/chrome/browser/default_encoding_combo_model.h b/chrome/browser/default_encoding_combo_model.h deleted file mode 100644 index 137fe64..0000000 --- a/chrome/browser/default_encoding_combo_model.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_DEFAULT_ENCODING_COMBO_MODEL_H_ -#define CHROME_BROWSER_DEFAULT_ENCODING_COMBO_MODEL_H_ -#pragma once - -#include <string> -#include <vector> - -#include "chrome/browser/character_encoding.h" -#include "ui/base/models/combobox_model.h" - -class Profile; - -class DefaultEncodingComboboxModel : public ui::ComboboxModel { - public: - DefaultEncodingComboboxModel(); - virtual ~DefaultEncodingComboboxModel(); - - // Overridden from ui::ComboboxModel. - virtual int GetItemCount(); - - virtual string16 GetItemAt(int index); - - std::string GetEncodingCharsetByIndex(int index); - - int GetSelectedEncodingIndex(Profile* profile); - - private: - std::vector<CharacterEncoding::EncodingInfo> sorted_encoding_list_; - - DISALLOW_COPY_AND_ASSIGN(DefaultEncodingComboboxModel); -}; - -#endif // CHROME_BROWSER_DEFAULT_ENCODING_COMBO_MODEL_H_ diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index a033555..f156eed 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -805,8 +805,6 @@ 'browser/custom_handlers/register_protocol_handler_infobar_delegate.h', 'browser/custom_home_pages_table_model.cc', 'browser/custom_home_pages_table_model.h', - 'browser/default_encoding_combo_model.cc', - 'browser/default_encoding_combo_model.h', 'browser/defaults.cc', 'browser/defaults.h', 'browser/diagnostics/diagnostics_main.cc', |