Remove text encoding UI

Text encoding UI is removed as a part of the project Eraser effort.
Manual encoding selection is not necessary any more as the new
encoding detector is turned on by default.

Request for manual encoding switching which may still exist
can be met by utilizing Chrome extension. See the bug for
detailed discussion.

Also removed the default encoding in Settings -> Customize fonts ->
Fonts and encoding.

Discussion at chrome-ui-review can be found here https://goo.gl/47cdcb

BUG=597488
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2254273003
Cr-Commit-Position: refs/heads/master@{#415497}
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h
index 6f29d61..991ad9f 100644
--- a/chrome/app/chrome_command_ids.h
+++ b/chrome/app/chrome_command_ids.h
@@ -85,7 +85,6 @@
 #define IDC_VIEW_SOURCE                 35002
 #define IDC_PRINT                       35003
 #define IDC_SAVE_PAGE                   35004
-#define IDC_ENCODING_MENU               35005
 #define IDC_EMAIL_PAGE_LOCATION         35006
 #define IDC_BASIC_PRINT                 35007
 #define IDC_SAVE_CREDIT_CARD_FOR_PAGE   35008
@@ -93,47 +92,6 @@
 #define IDC_MANAGE_PASSWORDS_FOR_PAGE   35010
 #define IDC_ROUTE_MEDIA                 35011
 
-// When adding a new encoding to this list, be sure to append it to the
-// EncodingMenuController::kValidEncodingIds array in
-// encoding_menu_controller.cc.
-#define IDC_ENCODING_AUTO_DETECT        35500
-#define IDC_ENCODING_UTF8               35501
-#define IDC_ENCODING_UTF16LE            35502
-#define IDC_ENCODING_WINDOWS1252        35503
-#define IDC_ENCODING_GBK                35504
-#define IDC_ENCODING_GB18030            35505
-#define IDC_ENCODING_BIG5               35506
-#define IDC_ENCODING_KOREAN             35507
-#define IDC_ENCODING_SHIFTJIS           35508
-#define IDC_ENCODING_ISO2022JP          35509
-#define IDC_ENCODING_EUCJP              35510
-#define IDC_ENCODING_THAI               35511
-#define IDC_ENCODING_ISO885915          35512
-#define IDC_ENCODING_MACINTOSH          35513
-#define IDC_ENCODING_ISO88592           35514
-#define IDC_ENCODING_WINDOWS1250        35515
-#define IDC_ENCODING_ISO88595           35516
-#define IDC_ENCODING_WINDOWS1251        35517
-#define IDC_ENCODING_KOI8R              35518
-#define IDC_ENCODING_KOI8U              35519
-#define IDC_ENCODING_ISO88597           35520
-#define IDC_ENCODING_WINDOWS1253        35521
-#define IDC_ENCODING_ISO88594           35522
-#define IDC_ENCODING_ISO885913          35523
-#define IDC_ENCODING_WINDOWS1257        35524
-#define IDC_ENCODING_ISO88593           35525
-#define IDC_ENCODING_ISO885910          35526
-#define IDC_ENCODING_ISO885914          35527
-#define IDC_ENCODING_ISO885916          35528
-#define IDC_ENCODING_WINDOWS1254        35529
-#define IDC_ENCODING_ISO88596           35530
-#define IDC_ENCODING_WINDOWS1256        35531
-#define IDC_ENCODING_ISO88598           35532
-#define IDC_ENCODING_WINDOWS1255        35533
-#define IDC_ENCODING_WINDOWS1258        35534
-#define IDC_ENCODING_ISO88598I          35535
-#define IDC_ENCODING_IBM866             35536
-
 // Clipboard commands
 #define IDC_CUT                         36000
 #define IDC_COPY                        36001
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 2303890..58980477 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -1085,12 +1085,6 @@
           <message name="IDS_ZOOM_MINUS2" desc="The text label of the Make Text Smaller menu item in the merged menu">
             &#8722;
           </message>
-          <message name="IDS_ENCODING_MENU" desc="The text label of the Encoding submenu">
-            &amp;Encoding
-          </message>
-          <message name="IDS_ENCODING_AUTO_DETECT" desc="The text label of the Auto Detect submenu">
-            Auto detect
-          </message>
         </if>
         <if expr="use_titlecase">
           <message name="IDS_NEW_TAB" desc="In Title Case: The text label of a menu item for opening a new tab">
@@ -1156,12 +1150,6 @@
           <message name="IDS_ZOOM_MINUS2" desc="The text label of the Make Text Smaller menu item in the merged menu">
             &#8722;
           </message>
-          <message name="IDS_ENCODING_MENU" desc="In Title Case: The text label of the Encoding submenu">
-            &amp;Encoding
-          </message>
-          <message name="IDS_ENCODING_AUTO_DETECT" desc="In Title Case: The text label of the Auto Detect submenu">
-            Auto Detect
-          </message>
         </if>
       </if>
 
@@ -9644,25 +9632,25 @@
         </message>
 
         <!-- Font settings -->
-        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE" desc="Title that appears in the Fonts and Encoding subpage">
-          Fonts and encoding
+        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE" desc="Title that appears in the Fonts subpage">
+          Fonts
         </message>
-        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_STANDARD_LABEL" desc="Label of the Standard font section of the Fonts and Encoding subpage">
+        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_STANDARD_LABEL" desc="Label of the Standard font section of the Fonts subpage">
           Standard font
         </message>
-        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SERIF_LABEL" desc="Label of the Serif font section of the Fonts and Encoding subpage">
+        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SERIF_LABEL" desc="Label of the Serif font section of the Fonts subpage">
           Serif font
         </message>
-        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SANS_SERIF_LABEL" desc="Label of the Sans-serif font section of the Fonts and Encoding subpage">
+        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SANS_SERIF_LABEL" desc="Label of the Sans-serif font section of the Fonts subpage">
           Sans-serif font
         </message>
-        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_FIXED_WIDTH_LABEL" desc="Label of the Fixed-width font section of the Fonts and Encoding subpage">
+        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_FIXED_WIDTH_LABEL" desc="Label of the Fixed-width font section of the Fonts subpage">
           Fixed-width font
         </message>
-        <message name="IDS_FONT_LANGUAGE_SETTING_MINIMUM_FONT_SIZE_TITLE" desc="Label of the Minimum font size section of the Fonts and Encoding subpage">
+        <message name="IDS_FONT_LANGUAGE_SETTING_MINIMUM_FONT_SIZE_TITLE" desc="Label of the Minimum font size section of the Fonts subpage">
           Minimum font size
         </message>
-        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_ENCODING_TITLE" desc="Label of the Encoding section of the Fonts and Encoding subpage">
+        <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_TITLE" desc="Label of the Encoding section of the Fonts subpage">
           Encoding
         </message>
         <message name="IDS_FONT_LANGUAGE_SETTING_FONT_SIZE_TINY" desc="Label for the 'Tiny' side of the font size range selector">
@@ -9674,7 +9662,7 @@
         <message name="IDS_FONT_LANGUAGE_SETTING_LOREM_IPSUM" desc="Sample text of 'Lorem ipsum' used to show the selected font/size">
           Lorem ipsum dolor sit amet, consectetur adipiscing elit.
         </message>
-        <message name="IDS_FONT_LANGUAGE_SETTING_PLACEHOLDER" desc="Placeholder string for the Fonts and Encodings select menus">
+        <message name="IDS_FONT_LANGUAGE_SETTING_PLACEHOLDER" desc="Placeholder string for the Fonts select menus">
           Loading...
         </message>
         <message name="IDS_FONT_LANGUAGE_SETTING_ADVANCED_FONT_SETTINGS_INSTALL"
diff --git a/chrome/app/nibs/MainMenu.xib b/chrome/app/nibs/MainMenu.xib
index f32b5fa7..4d91879 100644
--- a/chrome/app/nibs/MainMenu.xib
+++ b/chrome/app/nibs/MainMenu.xib
@@ -363,10 +363,6 @@
                                 </connections>
                             </menuItem>
                             <menuItem isSeparatorItem="YES" id="631"/>
-                            <menuItem title="^IDS_ENCODING_MENU" tag="35005" id="465">
-                                <modifierMask key="keyEquivalentModifierMask"/>
-                                <menu key="submenu" title="^IDS_ENCODING_MENU" id="466"/>
-                            </menuItem>
                             <menuItem title="^IDS_DEVELOPER_MENU_MAC" id="501">
                                 <modifierMask key="keyEquivalentModifierMask"/>
                                 <menu key="submenu" title="^IDS_DEVELOPER_MENU_MAC" id="502">
diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd
index 79239013..87341d9 100644
--- a/chrome/app/resources/locale_settings.grd
+++ b/chrome/app/resources/locale_settings.grd
@@ -207,11 +207,6 @@
         8
       </message>
 
-      <!-- Locale-dependent static encodings string -->
-      <message name="IDS_STATIC_ENCODING_LIST" use_name_for_id="true">
-        windows-1252
-      </message>
-
       <!-- The URL for the the Welcome to Chrome page shown on first run. -->
       <message name="IDS_WELCOME_PAGE_URL" translateable="false">
         http://tools.google.com/chrome/intl/[GRITLANGCODE]/welcome.html
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp
index b1b7367..a41eff4 100644
--- a/chrome/app/settings_strings.grdp
+++ b/chrome/app/settings_strings.grdp
@@ -198,8 +198,8 @@
   <message name="IDS_SETTINGS_OPEN_WALLPAPER_APP" desc="Sub-label about opening the wallpaper app.">
     Open the wallpaper app
   </message>
-  <message name="IDS_SETTINGS_CHOOSE_FONTS_AND_ENCODING" desc="Sub-label about choosing font styles and text encoding.">
-    Choose font types and encoding
+  <message name="IDS_SETTINGS_CHOOSE_FONTS" desc="Sub-label about choosing font styles.">
+    Choose font types
   </message>
 
   <!-- Common -->
@@ -1720,8 +1720,8 @@
   <message name="IDS_SETTINGS_CUSTOMIZE_FONTS" desc="Label for the customize fonts button in settings.">
     Customize fonts
   </message>
-  <message name="IDS_SETTINGS_FONTS_AND_ENCODING" desc="Title for the customize fonts page in settings.">
-    Fonts and encoding
+  <message name="IDS_SETTINGS_FONTS" desc="Title for the customize fonts page in settings.">
+    Fonts
   </message>
   <message name="IDS_SETTINGS_STANDARD_FONT_LABEL" desc="Label for the standard font dropdown menu in settings.">
     Standard font
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index e25998e..2a76fadd 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -64,7 +64,6 @@
 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
 #import "chrome/browser/ui/cocoa/confirm_quit.h"
 #import "chrome/browser/ui/cocoa/confirm_quit_panel_controller.h"
-#import "chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.h"
 #include "chrome/browser/ui/cocoa/handoff_active_url_observer_bridge.h"
 #import "chrome/browser/ui/cocoa/history_menu_bridge.h"
 #include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h"
@@ -746,16 +745,6 @@
   // Dynamically update shortcuts for "Close Window" and "Close Tab" menu items.
   [[closeTabMenuItem_ menu] setDelegate:self];
 
-  // Build up the encoding menu, the order of the items differs based on the
-  // current locale (see http://crbug.com/7647 for details).
-  // We need a valid g_browser_process to get the profile which is why we can't
-  // call this from awakeFromNib.
-  NSMenu* viewMenu = [[[NSApp mainMenu] itemWithTag:IDC_VIEW_MENU] submenu];
-  NSMenuItem* encodingMenuItem = [viewMenu itemWithTag:IDC_ENCODING_MENU];
-  NSMenu* encodingMenu = [encodingMenuItem submenu];
-  EncodingMenuControllerDelegate::BuildEncodingMenu([self lastProfile],
-                                                    encodingMenu);
-
   // Instantiate the ProfileAttributesStorage observer so that we can get
   // notified when a profile is deleted.
   profileAttributesStorageObserver_.reset(new AppControllerProfileObserver(
diff --git a/chrome/browser/browser_encoding_browsertest.cc b/chrome/browser/browser_encoding_browsertest.cc
index e3c66be..12e0ee1 100644
--- a/chrome/browser/browser_encoding_browsertest.cc
+++ b/chrome/browser/browser_encoding_browsertest.cc
@@ -9,7 +9,6 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/macros.h"
 #include "build/build_config.h"
-#include "chrome/browser/character_encoding.h"
 #include "chrome/browser/net/url_request_mock_util.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
@@ -182,37 +181,6 @@
                         BrowserEncodingTest,
                         testing::ValuesIn(kEncodingTestDatas));
 
-// Marked as flaky: see  http://crbug.com/44668
-IN_PROC_BROWSER_TEST_F(BrowserEncodingTest, DISABLED_TestOverrideEncoding) {
-  const char* const kTestFileName = "gb18030_with_iso88591_meta.html";
-  const char* const kExpectedFileName =
-      "expected_gb18030_saved_from_iso88591_meta.html";
-  const char* const kOverrideTestDir = "user_override";
-
-  base::FilePath test_dir_path =
-      base::FilePath(kTestDir).AppendASCII(kOverrideTestDir);
-  test_dir_path = test_dir_path.AppendASCII(kTestFileName);
-  GURL url =
-      net::URLRequestMockHTTPJob::GetMockUrl(test_dir_path.MaybeAsASCII());
-  ui_test_utils::NavigateToURL(browser(), url);
-  content::WebContents* web_contents =
-      browser()->tab_strip_model()->GetActiveWebContents();
-  EXPECT_EQ("windows-1252", web_contents->GetEncoding());
-
-  // Override the encoding to "gb18030".
-  const std::string selected_encoding =
-      CharacterEncoding::GetCanonicalEncodingNameByAliasName("gb18030");
-  content::TestNavigationObserver navigation_observer(web_contents);
-  web_contents->SetOverrideEncoding(selected_encoding);
-  navigation_observer.Wait();
-  EXPECT_EQ("gb18030", web_contents->GetEncoding());
-
-  base::FilePath expected_filename =
-      base::FilePath().AppendASCII(kOverrideTestDir).AppendASCII(
-          kExpectedFileName);
-  SaveAndCompare(kTestFileName, expected_filename);
-}
-
 // The following encodings are excluded from the auto-detection test because
 // it's a known issue that the current encoding detector does not detect them:
 // ISO-8859-4
@@ -306,9 +274,9 @@
   content::WebContents* web_contents =
       browser()->tab_strip_model()->GetActiveWebContents();
   for (size_t i = 0; i < arraysize(kTestDatas); ++i) {
-    // Disable auto detect if it is on.
+    // Enable auto detect.
     browser()->profile()->GetPrefs()->SetBoolean(
-        prefs::kWebKitUsesUniversalDetector, false);
+        prefs::kWebKitUsesUniversalDetector, true);
 
     base::FilePath test_file_path(test_dir_path);
     test_file_path = test_file_path.AppendASCII(kTestDatas[i].test_file_name);
@@ -316,19 +284,7 @@
         net::URLRequestMockHTTPJob::GetMockUrl(test_file_path.MaybeAsASCII());
     ui_test_utils::NavigateToURL(browser(), url);
 
-    // Get the encoding used for the page, it must be the default charset we
-    // just set.
-    EXPECT_EQ("ISO-8859-4", web_contents->GetEncoding());
-
-    // Enable the encoding auto detection.
-    browser()->profile()->GetPrefs()->SetBoolean(
-        prefs::kWebKitUsesUniversalDetector, true);
-
-    content::TestNavigationObserver observer(web_contents);
-    chrome::Reload(browser(), CURRENT_TAB);
-    observer.Wait();
-
-    // Re-get the encoding of page. It should return the real encoding now.
+    // Get the encoding of page. It should return the real encoding now.
     EXPECT_EQ(kTestDatas[i].expected_encoding, web_contents->GetEncoding());
 
     // Dump the page, the content of dump page should be equal with our expect
diff --git a/chrome/browser/character_encoding.cc b/chrome/browser/character_encoding.cc
index b7c9f6fdd..2d4b0595 100644
--- a/chrome/browser/character_encoding.cc
+++ b/chrome/browser/character_encoding.cc
@@ -4,384 +4,57 @@
 
 #include "chrome/browser/character_encoding.h"
 
-#include <stddef.h>
-
-#include <map>
-#include <memory>
-#include <set>
-
-#include "base/logging.h"
 #include "base/macros.h"
-#include "base/strings/string_tokenizer.h"
-#include "base/strings/string_util.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/app/chrome_command_ids.h"
-#include "chrome/grit/generated_resources.h"
-#include "content/public/browser/browser_thread.h"
 #include "third_party/icu/source/common/unicode/ucnv.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/l10n/l10n_util_collator.h"
-
-using content::BrowserThread;
 
 namespace {
 
-// The maximum length of short list of recently user selected encodings is 3.
-const size_t kUserSelectedEncodingsMaxLength = 3;
-
-typedef struct {
-  int resource_id;
-  const char* name;
-  int category_string_id;
-} CanonicalEncodingData;
-
 // An array of all supported canonical encoding names.
-const CanonicalEncodingData kCanonicalEncodingNames[] = {
-  { IDC_ENCODING_UTF8, "UTF-8", IDS_ENCODING_UNICODE },
-  { IDC_ENCODING_UTF16LE, "UTF-16LE", IDS_ENCODING_UNICODE },
-  { IDC_ENCODING_WINDOWS1252, "windows-1252", IDS_ENCODING_WESTERN },
-  { IDC_ENCODING_GBK, "GBK", IDS_ENCODING_SIMP_CHINESE },
-  { IDC_ENCODING_GB18030, "gb18030", IDS_ENCODING_SIMP_CHINESE },
-  { IDC_ENCODING_BIG5, "Big5", IDS_ENCODING_TRAD_CHINESE },
-  { IDC_ENCODING_KOREAN, "EUC-KR", IDS_ENCODING_KOREAN },
-  { IDC_ENCODING_SHIFTJIS, "Shift_JIS", IDS_ENCODING_JAPANESE },
-  { IDC_ENCODING_EUCJP, "EUC-JP", IDS_ENCODING_JAPANESE },
-  { IDC_ENCODING_ISO2022JP, "ISO-2022-JP", IDS_ENCODING_JAPANESE },
-  { IDC_ENCODING_THAI, "windows-874", IDS_ENCODING_THAI },
-  { IDC_ENCODING_ISO885915, "ISO-8859-15", IDS_ENCODING_WESTERN },
-  { IDC_ENCODING_MACINTOSH, "macintosh", IDS_ENCODING_WESTERN },
-  { IDC_ENCODING_ISO88592, "ISO-8859-2", IDS_ENCODING_CENTRAL_EUROPEAN },
-  { IDC_ENCODING_WINDOWS1250, "windows-1250", IDS_ENCODING_CENTRAL_EUROPEAN },
-  { IDC_ENCODING_ISO88595, "ISO-8859-5", IDS_ENCODING_CYRILLIC },
-  { IDC_ENCODING_WINDOWS1251, "windows-1251", IDS_ENCODING_CYRILLIC },
-  { IDC_ENCODING_KOI8R, "KOI8-R", IDS_ENCODING_CYRILLIC },
-  { IDC_ENCODING_KOI8U, "KOI8-U", IDS_ENCODING_CYRILLIC },
-  { IDC_ENCODING_IBM866, "IBM866", IDS_ENCODING_CYRILLIC },
-  { IDC_ENCODING_ISO88597, "ISO-8859-7", IDS_ENCODING_GREEK },
-  { IDC_ENCODING_WINDOWS1253, "windows-1253", IDS_ENCODING_GREEK },
-  { IDC_ENCODING_WINDOWS1254, "windows-1254", IDS_ENCODING_TURKISH },
-  { IDC_ENCODING_WINDOWS1256, "windows-1256", IDS_ENCODING_ARABIC },
-  { IDC_ENCODING_ISO88596, "ISO-8859-6", IDS_ENCODING_ARABIC },
-  { IDC_ENCODING_WINDOWS1255, "windows-1255", IDS_ENCODING_HEBREW },
-  { IDC_ENCODING_ISO88598I, "ISO-8859-8-I", IDS_ENCODING_HEBREW },
-  { IDC_ENCODING_ISO88598, "ISO-8859-8", IDS_ENCODING_HEBREW },
-  { IDC_ENCODING_WINDOWS1258, "windows-1258", IDS_ENCODING_VIETNAMESE },
-  { IDC_ENCODING_ISO88594, "ISO-8859-4", IDS_ENCODING_BALTIC },
-  { IDC_ENCODING_ISO885913, "ISO-8859-13", IDS_ENCODING_BALTIC },
-  { IDC_ENCODING_WINDOWS1257, "windows-1257", IDS_ENCODING_BALTIC },
-  { IDC_ENCODING_ISO88593, "ISO-8859-3", IDS_ENCODING_SOUTH_EUROPEAN },
-  { IDC_ENCODING_ISO885910, "ISO-8859-10", IDS_ENCODING_NORDIC },
-  { IDC_ENCODING_ISO885914, "ISO-8859-14", IDS_ENCODING_CELTIC },
-  { IDC_ENCODING_ISO885916, "ISO-8859-16", IDS_ENCODING_ROMANIAN },
+const char* const kCanonicalEncodingNames[] = {
+    "Big5",
+    "EUC-JP",
+    "EUC-KR",
+    "gb18030",
+    "GBK",
+    "IBM866",
+    "ISO-2022-JP",
+    "ISO-8859-10",
+    "ISO-8859-13",
+    "ISO-8859-14",
+    "ISO-8859-15",
+    "ISO-8859-16",
+    "ISO-8859-2",
+    "ISO-8859-3",
+    "ISO-8859-4",
+    "ISO-8859-5",
+    "ISO-8859-6",
+    "ISO-8859-7",
+    "ISO-8859-8",
+    "ISO-8859-8-I",
+    "KOI8-R",
+    "KOI8-U",
+    "macintosh",
+    "Shift_JIS",
+    "UTF-16LE",
+    "UTF-8",
+    "windows-1250",
+    "windows-1251",
+    "windows-1252",
+    "windows-1253",
+    "windows-1254",
+    "windows-1255",
+    "windows-1256",
+    "windows-1257",
+    "windows-1258",
+    "windows-874"
 };
+} // namespace
 
-const int kCanonicalEncodingNamesLength = arraysize(kCanonicalEncodingNames);
-
-typedef std::map<int, std::pair<const char*, int> >
-    IdToCanonicalEncodingNameMapType;
-typedef std::map<const std::string, int> CanonicalEncodingNameToIdMapType;
-
-typedef struct {
-  const char* canonical_form;
-  const char* display_form;
-} CanonicalEncodingDisplayNamePair;
-
-const CanonicalEncodingDisplayNamePair kCanonicalDisplayNameOverrides[] = {
-  // Only lists the canonical names where we want a different form for display.
-  { "macintosh", "Macintosh" },
-  { "windows-874", "Windows-874" },
-  { "windows-1250", "Windows-1250" },
-  { "windows-1251", "Windows-1251" },
-  { "windows-1252", "Windows-1252" },
-  { "windows-1253", "Windows-1253" },
-  { "windows-1254", "Windows-1254" },
-  { "windows-1255", "Windows-1255" },
-  { "windows-1256", "Windows-1256" },
-  { "windows-1257", "Windows-1257" },
-  { "windows-1258", "Windows-1258" },
-};
-
-const int kCanonicalDisplayNameOverridesLength =
-    arraysize(kCanonicalDisplayNameOverrides);
-
-typedef std::map<std::string, const char*> CanonicalNameDisplayNameMapType;
-
-class CanonicalEncodingMap {
- public:
-  CanonicalEncodingMap() {}
-  const IdToCanonicalEncodingNameMapType* GetIdToCanonicalEncodingNameMapData();
-  const CanonicalEncodingNameToIdMapType* GetCanonicalEncodingNameToIdMapData();
-  const CanonicalNameDisplayNameMapType* GetCanonicalNameDisplayNameMapData();
-  std::vector<int>* locale_dependent_encoding_ids() {
-    return &locale_dependent_encoding_ids_;
+std::string GetCanonicalEncodingNameByAliasName(const std::string& alias_name) {
+  for (size_t i = 0; i < arraysize(kCanonicalEncodingNames); ++i) {
+    if (alias_name == kCanonicalEncodingNames[i])
+      return alias_name;
   }
-
-  std::vector<CharacterEncoding::EncodingInfo>* current_display_encodings() {
-    return &current_display_encodings_;
-  }
-
- private:
-  std::unique_ptr<IdToCanonicalEncodingNameMapType> id_to_encoding_name_map_;
-  std::unique_ptr<CanonicalEncodingNameToIdMapType> encoding_name_to_id_map_;
-  std::unique_ptr<CanonicalNameDisplayNameMapType>
-      encoding_name_to_display_name_map_;
-  std::vector<int> locale_dependent_encoding_ids_;
-  std::vector<CharacterEncoding::EncodingInfo> current_display_encodings_;
-
-  DISALLOW_COPY_AND_ASSIGN(CanonicalEncodingMap);
-};
-
-const IdToCanonicalEncodingNameMapType*
-    CanonicalEncodingMap::GetIdToCanonicalEncodingNameMapData() {
-  // Testing and building map is not thread safe, this function is supposed to
-  // only run in UI thread. Myabe I should add a lock in here for making it as
-  // thread safe.
-  if (!id_to_encoding_name_map_.get()) {
-    id_to_encoding_name_map_.reset(new IdToCanonicalEncodingNameMapType);
-    for (int i = 0; i < kCanonicalEncodingNamesLength; ++i) {
-      int resource_id = kCanonicalEncodingNames[i].resource_id;
-      (*id_to_encoding_name_map_)[resource_id] =
-        std::make_pair(kCanonicalEncodingNames[i].name,
-                       kCanonicalEncodingNames[i].category_string_id);
-    }
-  }
-  return id_to_encoding_name_map_.get();
-}
-
-const CanonicalEncodingNameToIdMapType*
-    CanonicalEncodingMap::GetCanonicalEncodingNameToIdMapData() {
-  if (!encoding_name_to_id_map_.get()) {
-    encoding_name_to_id_map_.reset(new CanonicalEncodingNameToIdMapType);
-    for (int i = 0; i < kCanonicalEncodingNamesLength; ++i) {
-      (*encoding_name_to_id_map_)[kCanonicalEncodingNames[i].name] =
-          kCanonicalEncodingNames[i].resource_id;
-    }
-  }
-  return encoding_name_to_id_map_.get();
-}
-
-const CanonicalNameDisplayNameMapType*
-    CanonicalEncodingMap::GetCanonicalNameDisplayNameMapData() {
-  if (!encoding_name_to_display_name_map_.get()) {
-    encoding_name_to_display_name_map_.reset(
-        new CanonicalNameDisplayNameMapType);
-    // First store the names in the kCanonicalEncodingNames list.
-    for (int i = 0; i < kCanonicalEncodingNamesLength; ++i) {
-      (*encoding_name_to_display_name_map_)[kCanonicalEncodingNames[i].name] =
-          kCanonicalEncodingNames[i].name;
-    }
-    // Then save in the overrides.
-    for (int i = 0; i < kCanonicalDisplayNameOverridesLength; ++i) {
-      (*encoding_name_to_display_name_map_)
-          [kCanonicalDisplayNameOverrides[i].canonical_form] =
-          kCanonicalDisplayNameOverrides[i].display_form;
-    }
-    DCHECK(static_cast<int>(encoding_name_to_display_name_map_->size()) ==
-           kCanonicalEncodingNamesLength)
-        << "Got an override that wasn't in the encoding list";
-  }
-  return encoding_name_to_display_name_map_.get();
-}
-
-// A static map object which contains all resourceid-nonsequenced canonical
-// encoding names.
-CanonicalEncodingMap* CanonicalEncodingMapSingleton() {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
-  static CanonicalEncodingMap* singleton = new CanonicalEncodingMap;
-  return singleton;
-}
-
-const int kDefaultEncodingMenus[] = {
-  IDC_ENCODING_UTF16LE,
-  IDC_ENCODING_WINDOWS1252,
-  IDC_ENCODING_GBK,
-  IDC_ENCODING_GB18030,
-  IDC_ENCODING_BIG5,
-  IDC_ENCODING_KOREAN,
-  IDC_ENCODING_SHIFTJIS,
-  IDC_ENCODING_EUCJP,
-  IDC_ENCODING_ISO2022JP,
-  IDC_ENCODING_THAI,
-  IDC_ENCODING_ISO885915,
-  IDC_ENCODING_MACINTOSH,
-  IDC_ENCODING_ISO88592,
-  IDC_ENCODING_WINDOWS1250,
-  IDC_ENCODING_ISO88595,
-  IDC_ENCODING_WINDOWS1251,
-  IDC_ENCODING_KOI8R,
-  IDC_ENCODING_KOI8U,
-  IDC_ENCODING_IBM866,
-  IDC_ENCODING_ISO88597,
-  IDC_ENCODING_WINDOWS1253,
-  IDC_ENCODING_WINDOWS1254,
-  IDC_ENCODING_WINDOWS1256,
-  IDC_ENCODING_ISO88596,
-  IDC_ENCODING_WINDOWS1255,
-  IDC_ENCODING_ISO88598I,
-  IDC_ENCODING_ISO88598,
-  IDC_ENCODING_WINDOWS1258,
-  IDC_ENCODING_ISO88594,
-  IDC_ENCODING_ISO885913,
-  IDC_ENCODING_WINDOWS1257,
-  IDC_ENCODING_ISO88593,
-  IDC_ENCODING_ISO885910,
-  IDC_ENCODING_ISO885914,
-  IDC_ENCODING_ISO885916,
-};
-
-const int kDefaultEncodingMenusLength = arraysize(kDefaultEncodingMenus);
-
-// Parse the input |encoding_list| which is a encoding list separated with
-// comma, get available encoding ids and save them to |available_list|.
-// The parameter |maximum_size| indicates maximum size of encoding items we
-// want to get from the |encoding_list|.
-void ParseEncodingListSeparatedWithComma(
-    const std::string& encoding_list, std::vector<int>* const available_list,
-    size_t maximum_size) {
-  base::StringTokenizer tokenizer(encoding_list, ",");
-  while (tokenizer.GetNext()) {
-    int id = CharacterEncoding::GetCommandIdByCanonicalEncodingName(
-        tokenizer.token());
-    // Ignore invalid encoding.
-    if (!id)
-      continue;
-    available_list->push_back(id);
-    if (available_list->size() == maximum_size)
-      return;
-  }
-}
-
-base::string16 GetEncodingDisplayName(const std::string& encoding_name,
-                                      int category_string_id) {
-  base::string16 category_name = l10n_util::GetStringUTF16(category_string_id);
-  if (category_string_id != IDS_ENCODING_KOREAN &&
-      category_string_id != IDS_ENCODING_THAI &&
-      category_string_id != IDS_ENCODING_TURKISH &&
-      category_string_id != IDS_ENCODING_VIETNAMESE &&
-      category_string_id != IDS_ENCODING_ROMANIAN) {
-    const CanonicalNameDisplayNameMapType* map =
-        CanonicalEncodingMapSingleton()->GetCanonicalNameDisplayNameMapData();
-    DCHECK(map);
-
-    CanonicalNameDisplayNameMapType::const_iterator found_name =
-        map->find(encoding_name);
-    DCHECK(found_name != map->end());
-    return l10n_util::GetStringFUTF16(IDS_ENCODING_DISPLAY_TEMPLATE,
-                                      category_name,
-                                      base::ASCIIToUTF16(found_name->second));
-  }
-  return category_name;
-}
-
-int GetEncodingCategoryStringIdByCommandId(int id) {
-  const IdToCanonicalEncodingNameMapType* map =
-      CanonicalEncodingMapSingleton()->GetIdToCanonicalEncodingNameMapData();
-  DCHECK(map);
-
-  IdToCanonicalEncodingNameMapType::const_iterator found_name = map->find(id);
-  if (found_name != map->end())
-    return found_name->second.second;
-  return 0;
-}
-
-std::string GetEncodingCategoryStringByCommandId(int id) {
-  int category_id = GetEncodingCategoryStringIdByCommandId(id);
-  if (category_id)
-    return l10n_util::GetStringUTF8(category_id);
-  return std::string();
-}
-
-}  // namespace
-
-CharacterEncoding::EncodingInfo::EncodingInfo(int id)
-    : encoding_id(id) {
-  encoding_category_name =
-      base::UTF8ToUTF16(GetEncodingCategoryStringByCommandId(id));
-  encoding_display_name = GetCanonicalEncodingDisplayNameByCommandId(id);
-}
-
-// Static.
-int CharacterEncoding::GetCommandIdByCanonicalEncodingName(
-    const std::string& encoding_name) {
-  const CanonicalEncodingNameToIdMapType* map =
-      CanonicalEncodingMapSingleton()->GetCanonicalEncodingNameToIdMapData();
-  DCHECK(map);
-
-  CanonicalEncodingNameToIdMapType::const_iterator found_id =
-      map->find(encoding_name);
-  if (found_id != map->end())
-    return found_id->second;
-  return 0;
-}
-
-// Static.
-std::string CharacterEncoding::GetCanonicalEncodingNameByCommandId(int id) {
-  const IdToCanonicalEncodingNameMapType* map =
-      CanonicalEncodingMapSingleton()->GetIdToCanonicalEncodingNameMapData();
-  DCHECK(map);
-
-  IdToCanonicalEncodingNameMapType::const_iterator found_name = map->find(id);
-  if (found_name != map->end())
-    return found_name->second.first;
-  return std::string();
-}
-
-// Static.
-base::string16 CharacterEncoding::GetCanonicalEncodingDisplayNameByCommandId(
-    int id) {
-  const IdToCanonicalEncodingNameMapType* map =
-      CanonicalEncodingMapSingleton()->GetIdToCanonicalEncodingNameMapData();
-  DCHECK(map);
-
-  IdToCanonicalEncodingNameMapType::const_iterator found_name = map->find(id);
-  if (found_name != map->end())
-    return GetEncodingDisplayName(found_name->second.first,
-                                  found_name->second.second);
-  return base::string16();
-}
-
-// Static.
-// Return count number of all supported canonical encoding.
-int CharacterEncoding::GetSupportCanonicalEncodingCount() {
-  return kCanonicalEncodingNamesLength;
-}
-
-// Static.
-std::string CharacterEncoding::GetCanonicalEncodingNameByIndex(int index) {
-  if (index < kCanonicalEncodingNamesLength)
-    return kCanonicalEncodingNames[index].name;
-  return std::string();
-}
-
-// Static.
-base::string16 CharacterEncoding::GetCanonicalEncodingDisplayNameByIndex(
-    int index) {
-  if (index < kCanonicalEncodingNamesLength)
-    return GetEncodingDisplayName(kCanonicalEncodingNames[index].name,
-        kCanonicalEncodingNames[index].category_string_id);
-  return base::string16();
-}
-
-// Static.
-int CharacterEncoding::GetEncodingCommandIdByIndex(int index) {
-  if (index < kCanonicalEncodingNamesLength)
-    return kCanonicalEncodingNames[index].resource_id;
-  return 0;
-}
-
-// Static.
-std::string CharacterEncoding::GetCanonicalEncodingNameByAliasName(
-    const std::string& alias_name) {
-  // If the input alias_name is already canonical encoding name, just return it.
-  const CanonicalEncodingNameToIdMapType* map =
-      CanonicalEncodingMapSingleton()->GetCanonicalEncodingNameToIdMapData();
-  DCHECK(map);
-
-  CanonicalEncodingNameToIdMapType::const_iterator found_id =
-      map->find(alias_name);
-  if (found_id != map->end())
-    return alias_name;
-
   const char* standards[3] = { "HTML", "MIME", "IANA" };
   for (size_t i = 0; i < arraysize(standards); ++i) {
     UErrorCode error_code = U_ZERO_ERROR;
@@ -392,140 +65,3 @@
   }
   return std::string();
 }
-
-// Static
-// According to the behavior of user recently selected encoding short list in
-// Firefox, we always put UTF-8 as top position, after then put user
-// recent selected encodings, then put local dependent encoding items.
-// At last, we put all remaining encoding items.
-const std::vector<CharacterEncoding::EncodingInfo>*
-    CharacterEncoding::GetCurrentDisplayEncodings(
-    const std::string& locale,
-    const std::string& locale_encodings,
-    const std::string& recently_select_encodings) {
-  std::vector<int>* const locale_dependent_encoding_list =
-      CanonicalEncodingMapSingleton()->locale_dependent_encoding_ids();
-  std::vector<CharacterEncoding::EncodingInfo>* const encoding_list =
-      CanonicalEncodingMapSingleton()->current_display_encodings();
-
-  // Initialize locale dependent static encoding list.
-  if (locale_dependent_encoding_list->empty() && !locale_encodings.empty())
-    ParseEncodingListSeparatedWithComma(locale_encodings,
-                                        locale_dependent_encoding_list,
-                                        kUserSelectedEncodingsMaxLength);
-
-  CR_DEFINE_STATIC_LOCAL(std::string, cached_user_selected_encodings, ());
-  // Build current display encoding list.
-  if (encoding_list->empty() ||
-      cached_user_selected_encodings != recently_select_encodings) {
-    // Update user recently selected encodings.
-    cached_user_selected_encodings = recently_select_encodings;
-    // Clear old encoding list since user recently selected encodings changed.
-    encoding_list->clear();
-    // Always add UTF-8 to first encoding position.
-    encoding_list->push_back(EncodingInfo(IDC_ENCODING_UTF8));
-    std::set<int> inserted_encoding;
-    inserted_encoding.insert(IDC_ENCODING_UTF8);
-
-    // Parse user recently selected encodings and get list
-    std::vector<int> recently_select_encoding_list;
-    ParseEncodingListSeparatedWithComma(recently_select_encodings,
-                                        &recently_select_encoding_list,
-                                        kUserSelectedEncodingsMaxLength);
-
-    // Put 'cached encodings' (dynamic encoding list) after 'local dependent
-    // encoding list'.
-    recently_select_encoding_list.insert(recently_select_encoding_list.begin(),
-        locale_dependent_encoding_list->begin(),
-        locale_dependent_encoding_list->end());
-    for (std::vector<int>::iterator it = recently_select_encoding_list.begin();
-         it != recently_select_encoding_list.end(); ++it) {
-        // Test whether we have met this encoding id.
-        bool ok = inserted_encoding.insert(*it).second;
-        // Duplicated encoding, ignore it. Ideally, this situation should not
-        // happened, but just in case some one manually edit preference file.
-        if (!ok)
-          continue;
-        encoding_list->push_back(EncodingInfo(*it));
-    }
-    // Append a separator;
-    encoding_list->push_back(EncodingInfo(0));
-
-    // We need to keep "Unicode (UTF-16LE)" always at the top (among the rest
-    // of encodings) instead of being sorted along with other encodings. So if
-    // "Unicode (UTF-16LE)" is already in previous encodings, sort the rest
-    // of encodings. Otherwise Put "Unicode (UTF-16LE)" on the first of the
-    // rest of encodings, skip "Unicode (UTF-16LE)" and sort all left encodings.
-    int start_sorted_index = encoding_list->size();
-    if (inserted_encoding.find(IDC_ENCODING_UTF16LE) ==
-        inserted_encoding.end()) {
-      encoding_list->push_back(EncodingInfo(IDC_ENCODING_UTF16LE));
-      inserted_encoding.insert(IDC_ENCODING_UTF16LE);
-      start_sorted_index++;
-    }
-
-    // Add the rest of encodings that are neither in the static encoding list
-    // nor in the list of recently selected encodings.
-    // Build the encoding list sorted in the current locale sorting order.
-    for (int i = 0; i < kDefaultEncodingMenusLength; ++i) {
-      int id = kDefaultEncodingMenus[i];
-      // We have inserted this encoding, skip it.
-      if (inserted_encoding.find(id) != inserted_encoding.end())
-        continue;
-      encoding_list->push_back(EncodingInfo(id));
-    }
-    // Sort the encoding list.
-    l10n_util::SortVectorWithStringKey(locale,
-                                       encoding_list,
-                                       start_sorted_index,
-                                       encoding_list->size(),
-                                       true);
-  }
-  DCHECK(!encoding_list->empty());
-  return encoding_list;
-}
-
-// Static
-bool CharacterEncoding::UpdateRecentlySelectedEncoding(
-    const std::string& original_selected_encodings,
-    int new_selected_encoding_id,
-    std::string* selected_encodings) {
-  // Get encoding name.
-  std::string encoding_name =
-      GetCanonicalEncodingNameByCommandId(new_selected_encoding_id);
-  DCHECK(!encoding_name.empty());
-  // Check whether the new encoding is in local dependent encodings or original
-  // recently selected encodings. If yes, do not add it.
-  std::vector<int>* locale_dependent_encoding_list =
-      CanonicalEncodingMapSingleton()->locale_dependent_encoding_ids();
-  DCHECK(locale_dependent_encoding_list);
-  std::vector<int> selected_encoding_list;
-  ParseEncodingListSeparatedWithComma(original_selected_encodings,
-                                      &selected_encoding_list,
-                                      kUserSelectedEncodingsMaxLength);
-  // Put 'cached encodings' (dynamic encoding list) after 'local dependent
-  // encoding list' for check.
-  std::vector<int> top_encoding_list(*locale_dependent_encoding_list);
-  // UTF8 is always in our optimized encoding list.
-  top_encoding_list.insert(top_encoding_list.begin(), IDC_ENCODING_UTF8);
-  top_encoding_list.insert(top_encoding_list.end(),
-                           selected_encoding_list.begin(),
-                           selected_encoding_list.end());
-  for (std::vector<int>::const_iterator it = top_encoding_list.begin();
-       it != top_encoding_list.end(); ++it)
-    if (*it == new_selected_encoding_id)
-      return false;
-  // Need to add the encoding id to recently selected encoding list.
-  // Remove the last encoding in original list.
-  if (selected_encoding_list.size() == kUserSelectedEncodingsMaxLength)
-    selected_encoding_list.pop_back();
-  // Insert new encoding to head of selected encoding list.
-  *selected_encodings = encoding_name;
-  // Generate the string for rest selected encoding list.
-  for (std::vector<int>::const_iterator it = selected_encoding_list.begin();
-       it != selected_encoding_list.end(); ++it) {
-    selected_encodings->append(1, L',');
-    selected_encodings->append(GetCanonicalEncodingNameByCommandId(*it));
-  }
-  return true;
-}
diff --git a/chrome/browser/character_encoding.h b/chrome/browser/character_encoding.h
index 2c70a17..52b210e3 100644
--- a/chrome/browser/character_encoding.h
+++ b/chrome/browser/character_encoding.h
@@ -6,101 +6,9 @@
 #define CHROME_BROWSER_CHARACTER_ENCODING_H_
 
 #include <string>
-#include <vector>
 
-#include "base/macros.h"
-#include "base/strings/string16.h"
-
-class CharacterEncoding {
- public:
-  // Enumeration of the types of Browser encoding name we
-  // currently support. This is defined outside of Browser
-  // to avoid cyclical dependencies.
-
-  // Structure to save encoding information.
-  struct EncodingInfo {
-    explicit EncodingInfo(int id);
-    // Gets string key of EncodingInfo. With this method, we can use
-    // l10n_util::SortVectorWithStringKey to sort the encoding menu items
-    // by current locale character sequence. We need to keep the order within
-    // encoding category name, that's why we use category name as key.
-    const base::string16& GetStringKey() const { return encoding_category_name; }
-
-    // Encoding command id.
-    int encoding_id;
-    // Encoding display name.
-    base::string16 encoding_display_name;
-    // Encoding category name.
-    base::string16 encoding_category_name;
-  };
-
-  // Return canonical encoding name according to the command ID.
-  // THIS FUNCTION IS NOT THREADSAFE. You must run this function
-  // only in UI thread.
-  static std::string GetCanonicalEncodingNameByCommandId(int id);
-
-  // Return display name of canonical encoding according to the command
-  // ID. THIS FUNCTION IS NOT THREADSAFE. You must run this function
-  // only in UI thread.
-  static base::string16 GetCanonicalEncodingDisplayNameByCommandId(int id);
-
-  // Return count number of all supported canonical encoding.
-  static int GetSupportCanonicalEncodingCount();
-
-  // Return canonical encoding name according to the index, which starts
-  // from zero to GetSupportCanonicalEncodingCount() - 1. THIS FUNCTION
-  // IS NOT THREADSAFE. You must run this function only in UI thread.
-  static std::string GetCanonicalEncodingNameByIndex(int index);
-
-  // Return display name of canonical encoding according to the index,
-  // which starts from zero to GetSupportCanonicalEncodingCount() - 1.
-  // THIS FUNCTION IS NOT THREADSAFE. You must run this function
-  // only in UI thread.
-  static base::string16 GetCanonicalEncodingDisplayNameByIndex(int index);
-
-  // Return encoding command id according to the index, which starts from
-  // zero to GetSupportCanonicalEncodingCount() - 1. Otherwise returns 0.
-  static int GetEncodingCommandIdByIndex(int index);
-
-  // Return canonical encoding name according to the encoding alias name. THIS
-  // FUNCTION IS NOT THREADSAFE. You must run this function only in UI thread.
-  static std::string GetCanonicalEncodingNameByAliasName(
-      const std::string& alias_name);
-
-  // Returns the pointer of a vector of EncodingInfos corresponding to
-  // encodings to display in the encoding menu. The locale-dependent static
-  // encodings come at the top of the list and recently selected encodings
-  // come next. Finally, the rest of encodings are listed.
-  // The vector will be created and destroyed by CharacterEncoding.
-  // The returned std::vector is maintained by this class. The parameter
-  // |locale| points to the current application (UI) locale. The parameter
-  // |locale_encodings| is string of static encodings list which is from the
-  // corresponding string resource that is stored in the resource bundle.
-  // The parameter |recently_select_encodings| is string of encoding list which
-  // is from user recently selected. THIS FUNCTION IS NOT THREADSAFE. You must
-  // run this function only in UI thread.
-  static const std::vector<EncodingInfo>* GetCurrentDisplayEncodings(
-      const std::string& locale,
-      const std::string& locale_encodings,
-      const std::string& recently_select_encodings);
-
-  // This function is for updating |original_selected_encoding_list| with a
-  // |new_selected_encoding_id|. If the encoding is already in the original
-  // list, then returns false. Otherwise |selected_encoding_list| will return a
-  // new string for user selected encoding short list and function returns true.
-  static bool UpdateRecentlySelectedEncoding(
-      const std::string& original_selected_encodings,
-      int new_selected_encoding_id,
-      std::string* selected_encodings);
-
-  // Get encoding command id according to input encoding name. If the name is
-  // valid, return corresponding encoding command id. Otherwise return 0;
-  static int GetCommandIdByCanonicalEncodingName(
-      const std::string& encoding_name);
-
- private:
-  // Disallow instantiating it since this class only contains static methods.
-  DISALLOW_IMPLICIT_CONSTRUCTORS(CharacterEncoding);
-};
+// Return canonical encoding name according to the encoding alias name.
+// TODO(jinsukkim): Move this to somewhere under content/.
+std::string GetCanonicalEncodingNameByAliasName(const std::string& alias_name);
 
 #endif  // CHROME_BROWSER_CHARACTER_ENCODING_H_
diff --git a/chrome/browser/character_encoding_unittest.cc b/chrome/browser/character_encoding_unittest.cc
new file mode 100644
index 0000000..05d6dda
--- /dev/null
+++ b/chrome/browser/character_encoding_unittest.cc
@@ -0,0 +1,22 @@
+// Copyright (c) 2016 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/character_encoding.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(CharacterEncodingTest, GetCanonicalEncodingNameByAliasName) {
+  EXPECT_EQ("Big5",
+            GetCanonicalEncodingNameByAliasName("Big5"));
+  EXPECT_EQ("windows-874",
+            GetCanonicalEncodingNameByAliasName("windows-874"));
+  EXPECT_EQ("ISO-8859-8",
+            GetCanonicalEncodingNameByAliasName("ISO-8859-8"));
+
+  // Non-canonical alias names should be converted to a canonical one.
+  EXPECT_EQ("UTF-8",
+            GetCanonicalEncodingNameByAliasName("utf8"));
+  EXPECT_EQ("gb18030",
+            GetCanonicalEncodingNameByAliasName("GB18030"));
+}
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index d5313df..f3b8bcb4 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1339,7 +1339,7 @@
 
 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName(
     const std::string& alias_name) {
-  return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name);
+  return ::GetCanonicalEncodingNameByAliasName(alias_name);
 }
 
 namespace {
@@ -2412,8 +2412,7 @@
   web_prefs->password_echo_enabled = browser_defaults::kPasswordEchoEnabled;
 #endif
 
-  web_prefs->uses_universal_detector =
-      prefs->GetBoolean(prefs::kWebKitUsesUniversalDetector);
+  web_prefs->uses_universal_detector = true;  // autodetection is always on.
   web_prefs->text_areas_are_resizable =
       prefs->GetBoolean(prefs::kWebKitTextAreasAreResizable);
   web_prefs->hyperlink_auditing_enabled =
@@ -2432,8 +2431,7 @@
 #endif
 
   // Make sure we will set the default_encoding with canonical encoding name.
-  web_prefs->default_encoding =
-      CharacterEncoding::GetCanonicalEncodingNameByAliasName(
+  web_prefs->default_encoding = GetCanonicalEncodingNameByAliasName(
           web_prefs->default_encoding);
   if (web_prefs->default_encoding.empty()) {
     prefs->ClearPref(prefs::kDefaultCharset);
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index c3d1343..1399791 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -642,6 +642,8 @@
 
   registry->RegisterBooleanPref(kNetworkPredictionEnabled, true);
   registry->RegisterBooleanPref(kDisableSpdy, false);
+  registry->RegisterStringPref(prefs::kStaticEncodings, std::string());
+  registry->RegisterStringPref(prefs::kRecentlySelectedEncoding, std::string());
 }
 
 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -742,6 +744,10 @@
   DeleteWebRTCIdentityStoreDB(profile);
   profile_prefs->ClearPref(kNetworkPredictionEnabled);
   profile_prefs->ClearPref(kDisableSpdy);
+
+  // Added 8/2016.
+  profile_prefs->ClearPref(prefs::kStaticEncodings);
+  profile_prefs->ClearPref(prefs::kRecentlySelectedEncoding);
 }
 
 }  // namespace chrome
diff --git a/chrome/browser/resources/options/font_settings.html b/chrome/browser/resources/options/font_settings.html
index b35cb25..6da0cef 100644
--- a/chrome/browser/resources/options/font_settings.html
+++ b/chrome/browser/resources/options/font_settings.html
@@ -86,17 +86,6 @@
         <div id="minimum-font-sample" class="font-sample-div"></div>
       </div>
     </section>
-    <section>
-      <h3 i18n-content="fontSettingsEncoding"></h3>
-      <div class="font-input-div">
-        <div>
-          <select id="font-encoding" data-type="string"
-              pref="intl.charset_default"
-              metric="Options_ChangeFontEncoding">
-          </select>
-        </div>
-      </div>
-    </section>
   </div>
   <div class="action-area">
     <div class="button-strip">
diff --git a/chrome/browser/resources/options/font_settings.js b/chrome/browser/resources/options/font_settings.js
index 802fb96..74be53d 100644
--- a/chrome/browser/resources/options/font_settings.js
+++ b/chrome/browser/resources/options/font_settings.js
@@ -10,7 +10,7 @@
 
   /**
    * FontSettings class
-   * Encapsulated handling of the 'Fonts and Encoding' page.
+   * Encapsulated handling of the 'Fonts' page.
    * @class
    */
   function FontSettings() {
@@ -50,8 +50,7 @@
 
       var placeholder = loadTimeData.getString('fontSettingsPlaceholder');
       var elements = [$('standard-font-family'), $('serif-font-family'),
-                      $('sans-serif-font-family'), $('fixed-font-family'),
-                      $('font-encoding')];
+                      $('sans-serif-font-family'), $('fixed-font-family')];
       elements.forEach(function(el) {
         el.appendChild(new Option(placeholder));
         el.setDisabled('noFontsAvailable', true);
@@ -197,7 +196,7 @@
   };
 
   // Chrome callbacks
-  FontSettings.setFontsData = function(fonts, encodings, selectedValues) {
+  FontSettings.setFontsData = function(fonts, selectedValues) {
     FontSettings.getInstance().populateSelect_($('standard-font-family'), fonts,
                                                selectedValues[0]);
     FontSettings.getInstance().populateSelect_($('serif-font-family'), fonts,
@@ -206,8 +205,6 @@
                                                fonts, selectedValues[2]);
     FontSettings.getInstance().populateSelect_($('fixed-font-family'), fonts,
                                                selectedValues[3]);
-    FontSettings.getInstance().populateSelect_($('font-encoding'), encodings,
-                                               selectedValues[4]);
   };
 
   FontSettings.setUpStandardFontSample = function(font, size) {
@@ -253,4 +250,3 @@
     FontSettings: FontSettings
   };
 });
-
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html
index 0157b2471..58038ce 100644
--- a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.html
@@ -107,13 +107,6 @@
         </div>
       </div>
     </div>
-    <div class="settings-box">
-      <div class="start">$i18n{encoding}</div>
-      <settings-dropdown-menu
-          pref="{{prefs.intl.charset_default}}"
-          menu-options="[[encodingOptions_]]">
-      </settings-dropdown-menu>
-    </div>
     <div class="settings-box two-line" id="advancedButton"
         on-tap="openAdvancedExtension_" actionable>
       <div class="start">
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js
index 893b39c..2e26c59 100644
--- a/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js
+++ b/chrome/browser/resources/settings/appearance_page/appearance_fonts_page.js
@@ -51,9 +51,6 @@
       browserProxy_: Object,
 
       /** @private {!DropdownMenuOptionList} */
-      encodingOptions_: Object,
-
-      /** @private {!DropdownMenuOptionList} */
       fontOptions_: Object,
 
       /**
@@ -124,7 +121,7 @@
     },
 
     /**
-     * @param {!FontsData} response A list of fonts, encodings and the advanced
+     * @param {!FontsData} response A list of fonts and the advanced
      *     font settings extension URL.
      * @private
      */
@@ -137,15 +134,6 @@
         });
       }
       this.fontOptions_ = fontMenuOptions;
-
-      var encodingMenuOptions = [];
-      for (i = 0; i < response.encodingList.length; ++i) {
-        encodingMenuOptions.push({
-          value: response.encodingList[i][0],
-          name: response.encodingList[i][1]
-        });
-      }
-      this.encodingOptions_ = encodingMenuOptions;
       this.advancedExtensionUrl_ = response.extensionUrl;
     },
 
diff --git a/chrome/browser/resources/settings/appearance_page/appearance_page.html b/chrome/browser/resources/settings/appearance_page/appearance_page.html
index 098f2e7..1071e84 100644
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -114,7 +114,7 @@
             class="settings-box two-line single-column"
             on-tap="onCustomizeFontsTap_" actionable>
           <div>$i18n{customizeFonts}</div>
-          <div class="secondary">$i18n{chooseFontsAndEncoding}</div>
+          <div class="secondary">$i18n{chooseFonts}</div>
         </div>
         <div class="settings-box"
             hidden="[[!pageVisibility.pageZoom]]">
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 825bed0..e9bc27e 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -38,7 +38,6 @@
 #include "chrome/browser/banners/app_banner_manager_desktop.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/browser_shutdown.h"
-#include "chrome/browser/character_encoding.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
@@ -415,11 +414,6 @@
       base::Bind(&Browser::UpdateBookmarkBarState, base::Unretained(this),
                  BOOKMARK_BAR_STATE_CHANGE_PREF_CHANGE));
 
-  // NOTE: These prefs all need to be explicitly destroyed in the destructor
-  // or you'll get a nasty surprise when you run the incognito tests.
-  encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector,
-                             profile_->GetPrefs());
-
   if (search::IsInstantExtendedAPIEnabled() && is_type_tabbed())
     instant_controller_.reset(new BrowserInstantController(this));
 
@@ -496,8 +490,6 @@
 
   profile_pref_registrar_.RemoveAll();
 
-  encoding_auto_detect_.Destroy();
-
   // Destroy BrowserExtensionWindowController before the incognito profile
   // is destroyed to make sure the chrome.windows.onRemoved event is sent.
   extension_window_controller_.reset();
@@ -828,38 +820,6 @@
   return SupportsWindowFeatureImpl(feature, false);
 }
 
-void Browser::ToggleEncodingAutoDetect() {
-  content::RecordAction(UserMetricsAction("AutoDetectChange"));
-  encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue());
-  // If "auto detect" is turned on, then any current override encoding
-  // is cleared. This also implicitly performs a reload.
-  // OTOH, if "auto detect" is turned off, we don't change the currently
-  // active encoding.
-  if (encoding_auto_detect_.GetValue()) {
-    WebContents* contents = tab_strip_model_->GetActiveWebContents();
-    if (contents)
-      contents->ResetOverrideEncoding();
-  }
-}
-
-void Browser::OverrideEncoding(int encoding_id) {
-  content::RecordAction(UserMetricsAction("OverrideEncoding"));
-  const std::string selected_encoding =
-      CharacterEncoding::GetCanonicalEncodingNameByCommandId(encoding_id);
-  WebContents* contents = tab_strip_model_->GetActiveWebContents();
-  if (!selected_encoding.empty() && contents)
-     contents->SetOverrideEncoding(selected_encoding);
-  // Update the list of recently selected encodings.
-  std::string new_selected_encoding_list;
-  if (CharacterEncoding::UpdateRecentlySelectedEncoding(
-        profile_->GetPrefs()->GetString(prefs::kRecentlySelectedEncoding),
-        encoding_id,
-        &new_selected_encoding_list)) {
-    profile_->GetPrefs()->SetString(prefs::kRecentlySelectedEncoding,
-                                    new_selected_encoding_list);
-  }
-}
-
 void Browser::OpenFile() {
   content::RecordAction(UserMetricsAction("OpenFile"));
   select_file_dialog_ = ui::SelectFileDialog::Create(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 5ee2e2045..3205130 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -36,7 +36,6 @@
 #include "components/content_settings/core/common/content_settings.h"
 #include "components/content_settings/core/common/content_settings_types.h"
 #include "components/prefs/pref_change_registrar.h"
-#include "components/prefs/pref_member.h"
 #include "components/sessions/core/session_id.h"
 #include "components/toolbar/toolbar_model.h"
 #include "components/translate/content/browser/content_translate_driver.h"
@@ -388,11 +387,6 @@
   // in |SupportsWindowFeature| for details on this.
   bool CanSupportWindowFeature(WindowFeature feature) const;
 
-  // TODO(port): port these, and re-merge the two function declaration lists.
-  // Page-related commands.
-  void ToggleEncodingAutoDetect();
-  void OverrideEncoding(int encoding_id);
-
   // Show various bits of UI
   void OpenFile();
 
@@ -965,9 +959,6 @@
   // Dialog box used for opening and saving files.
   scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
 
-  // Keep track of the encoding auto detect pref.
-  BooleanPrefMember encoding_auto_detect_;
-
   // Helper which implements the ContentSettingBubbleModel interface.
   std::unique_ptr<BrowserContentSettingBubbleModelDelegate>
       content_setting_bubble_model_delegate_;
diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
index e39675f..ad3ebe0 100644
--- a/chrome/browser/ui/browser_browsertest.cc
+++ b/chrome/browser/ui/browser_browsertest.cc
@@ -1866,7 +1866,6 @@
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_VIEW_SOURCE));
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_PRINT));
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SAVE_PAGE));
-  EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_ENCODING_MENU));
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_DUPLICATE_TAB));
 
   WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
@@ -1880,7 +1879,6 @@
   EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_VIEW_SOURCE));
   EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_PRINT));
   EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_SAVE_PAGE));
-  EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_ENCODING_MENU));
   EXPECT_FALSE(command_updater->IsCommandEnabled(IDC_DUPLICATE_TAB));
 
   // Proceed and wait for interstitial to detach. This doesn't destroy
@@ -1892,7 +1890,6 @@
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_VIEW_SOURCE));
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_PRINT));
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_SAVE_PAGE));
-  EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_ENCODING_MENU));
   EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_DUPLICATE_TAB));
 }
 
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 1b2d8fa6..ef5a797 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -94,24 +94,6 @@
   WINDOW_STATE_FULLSCREEN,
 };
 
-// Returns |true| if entry has an internal chrome:// URL, |false| otherwise.
-bool HasInternalURL(const NavigationEntry* entry) {
-  if (!entry)
-    return false;
-
-  // Check the |virtual_url()| first. This catches regular chrome:// URLs
-  // including URLs that were rewritten (such as chrome://bookmarks).
-  if (entry->GetVirtualURL().SchemeIs(content::kChromeUIScheme))
-    return true;
-
-  // If the |virtual_url()| isn't a chrome:// URL, check if it's actually
-  // view-source: of a chrome:// URL.
-  if (entry->GetVirtualURL().SchemeIs(content::kViewSourceScheme))
-    return entry->GetURL().SchemeIs(content::kChromeUIScheme);
-
-  return false;
-}
-
 }  // namespace
 
 namespace chrome {
@@ -474,49 +456,6 @@
       ManagePasswordsForPage(browser_);
       break;
 
-    // Page encoding commands
-    case IDC_ENCODING_AUTO_DETECT:
-      browser_->ToggleEncodingAutoDetect();
-      break;
-    case IDC_ENCODING_UTF8:
-    case IDC_ENCODING_UTF16LE:
-    case IDC_ENCODING_WINDOWS1252:
-    case IDC_ENCODING_GBK:
-    case IDC_ENCODING_GB18030:
-    case IDC_ENCODING_BIG5:
-    case IDC_ENCODING_KOREAN:
-    case IDC_ENCODING_SHIFTJIS:
-    case IDC_ENCODING_ISO2022JP:
-    case IDC_ENCODING_EUCJP:
-    case IDC_ENCODING_THAI:
-    case IDC_ENCODING_ISO885915:
-    case IDC_ENCODING_MACINTOSH:
-    case IDC_ENCODING_ISO88592:
-    case IDC_ENCODING_WINDOWS1250:
-    case IDC_ENCODING_ISO88595:
-    case IDC_ENCODING_WINDOWS1251:
-    case IDC_ENCODING_KOI8R:
-    case IDC_ENCODING_KOI8U:
-    case IDC_ENCODING_IBM866:
-    case IDC_ENCODING_ISO88597:
-    case IDC_ENCODING_WINDOWS1253:
-    case IDC_ENCODING_ISO88594:
-    case IDC_ENCODING_ISO885913:
-    case IDC_ENCODING_WINDOWS1257:
-    case IDC_ENCODING_ISO88593:
-    case IDC_ENCODING_ISO885910:
-    case IDC_ENCODING_ISO885914:
-    case IDC_ENCODING_ISO885916:
-    case IDC_ENCODING_WINDOWS1254:
-    case IDC_ENCODING_ISO88596:
-    case IDC_ENCODING_WINDOWS1256:
-    case IDC_ENCODING_ISO88598:
-    case IDC_ENCODING_ISO88598I:
-    case IDC_ENCODING_WINDOWS1255:
-    case IDC_ENCODING_WINDOWS1258:
-      browser_->OverrideEncoding(id);
-      break;
-
     // Clipboard commands
     case IDC_CUT:
     case IDC_COPY:
@@ -819,43 +758,6 @@
   // Page-related commands
   command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true);
   command_updater_.UpdateCommandEnabled(IDC_MANAGE_PASSWORDS_FOR_PAGE, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1252, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_GBK, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_GB18030, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_BIG5, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_THAI, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_KOREAN, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_SHIFTJIS, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO2022JP, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_EUCJP, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885915, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_MACINTOSH, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88592, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1250, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88595, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1251, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_KOI8R, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_KOI8U, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_IBM866, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88597, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1253, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88594, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885913, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1257, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88593, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885910, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885914, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO885916, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1254, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88596, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1256, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88598, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_ISO88598I, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1255, true);
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1258, true);
 
   // Zoom
   command_updater_.UpdateCommandEnabled(IDC_ZOOM_MENU, true);
@@ -1014,13 +916,6 @@
   if (browser_->is_devtools())
     command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false);
 
-  // Changing the encoding is not possible on Chrome-internal webpages.
-  NavigationController& nc = current_web_contents->GetController();
-  bool is_chrome_internal = HasInternalURL(nc.GetLastCommittedEntry()) ||
-      current_web_contents->ShowingInterstitialPage();
-  command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU,
-      !is_chrome_internal && current_web_contents->IsSavable());
-
   // Show various bits of UI
   // TODO(pinkerton): Disable app-mode in the model until we implement it
   // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148
diff --git a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
index fd03a4be..b1b8196 100644
--- a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
+++ b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
@@ -26,7 +26,6 @@
 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
-#import "chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.h"
 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h"
 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
 #import "chrome/browser/ui/cocoa/l10n_util.h"
diff --git a/chrome/browser/ui/cocoa/browser_window_command_handler.mm b/chrome/browser/ui/cocoa/browser_window_command_handler.mm
index 16c4d22..e697006 100644
--- a/chrome/browser/ui/cocoa/browser_window_command_handler.mm
+++ b/chrome/browser/ui/cocoa/browser_window_command_handler.mm
@@ -14,7 +14,6 @@
 #include "chrome/browser/ui/browser_finder.h"
 #include "chrome/browser/ui/browser_window.h"
 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
-#include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/grit/generated_resources.h"
 #include "content/public/browser/user_metrics.h"
@@ -57,25 +56,6 @@
     SetToggleState(prefs->GetBoolean(prefs::kShowFullscreenToolbar), item);
     return;
   }
-
-  // Update the checked/unchecked state of items in the encoding menu.
-  // On Windows, this logic is part of |EncodingMenuModel| in
-  // browser/ui/views/toolbar_view.h.
-  EncodingMenuController encoding_controller;
-  if (!encoding_controller.DoesCommandBelongToEncodingMenu(tag))
-    return;
-
-  Profile* profile = browser->profile();
-  DCHECK(profile);
-  content::WebContents* current_tab =
-      browser->tab_strip_model()->GetActiveWebContents();
-  if (!current_tab)
-    return;
-
-  const std::string encoding = current_tab->GetEncoding();
-
-  SetToggleState(encoding_controller.IsItemChecked(profile, encoding, tag),
-                 item);
 }
 
 NSString* GetTitleForViewsFullscreenMenuItem(Browser* browser) {
@@ -192,12 +172,7 @@
       break;
     }
     default:
-      // Special handling for the contents of the Text Encoding submenu. On
-      // Mac OS, instead of enabling/disabling the top-level menu item, we
-      // enable/disable the submenu's contents (per Apple's HIG).
-      EncodingMenuController encoding_controller;
-      if (encoding_controller.DoesCommandBelongToEncodingMenu(tag))
-        enable &= chrome::IsCommandEnabled(browser, IDC_ENCODING_MENU);
+      break;
   }
 
   // If the item is toggleable, find its toggle state and
diff --git a/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.h b/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.h
deleted file mode 100644
index 84f0fad..0000000
--- a/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2009 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_UI_COCOA_ENCODING_MENU_CONTROLLER_DELEGATE_MAC_H_
-#define CHROME_BROWSER_UI_COCOA_ENCODING_MENU_CONTROLLER_DELEGATE_MAC_H_
-
-#include "base/macros.h"
-
-@class NSMenu;
-class Profile;
-
-// The Windows version of this class manages the Encoding Menu, but since Cocoa
-// does that for us automagically, the only thing left to do is construct
-// the encoding menu.
-class EncodingMenuControllerDelegate {
- public:
-  static void BuildEncodingMenu(Profile *profile, NSMenu* encoding_menu);
- private:
-  DISALLOW_IMPLICIT_CONSTRUCTORS(EncodingMenuControllerDelegate);
-};
-
-#endif  // CHROME_BROWSER_UI_COCOA_ENCODING_MENU_CONTROLLER_DELEGATE_MAC_H_
diff --git a/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm b/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm
deleted file mode 100644
index fe1fc9f3..0000000
--- a/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) 2009 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/ui/cocoa/encoding_menu_controller_delegate_mac.h"
-
-#import <Cocoa/Cocoa.h>
-
-#include "base/strings/string16.h"
-#include "base/strings/sys_string_conversions.h"
-#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
-
-namespace {
-
-void AddSeparatorToMenu(NSMenu *parent_menu) {
-  NSMenuItem* separator = [NSMenuItem separatorItem];
-  [parent_menu addItem:separator];
-}
-
-void AppendMenuItem(NSMenu *parent_menu, int tag, NSString *title) {
-
-  NSMenuItem* item = [[[NSMenuItem alloc] initWithTitle:title
-                                                 action:nil
-                                          keyEquivalent:@""] autorelease];
-  [parent_menu addItem:item];
-  [item setAction:@selector(commandDispatch:)];
-  [item setTag:tag];
-}
-
-}  // namespace
-
-// static
-void EncodingMenuControllerDelegate::BuildEncodingMenu(Profile *profile,
-                                                       NSMenu* encoding_menu) {
-  DCHECK(profile);
-
-  typedef EncodingMenuController::EncodingMenuItemList EncodingMenuItemList;
-  EncodingMenuItemList menuItems;
-  EncodingMenuController controller;
-  controller.GetEncodingMenuItems(profile, &menuItems);
-
-  for (EncodingMenuItemList::iterator it = menuItems.begin();
-       it != menuItems.end();
-       ++it) {
-    int item_id = it->first;
-    base::string16 &localized_title_string16 = it->second;
-
-    if (item_id == 0) {
-      AddSeparatorToMenu(encoding_menu);
-    } else {
-      NSString *localized_title =
-          base::SysUTF16ToNSString(localized_title_string16);
-      AppendMenuItem(encoding_menu, item_id, localized_title);
-    }
-  }
-
-}
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
index 7e7a2d9..0f2eb85 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -603,10 +603,6 @@
       prefs::kWebKitUsesUniversalDetector,
       l10n_util::GetStringUTF8(IDS_USES_UNIVERSAL_DETECTOR) == "true",
       user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
-  registry->RegisterStringPref(
-      prefs::kStaticEncodings,
-      l10n_util::GetStringUTF8(IDS_STATIC_ENCODING_LIST));
-  registry->RegisterStringPref(prefs::kRecentlySelectedEncoding, std::string());
 }
 
 // static
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc
index c32c00d..3d3f5df 100644
--- a/chrome/browser/ui/toolbar/app_menu_model.cc
+++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -37,7 +37,6 @@
 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h"
-#include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h"
 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
 #include "chrome/browser/upgrade_detector.h"
@@ -110,70 +109,6 @@
 }  // namespace
 
 ////////////////////////////////////////////////////////////////////////////////
-// EncodingMenuModel
-
-EncodingMenuModel::EncodingMenuModel(Browser* browser)
-    : ui::SimpleMenuModel(this),
-      browser_(browser) {
-  Build();
-}
-
-EncodingMenuModel::~EncodingMenuModel() {
-}
-
-void EncodingMenuModel::Build() {
-  EncodingMenuController::EncodingMenuItemList encoding_menu_items;
-  EncodingMenuController encoding_menu_controller;
-  encoding_menu_controller.GetEncodingMenuItems(browser_->profile(),
-                                                &encoding_menu_items);
-
-  int group_id = 0;
-  EncodingMenuController::EncodingMenuItemList::iterator it =
-      encoding_menu_items.begin();
-  for (; it != encoding_menu_items.end(); ++it) {
-    int id = it->first;
-    base::string16& label = it->second;
-    if (id == 0) {
-      AddSeparator(ui::NORMAL_SEPARATOR);
-    } else {
-      if (id == IDC_ENCODING_AUTO_DETECT) {
-        AddCheckItem(id, label);
-      } else {
-        // Use the id of the first radio command as the id of the group.
-        if (group_id <= 0)
-          group_id = id;
-        AddRadioItem(id, label, group_id);
-      }
-    }
-  }
-}
-
-bool EncodingMenuModel::IsCommandIdChecked(int command_id) const {
-  WebContents* current_tab =
-      browser_->tab_strip_model()->GetActiveWebContents();
-  if (!current_tab)
-    return false;
-  EncodingMenuController controller;
-  return controller.IsItemChecked(browser_->profile(),
-                                  current_tab->GetEncoding(), command_id);
-}
-
-bool EncodingMenuModel::IsCommandIdEnabled(int command_id) const {
-  bool enabled = chrome::IsCommandEnabled(browser_, command_id);
-  // Special handling for the contents of the Encoding submenu. On Mac OS,
-  // instead of enabling/disabling the top-level menu item, the submenu's
-  // contents get disabled, per Apple's HIG.
-#if defined(OS_MACOSX)
-  enabled &= chrome::IsCommandEnabled(browser_, IDC_ENCODING_MENU);
-#endif
-  return enabled;
-}
-
-void EncodingMenuModel::ExecuteCommand(int command_id, int event_flags) {
-  chrome::ExecuteCommand(browser_, command_id);
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // ZoomMenuModel
 
 ZoomMenuModel::ZoomMenuModel(ui::SimpleMenuModel::Delegate* delegate)
@@ -268,10 +203,6 @@
 #if defined(OS_CHROMEOS)
   AddItemWithStringId(IDC_TAKE_SCREENSHOT, IDS_TAKE_SCREENSHOT);
 #endif
-  encoding_menu_model_.reset(new EncodingMenuModel(browser));
-  AddSubMenuWithStringId(IDC_ENCODING_MENU, IDS_ENCODING_MENU,
-                         encoding_menu_model_.get());
-
   AddSeparator(ui::NORMAL_SEPARATOR);
   AddItemWithStringId(IDC_DEV_TOOLS, IDS_DEV_TOOLS);
 
diff --git a/chrome/browser/ui/toolbar/app_menu_model.h b/chrome/browser/ui/toolbar/app_menu_model.h
index b9cc671f..8900a000 100644
--- a/chrome/browser/ui/toolbar/app_menu_model.h
+++ b/chrome/browser/ui/toolbar/app_menu_model.h
@@ -75,26 +75,6 @@
   LIMIT_MENU_ACTION
 };
 
-// A menu model that builds the contents of an encoding menu.
-class EncodingMenuModel : public ui::SimpleMenuModel,
-                          public ui::SimpleMenuModel::Delegate {
- public:
-  explicit EncodingMenuModel(Browser* browser);
-  ~EncodingMenuModel() override;
-
-  // Overridden from ui::SimpleMenuModel::Delegate:
-  bool IsCommandIdChecked(int command_id) const override;
-  bool IsCommandIdEnabled(int command_id) const override;
-  void ExecuteCommand(int command_id, int event_flags) override;
-
- private:
-  void Build();
-
-  Browser* browser_;  // weak
-
-  DISALLOW_COPY_AND_ASSIGN(EncodingMenuModel);
-};
-
 // A menu model that builds the contents of the zoom menu.
 class ZoomMenuModel : public ui::SimpleMenuModel {
  public:
@@ -115,8 +95,6 @@
  private:
   void Build(Browser* browser);
 
-  std::unique_ptr<EncodingMenuModel> encoding_menu_model_;
-
   DISALLOW_COPY_AND_ASSIGN(ToolsMenuModel);
 };
 
diff --git a/chrome/browser/ui/toolbar/app_menu_model_unittest.cc b/chrome/browser/ui/toolbar/app_menu_model_unittest.cc
index c0d0e98..b01e4e3 100644
--- a/chrome/browser/ui/toolbar/app_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/app_menu_model_unittest.cc
@@ -203,13 +203,3 @@
   model.ActivatedAt(index2);
   EXPECT_EQ(1, error1->execute_count());
 }
-
-class EncodingMenuModelTest : public BrowserWithTestWindowTest,
-                              public MenuModelTest {
-};
-
-TEST_F(EncodingMenuModelTest, IsCommandIdCheckedWithNoTabs) {
-  EncodingMenuModel model(browser());
-  ASSERT_EQ(NULL, browser()->tab_strip_model()->GetActiveWebContents());
-  EXPECT_FALSE(model.IsCommandIdChecked(IDC_ENCODING_WINDOWS1252));
-}
diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller.cc b/chrome/browser/ui/toolbar/encoding_menu_controller.cc
deleted file mode 100644
index 08476d1..0000000
--- a/chrome/browser/ui/toolbar/encoding_menu_controller.cc
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2012 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/ui/toolbar/encoding_menu_controller.h"
-
-#include <stddef.h>
-
-#include "base/i18n/rtl.h"
-#include "base/macros.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/character_encoding.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/grit/generated_resources.h"
-#include "components/prefs/pref_service.h"
-#include "ui/base/l10n/l10n_util.h"
-
-const int EncodingMenuController::kValidEncodingIds[] = {
-    IDC_ENCODING_UTF8,
-    IDC_ENCODING_UTF16LE,
-    IDC_ENCODING_WINDOWS1252,
-    IDC_ENCODING_GBK,
-    IDC_ENCODING_GB18030,
-    IDC_ENCODING_BIG5,
-    IDC_ENCODING_KOREAN,
-    IDC_ENCODING_SHIFTJIS,
-    IDC_ENCODING_ISO2022JP,
-    IDC_ENCODING_EUCJP,
-    IDC_ENCODING_THAI,
-    IDC_ENCODING_ISO885915,
-    IDC_ENCODING_MACINTOSH,
-    IDC_ENCODING_ISO88592,
-    IDC_ENCODING_WINDOWS1250,
-    IDC_ENCODING_ISO88595,
-    IDC_ENCODING_WINDOWS1251,
-    IDC_ENCODING_KOI8R,
-    IDC_ENCODING_KOI8U,
-    IDC_ENCODING_ISO88597,
-    IDC_ENCODING_WINDOWS1253,
-    IDC_ENCODING_ISO88594,
-    IDC_ENCODING_ISO885913,
-    IDC_ENCODING_WINDOWS1257,
-    IDC_ENCODING_ISO88593,
-    IDC_ENCODING_ISO885910,
-    IDC_ENCODING_ISO885914,
-    IDC_ENCODING_ISO885916,
-    IDC_ENCODING_WINDOWS1254,
-    IDC_ENCODING_ISO88596,
-    IDC_ENCODING_WINDOWS1256,
-    IDC_ENCODING_ISO88598,
-    IDC_ENCODING_WINDOWS1255,
-    IDC_ENCODING_WINDOWS1258,
-    IDC_ENCODING_ISO88598I,
-    IDC_ENCODING_IBM866,
-};
-
-bool EncodingMenuController::DoesCommandBelongToEncodingMenu(int id) {
-  if (id == IDC_ENCODING_AUTO_DETECT) {
-    return true;
-  }
-
-  for (size_t i = 0; i < arraysize(kValidEncodingIds); ++i) {
-    if (id == kValidEncodingIds[i]) {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-const int* EncodingMenuController::ValidGUIEncodingIDs() {
-  return kValidEncodingIds;
-}
-
-int EncodingMenuController::NumValidGUIEncodingIDs() {
-  return arraysize(kValidEncodingIds);
-}
-
-bool EncodingMenuController::IsItemChecked(
-    Profile* browser_profile,
-    const std::string& current_tab_encoding,
-    int item_id) {
-  if (!DoesCommandBelongToEncodingMenu(item_id))
-    return false;
-
-  std::string encoding = current_tab_encoding;
-  if (encoding.empty())
-    encoding = browser_profile->GetPrefs()->GetString(prefs::kDefaultCharset);
-
-  if (item_id == IDC_ENCODING_AUTO_DETECT) {
-    return browser_profile->GetPrefs()->GetBoolean(
-        prefs::kWebKitUsesUniversalDetector);
-  }
-
-  if (!encoding.empty()) {
-    return encoding ==
-        CharacterEncoding::GetCanonicalEncodingNameByCommandId(item_id);
-  }
-
-  return false;
-}
-
-void EncodingMenuController::GetEncodingMenuItems(Profile* profile,
-    EncodingMenuItemList* menu_items) {
-
-  DCHECK(menu_items);
-  EncodingMenuItem separator(0, base::string16());
-
-  menu_items->clear();
-  menu_items->push_back(
-      EncodingMenuItem(IDC_ENCODING_AUTO_DETECT,
-                       l10n_util::GetStringUTF16(IDS_ENCODING_AUTO_DETECT)));
-  menu_items->push_back(separator);
-
-  // Create current display encoding list.
-  const std::vector<CharacterEncoding::EncodingInfo>* encodings;
-
-  // Build the list of encoding ids : It is made of the
-  // locale-dependent short list, the cache of recently selected
-  // encodings and other encodings.
-  encodings = CharacterEncoding::GetCurrentDisplayEncodings(
-      g_browser_process->GetApplicationLocale(),
-      profile->GetPrefs()->GetString(prefs::kStaticEncodings),
-      profile->GetPrefs()->GetString(prefs::kRecentlySelectedEncoding));
-  DCHECK(encodings);
-  DCHECK(!encodings->empty());
-
-  // Build up output list for menu.
-  std::vector<CharacterEncoding::EncodingInfo>::const_iterator it;
-  for (it = encodings->begin(); it != encodings->end(); ++it) {
-    if (it->encoding_id) {
-      base::string16 encoding = it->encoding_display_name;
-      base::i18n::AdjustStringForLocaleDirection(&encoding);
-      menu_items->push_back(EncodingMenuItem(it->encoding_id, encoding));
-    } else {
-      menu_items->push_back(separator);
-    }
-  }
-}
diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller.h b/chrome/browser/ui/toolbar/encoding_menu_controller.h
deleted file mode 100644
index 96d62fa..0000000
--- a/chrome/browser/ui/toolbar/encoding_menu_controller.h
+++ /dev/null
@@ -1,55 +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_UI_TOOLBAR_ENCODING_MENU_CONTROLLER_H_
-#define CHROME_BROWSER_UI_TOOLBAR_ENCODING_MENU_CONTROLLER_H_
-
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "base/gtest_prod_util.h"
-#include "base/macros.h"
-#include "base/strings/string16.h"
-
-class Profile;
-
-// Cross-platform logic needed for the encoding menu.
-// For now, we don't need to track state so all methods are static.
-class EncodingMenuController {
-  FRIEND_TEST_ALL_PREFIXES(EncodingMenuControllerTest, EncodingIDsBelongTest);
-  FRIEND_TEST_ALL_PREFIXES(EncodingMenuControllerTest, IsItemChecked);
-
- public:
-  typedef std::pair<int, base::string16> EncodingMenuItem;
-  typedef std::vector<EncodingMenuItem> EncodingMenuItemList;
-
- public:
-  EncodingMenuController() {}
-
-  // Given a command ID, does this command belong to the encoding menu?
-  bool DoesCommandBelongToEncodingMenu(int id);
-
-  // Returns true if the given encoding menu item (specified by item_id)
-  // is checked.  Note that this header is included from objc, where the name
-  // "id" is reserved.
-  bool IsItemChecked(Profile* browser_profile,
-                     const std::string& current_tab_encoding,
-                     int item_id);
-
-  // Fills in a list of menu items in the order they should appear in the menu.
-  // Items whose ids are 0 are separators.
-  void GetEncodingMenuItems(Profile* profile,
-                            EncodingMenuItemList* menu_items);
-
- private:
-  // List of all valid encoding GUI IDs.
-  static const int kValidEncodingIds[];
-  const int* ValidGUIEncodingIDs();
-  int NumValidGUIEncodingIDs();
-
-  DISALLOW_COPY_AND_ASSIGN(EncodingMenuController);
-};
-
-#endif  // CHROME_BROWSER_UI_TOOLBAR_ENCODING_MENU_CONTROLLER_H_
diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc b/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
deleted file mode 100644
index 5fb784a..0000000
--- a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2011 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/ui/toolbar/encoding_menu_controller.h"
-
-#include <stddef.h>
-
-#include <string>
-
-#include "base/macros.h"
-#include "base/message_loop/message_loop.h"
-#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/test/base/testing_profile.h"
-#include "components/prefs/pref_service.h"
-#include "content/public/test/test_browser_thread.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using content::BrowserThread;
-
-class EncodingMenuControllerTest : public testing::Test {
- public:
-  EncodingMenuControllerTest()
-      : ui_thread_(BrowserThread::UI, &message_loop_) {}
- private:
-  base::MessageLoop message_loop_;
-  content::TestBrowserThread ui_thread_;
-};
-
-TEST_F(EncodingMenuControllerTest, EncodingIDsBelongTest) {
-  EncodingMenuController controller;
-
-  // Check some bogus ids to make sure they're never valid.
-  ASSERT_FALSE(controller.DoesCommandBelongToEncodingMenu(0));
-  ASSERT_FALSE(controller.DoesCommandBelongToEncodingMenu(-1));
-
-  int num_valid_encoding_ids = controller.NumValidGUIEncodingIDs();
-  const int* valid_encodings = controller.ValidGUIEncodingIDs();
-  ASSERT_TRUE(controller.DoesCommandBelongToEncodingMenu(
-      IDC_ENCODING_AUTO_DETECT));
-  // Check that all valid encodings are accepted.
-  for (int i = 0; i < num_valid_encoding_ids; ++i) {
-    ASSERT_TRUE(controller.DoesCommandBelongToEncodingMenu(valid_encodings[i]));
-  }
-
-  // This test asserts that we haven't added a new valid ID without including it
-  // in the kValidEncodingIds test list above.
-  // The premise is that new encodings will be added directly after the current
-  // ones so we'll catch such cases.
-  int one_past_largest_id = valid_encodings[num_valid_encoding_ids - 1] + 1;
-  ASSERT_FALSE(controller.DoesCommandBelongToEncodingMenu(one_past_largest_id));
-}
-
-TEST_F(EncodingMenuControllerTest, ListEncodingMenuItems) {
-  typedef EncodingMenuController::EncodingMenuItemList EncodingMenuItemList;
-  EncodingMenuController controller;
-
-  EncodingMenuItemList english_items;
-  TestingProfile profile_en;
-
-  controller.GetEncodingMenuItems(&profile_en, &english_items);
-
-  // Make sure there are items in the lists.
-  ASSERT_FALSE(english_items.empty());
-  // Make sure that autodetect is the first item on both menus
-  ASSERT_EQ(english_items[0].first, IDC_ENCODING_AUTO_DETECT);
-}
-
-TEST_F(EncodingMenuControllerTest, IsItemChecked) {
-  TestingProfile profile_en;
-  std::string encoding("UTF-8");
-
-  // Check that enabling and disabling autodetect works.
-  bool autodetect_enabed[] = {true, false};
-  PrefService* prefs = profile_en.GetPrefs();
-  EncodingMenuController controller;
-  for (size_t i = 0; i < arraysize(autodetect_enabed); ++i) {
-    bool enabled = autodetect_enabed[i];
-    prefs->SetBoolean(prefs::kWebKitUsesUniversalDetector, enabled);
-    ASSERT_TRUE(controller.IsItemChecked(&profile_en,
-                                         encoding,
-                                         IDC_ENCODING_AUTO_DETECT) == enabled);
-  }
-
-  // Check all valid encodings, make sure only one is enabled when autodetection
-  // is turned off.
-  prefs->SetBoolean(prefs::kWebKitUsesUniversalDetector, false);
-  bool encoding_is_enabled = false;
-  size_t num_valid_encoding_ids = controller.NumValidGUIEncodingIDs();
-  const int* valid_encodings = controller.ValidGUIEncodingIDs();
-  for (size_t i = 0; i < num_valid_encoding_ids; ++i) {
-    bool on = controller.IsItemChecked(&profile_en,
-                                       encoding,
-                                       valid_encodings[i]);
-    // Only one item in the encoding menu can be selected at a time.
-    ASSERT_FALSE(on && encoding_is_enabled);
-    encoding_is_enabled |= on;
-  }
-
-  // Make sure at least one encoding is enabled.
-  ASSERT_TRUE(encoding_is_enabled);
-}
diff --git a/chrome/browser/ui/views/frame/system_menu_model_builder.cc b/chrome/browser/ui/views/frame/system_menu_model_builder.cc
index 238b40d..b2947db 100644
--- a/chrome/browser/ui/views/frame/system_menu_model_builder.cc
+++ b/chrome/browser/ui/views/frame/system_menu_model_builder.cc
@@ -115,10 +115,6 @@
   zoom_menu_contents_.reset(new ZoomMenuModel(&menu_delegate_));
   model->AddSubMenuWithStringId(IDC_ZOOM_MENU, IDS_ZOOM_MENU,
                                 zoom_menu_contents_.get());
-  encoding_menu_contents_.reset(new EncodingMenuModel(browser()));
-  model->AddSubMenuWithStringId(IDC_ENCODING_MENU,
-                                IDS_ENCODING_MENU,
-                                encoding_menu_contents_.get());
   if (browser()->is_app() && chrome::CanOpenTaskManager()) {
     model->AddSeparator(ui::NORMAL_SEPARATOR);
     model->AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
diff --git a/chrome/browser/ui/views/frame/system_menu_model_builder.h b/chrome/browser/ui/views/frame/system_menu_model_builder.h
index 29a5aef31..51ed98f 100644
--- a/chrome/browser/ui/views/frame/system_menu_model_builder.h
+++ b/chrome/browser/ui/views/frame/system_menu_model_builder.h
@@ -11,7 +11,6 @@
 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h"
 
 class Browser;
-class EncodingMenuModel;
 class ZoomMenuModel;
 
 namespace ui {
@@ -50,7 +49,6 @@
   SystemMenuModelDelegate menu_delegate_;
   std::unique_ptr<ui::MenuModel> menu_model_;
   std::unique_ptr<ZoomMenuModel> zoom_menu_contents_;
-  std::unique_ptr<EncodingMenuModel> encoding_menu_contents_;
 
   DISALLOW_COPY_AND_ASSIGN(SystemMenuModelBuilder);
 };
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc
index 0352145..c044ea3 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc
@@ -19,7 +19,6 @@
 #include "base/values.h"
 #include "build/build_config.h"
 #include "chrome/browser/browser_process.h"
-#include "chrome/browser/character_encoding.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/extension_tab_util.h"
 #include "chrome/browser/profiles/profile.h"
@@ -90,8 +89,8 @@
       IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_FIXED_WIDTH_LABEL },
     { "fontSettingsMinimumSize",
       IDS_FONT_LANGUAGE_SETTING_MINIMUM_FONT_SIZE_TITLE },
-    { "fontSettingsEncoding",
-      IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_ENCODING_TITLE },
+    { "fontSettings",
+      IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_TITLE },
     { "fontSettingsSizeTiny",
       IDS_FONT_LANGUAGE_SETTING_FONT_SIZE_TINY },
     { "fontSettingsSizeHuge",
@@ -138,8 +137,6 @@
   FontSettingsUtilities::ValidateSavedFonts(pref_service);
 
   // Register for preferences that we need to observe manually.
-  font_encoding_.Init(prefs::kDefaultCharset, pref_service);
-
   standard_font_.Init(prefs::kWebKitStandardFontFamily,
                       pref_service,
                       base::Bind(&FontSettingsHandler::SetUpStandardFontSample,
@@ -212,36 +209,6 @@
     font->AppendString(has_rtl_chars ? "rtl" : "ltr");
   }
 
-  base::ListValue encoding_list;
-  const std::vector<CharacterEncoding::EncodingInfo>* encodings;
-  PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
-  encodings = CharacterEncoding::GetCurrentDisplayEncodings(
-      g_browser_process->GetApplicationLocale(),
-      pref_service->GetString(prefs::kStaticEncodings),
-      pref_service->GetString(prefs::kRecentlySelectedEncoding));
-  DCHECK(encodings);
-  DCHECK(!encodings->empty());
-
-  std::vector<CharacterEncoding::EncodingInfo>::const_iterator it;
-  for (it = encodings->begin(); it != encodings->end(); ++it) {
-    std::unique_ptr<base::ListValue> option(new base::ListValue());
-    if (it->encoding_id) {
-      int cmd_id = it->encoding_id;
-      std::string encoding =
-      CharacterEncoding::GetCanonicalEncodingNameByCommandId(cmd_id);
-      base::string16 name = it->encoding_display_name;
-      bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(name);
-      option->AppendString(encoding);
-      option->AppendString(name);
-      option->AppendString(has_rtl_chars ? "rtl" : "ltr");
-    } else {
-      // Add empty name/value to indicate a separator item.
-      option->AppendString(std::string());
-      option->AppendString(std::string());
-    }
-    encoding_list.Append(std::move(option));
-  }
-
   base::ListValue selected_values;
   selected_values.AppendString(
       MaybeGetLocalizedFontName(standard_font_.GetValue()));
@@ -251,10 +218,9 @@
       MaybeGetLocalizedFontName(sans_serif_font_.GetValue()));
   selected_values.AppendString(
       MaybeGetLocalizedFontName(fixed_font_.GetValue()));
-  selected_values.AppendString(font_encoding_.GetValue());
 
   web_ui()->CallJavascriptFunctionUnsafe(
-      "FontSettings.setFontsData", *list.get(), encoding_list, selected_values);
+      "FontSettings.setFontsData", *list.get(), selected_values);
 }
 
 void FontSettingsHandler::SetUpStandardFontSample() {
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.h b/chrome/browser/ui/webui/options/font_settings_handler.h
index 9ae924e..57519f6 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.h
+++ b/chrome/browser/ui/webui/options/font_settings_handler.h
@@ -74,7 +74,6 @@
   StringPrefMember serif_font_;
   StringPrefMember sans_serif_font_;
   StringPrefMember fixed_font_;
-  StringPrefMember font_encoding_;
   IntegerPrefMember default_font_size_;
   IntegerPrefMember default_fixed_font_size_;
   IntegerPrefMember minimum_font_size_;
diff --git a/chrome/browser/ui/webui/settings/font_handler.cc b/chrome/browser/ui/webui/settings/font_handler.cc
index 280b3c6c..03bd7c3 100644
--- a/chrome/browser/ui/webui/settings/font_handler.cc
+++ b/chrome/browser/ui/webui/settings/font_handler.cc
@@ -137,37 +137,8 @@
     font->AppendString(has_rtl_chars ? "rtl" : "ltr");
   }
 
-  // Character encoding list.
-  const std::vector<CharacterEncoding::EncodingInfo>* encodings;
-  PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
-  encodings = CharacterEncoding::GetCurrentDisplayEncodings(
-      g_browser_process->GetApplicationLocale(),
-      pref_service->GetString(prefs::kStaticEncodings),
-      pref_service->GetString(prefs::kRecentlySelectedEncoding));
-  DCHECK(!encodings->empty());
-
-  std::unique_ptr<base::ListValue> encoding_list(new base::ListValue());
-  for (const auto& it : *encodings) {
-    std::unique_ptr<base::ListValue> option(new base::ListValue());
-    if (it.encoding_id) {
-      option->AppendString(
-          CharacterEncoding::GetCanonicalEncodingNameByCommandId(
-            it.encoding_id));
-      option->AppendString(it.encoding_display_name);
-      option->AppendString(
-          base::i18n::StringContainsStrongRTLChars(it.encoding_display_name)
-          ? "rtl"
-          : "ltr");
-    } else {
-      // Add empty value to indicate a separator item.
-      option->AppendString(std::string());
-    }
-    encoding_list->Append(std::move(option));
-  }
-
   base::DictionaryValue response;
   response.Set("fontList", std::move(list));
-  response.Set("encodingList", std::move(encoding_list));
 
   GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix());
   response.SetString(
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index 8aeb95b..814e5c48 100644
--- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -261,7 +261,7 @@
     {"changeHomePage", IDS_SETTINGS_CHANGE_HOME_PAGE},
     {"themesGalleryUrl", IDS_THEMES_GALLERY_URL},
     {"chooseFromWebStore", IDS_SETTINGS_WEB_STORE},
-    {"chooseFontsAndEncoding", IDS_SETTINGS_CHOOSE_FONTS_AND_ENCODING},
+    {"chooseFonts", IDS_SETTINGS_CHOOSE_FONTS},
 #if defined(OS_CHROMEOS)
     {"openWallpaperApp", IDS_SETTINGS_OPEN_WALLPAPER_APP},
     {"setWallpaper", IDS_SETTINGS_SET_WALLPAPER},
@@ -1355,13 +1355,12 @@
       {"veryLarge", IDS_SETTINGS_VERY_LARGE_FONT},
       {"custom", IDS_SETTINGS_CUSTOM},
       {"customizeFonts", IDS_SETTINGS_CUSTOMIZE_FONTS},
-      {"fontsAndEncoding", IDS_SETTINGS_FONTS_AND_ENCODING},
+      {"fonts", IDS_SETTINGS_FONTS},
       {"standardFont", IDS_SETTINGS_STANDARD_FONT_LABEL},
       {"serifFont", IDS_SETTINGS_SERIF_FONT_LABEL},
       {"sansSerifFont", IDS_SETTINGS_SANS_SERIF_FONT_LABEL},
       {"fixedWidthFont", IDS_SETTINGS_FIXED_WIDTH_FONT_LABEL},
       {"minimumFont", IDS_SETTINGS_MINIMUM_FONT_SIZE_LABEL},
-      {"encoding", IDS_SETTINGS_ENCODING_LABEL},
       {"tiny", IDS_SETTINGS_TINY_FONT_SIZE},
       {"huge", IDS_SETTINGS_HUGE_FONT_SIZE},
       {"loremIpsum", IDS_SETTINGS_LOREM_IPSUM},
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index dcacf370..5f24cdf 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -1489,8 +1489,6 @@
       'browser/ui/cocoa/download/download_item_drag_mac.mm',
       'browser/ui/cocoa/download/download_util_mac.h',
       'browser/ui/cocoa/download/download_util_mac.mm',
-      'browser/ui/cocoa/encoding_menu_controller_delegate_mac.h',
-      'browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm',
       'browser/ui/cocoa/first_run_dialog.h',
       'browser/ui/cocoa/first_run_dialog.mm',
       'browser/ui/cocoa/handoff_active_url_observer.cc',
@@ -1808,8 +1806,6 @@
       'browser/ui/toolbar/bookmark_sub_menu_model.h',
       'browser/ui/toolbar/component_toolbar_actions_factory.cc',
       'browser/ui/toolbar/component_toolbar_actions_factory.h',
-      'browser/ui/toolbar/encoding_menu_controller.cc',
-      'browser/ui/toolbar/encoding_menu_controller.h',
       'browser/ui/toolbar/recent_tabs_sub_menu_model.cc',
       'browser/ui/toolbar/recent_tabs_sub_menu_model.h',
       'browser/ui/toolbar/toolbar_action_view_controller.h',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index f1e927e..d77c80cbd 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -67,6 +67,7 @@
       'browser/browsing_data/site_data_size_collector_unittest.cc',
       'browser/budget_service/budget_manager_unittest.cc',
       'browser/budget_service/budget_database_unittest.cc',
+      'browser/character_encoding_unittest.cc',
       'browser/chrome_browser_application_mac_unittest.mm',
       'browser/chrome_content_browser_client_unittest.cc',
       'browser/chrome_process_singleton_win_unittest.cc',
@@ -1554,7 +1555,6 @@
       'browser/ui/toolbar/app_menu_icon_painter_unittest.cc',
       'browser/ui/toolbar/app_menu_model_unittest.cc',
       'browser/ui/toolbar/back_forward_menu_model_unittest.cc',
-      'browser/ui/toolbar/encoding_menu_controller_unittest.cc',
       'browser/ui/toolbar/mock_component_toolbar_actions_factory.cc',
       'browser/ui/toolbar/mock_component_toolbar_actions_factory.h',
       'browser/ui/toolbar/recent_tabs_builder_test_helper.cc',
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 3ab26ea..022ff0e 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -219,6 +219,7 @@
 // The value to use for showing locale-dependent encoding list for different
 // locale, it's initialized from the corresponding string resource that is
 // stored in non-translatable part of the resource bundle.
+// Deprecated 8/2016.
 const char kStaticEncodings[] = "intl.static_encodings";
 
 // If these change, the corresponding enums in the extension API
@@ -917,6 +918,7 @@
 
 // A string value which saves short list of recently user selected encodings
 // separated with comma punctuation mark.
+// Deprecated 8/2016.
 const char kRecentlySelectedEncoding[] = "profile.recently_selected_encodings";
 
 // Clear Browsing Data dialog preferences.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 05801d4..abbd9e7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2918,16 +2918,6 @@
   return notify_disconnection_;
 }
 
-void WebContentsImpl::SetOverrideEncoding(const std::string& encoding) {
-  SetEncoding(encoding);
-  Send(new ViewMsg_SetPageEncoding(GetRoutingID(), encoding));
-}
-
-void WebContentsImpl::ResetOverrideEncoding() {
-  canonical_encoding_.clear();
-  Send(new ViewMsg_ResetPageEncodingToDefault(GetRoutingID()));
-}
-
 RendererPreferences* WebContentsImpl::GetMutableRendererPrefs() {
   return &renderer_preferences_;
 }
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 3d4a4378..9a1fbe01 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -359,8 +359,6 @@
                      const base::Callback<void(int64_t)>& callback) override;
   const std::string& GetContentsMimeType() const override;
   bool WillNotifyDisconnection() const override;
-  void SetOverrideEncoding(const std::string& encoding) override;
-  void ResetOverrideEncoding() override;
   RendererPreferences* GetMutableRendererPrefs() override;
   void Close() override;
   void SystemDragEnded() override;
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index af8e0e8..bfe901b 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -626,13 +626,6 @@
                     GURL /* url */,
                     double /* zoom_level */)
 
-// Change encoding of page in the renderer.
-IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding,
-                    std::string /*new encoding name*/)
-
-// Reset encoding of page in the renderer back to default.
-IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault)
-
 // Used to tell a render view whether it should expose various bindings
 // that allow JS content extended privileges.  See BindingsPolicy for valid
 // flag values.
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index efa8ae59..ad3c35a 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -572,17 +572,6 @@
   // Returns true if this WebContents will notify about disconnection.
   virtual bool WillNotifyDisconnection() const = 0;
 
-  // Override the encoding and reload the page by sending down
-  // ViewMsg_SetPageEncoding to the renderer. |UpdateEncoding| is kinda
-  // the opposite of this, by which 'browser' is notified of
-  // the encoding of the current tab from 'renderer' (determined by
-  // auto-detect, http header, meta, bom detection, etc).
-  virtual void SetOverrideEncoding(const std::string& encoding) = 0;
-
-  // Remove any user-defined override encoding and reload by sending down
-  // ViewMsg_ResetPageEncodingToDefault to the renderer.
-  virtual void ResetOverrideEncoding() = 0;
-
   // Returns the settings which get passed to the renderer.
   virtual content::RendererPreferences* GetMutableRendererPrefs() = 0;
 
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index fbc0c54..a9a8099 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1308,9 +1308,6 @@
     IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom)
     IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForLoadingURL,
                         OnSetZoomLevelForLoadingURL)
-    IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding)
-    IPC_MESSAGE_HANDLER(ViewMsg_ResetPageEncodingToDefault,
-                        OnResetPageEncodingToDefault)
     IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter)
     IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver)
     IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave)
@@ -2293,15 +2290,6 @@
   SetZoomLevel(zoom_level);
 }
 
-void RenderViewImpl::OnSetPageEncoding(const std::string& encoding_name) {
-  webview()->setPageEncoding(WebString::fromUTF8(encoding_name));
-}
-
-void RenderViewImpl::OnResetPageEncodingToDefault() {
-  WebString no_encoding;
-  webview()->setPageEncoding(no_encoding);
-}
-
 void RenderViewImpl::OnAllowBindings(int enabled_bindings_flags) {
   if ((enabled_bindings_flags & BINDINGS_POLICY_WEB_UI) &&
       !(enabled_bindings_ & BINDINGS_POLICY_WEB_UI)) {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 012a6f9..ff24903 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -614,13 +614,11 @@
                         const blink::WebPluginAction& action);
   void OnMoveOrResizeStarted();
   void OnReleaseDisambiguationPopupBitmap(const cc::SharedBitmapId& id);
-  void OnResetPageEncodingToDefault();
   void OnSetActive(bool active);
   void OnSetBackgroundOpaque(bool opaque);
   void OnExitFullscreen();
   void OnSetHistoryOffsetAndLength(int history_offset, int history_length);
   void OnSetInitialFocus(bool reverse);
-  void OnSetPageEncoding(const std::string& encoding_name);
   void OnSetRendererPrefs(const RendererPreferences& renderer_prefs);
   void OnSetWebUIProperty(const std::string& name, const std::string& value);
   void OnSetZoomLevelForLoadingURL(const GURL& url, double zoom_level);
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml
index 7a1a74d..7818331 100644
--- a/tools/metrics/actions/actions.xml
+++ b/tools/metrics/actions/actions.xml
@@ -12310,6 +12310,7 @@
 <action name="OverrideEncoding">
   <owner>Please list the metric's owners. Add more owner tags as needed.</owner>
   <description>Please enter the description of this user action.</description>
+  <obsolete>Obsolete as of 08/2016</obsolete>
 </action>
 
 <action name="PDF.FitToHeightButton">