Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1606)

Side by Side Diff: chrome/browser/ui/toolbar/encoding_menu_controller.cc

Issue 1024713002: Drop Big5-HKSCS and add IBM866 in the encoding menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix EncodingMenuControllerTest.EncodingIDsBelongTest Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/browser_command_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" 5 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/character_encoding.h" 12 #include "chrome/browser/character_encoding.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
16 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
17 17
18 const int EncodingMenuController::kValidEncodingIds[] = { 18 const int EncodingMenuController::kValidEncodingIds[] = {
19 IDC_ENCODING_UTF8, 19 IDC_ENCODING_UTF8,
20 IDC_ENCODING_UTF16LE, 20 IDC_ENCODING_UTF16LE,
21 IDC_ENCODING_WINDOWS1252, 21 IDC_ENCODING_WINDOWS1252,
22 IDC_ENCODING_GBK, 22 IDC_ENCODING_GBK,
23 IDC_ENCODING_GB18030, 23 IDC_ENCODING_GB18030,
24 IDC_ENCODING_BIG5, 24 IDC_ENCODING_BIG5,
25 IDC_ENCODING_BIG5HKSCS,
26 IDC_ENCODING_KOREAN, 25 IDC_ENCODING_KOREAN,
27 IDC_ENCODING_SHIFTJIS, 26 IDC_ENCODING_SHIFTJIS,
28 IDC_ENCODING_ISO2022JP, 27 IDC_ENCODING_ISO2022JP,
29 IDC_ENCODING_EUCJP, 28 IDC_ENCODING_EUCJP,
30 IDC_ENCODING_THAI, 29 IDC_ENCODING_THAI,
31 IDC_ENCODING_ISO885915, 30 IDC_ENCODING_ISO885915,
32 IDC_ENCODING_MACINTOSH, 31 IDC_ENCODING_MACINTOSH,
33 IDC_ENCODING_ISO88592, 32 IDC_ENCODING_ISO88592,
34 IDC_ENCODING_WINDOWS1250, 33 IDC_ENCODING_WINDOWS1250,
35 IDC_ENCODING_ISO88595, 34 IDC_ENCODING_ISO88595,
36 IDC_ENCODING_WINDOWS1251, 35 IDC_ENCODING_WINDOWS1251,
37 IDC_ENCODING_KOI8R, 36 IDC_ENCODING_KOI8R,
38 IDC_ENCODING_KOI8U, 37 IDC_ENCODING_KOI8U,
39 IDC_ENCODING_ISO88597, 38 IDC_ENCODING_ISO88597,
40 IDC_ENCODING_WINDOWS1253, 39 IDC_ENCODING_WINDOWS1253,
41 IDC_ENCODING_ISO88594, 40 IDC_ENCODING_ISO88594,
42 IDC_ENCODING_ISO885913, 41 IDC_ENCODING_ISO885913,
43 IDC_ENCODING_WINDOWS1257, 42 IDC_ENCODING_WINDOWS1257,
44 IDC_ENCODING_ISO88593, 43 IDC_ENCODING_ISO88593,
45 IDC_ENCODING_ISO885910, 44 IDC_ENCODING_ISO885910,
46 IDC_ENCODING_ISO885914, 45 IDC_ENCODING_ISO885914,
47 IDC_ENCODING_ISO885916, 46 IDC_ENCODING_ISO885916,
48 IDC_ENCODING_WINDOWS1254, 47 IDC_ENCODING_WINDOWS1254,
49 IDC_ENCODING_ISO88596, 48 IDC_ENCODING_ISO88596,
50 IDC_ENCODING_WINDOWS1256, 49 IDC_ENCODING_WINDOWS1256,
51 IDC_ENCODING_ISO88598, 50 IDC_ENCODING_ISO88598,
52 IDC_ENCODING_WINDOWS1255, 51 IDC_ENCODING_WINDOWS1255,
53 IDC_ENCODING_WINDOWS1258, 52 IDC_ENCODING_WINDOWS1258,
54 IDC_ENCODING_ISO88598I, 53 IDC_ENCODING_ISO88598I,
54 IDC_ENCODING_IBM866,
55 }; 55 };
56 56
57 bool EncodingMenuController::DoesCommandBelongToEncodingMenu(int id) { 57 bool EncodingMenuController::DoesCommandBelongToEncodingMenu(int id) {
58 if (id == IDC_ENCODING_AUTO_DETECT) { 58 if (id == IDC_ENCODING_AUTO_DETECT) {
59 return true; 59 return true;
60 } 60 }
61 61
62 for (size_t i = 0; i < arraysize(kValidEncodingIds); ++i) { 62 for (size_t i = 0; i < arraysize(kValidEncodingIds); ++i) {
63 if (id == kValidEncodingIds[i]) { 63 if (id == kValidEncodingIds[i]) {
64 return true; 64 return true;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 for (it = encodings->begin(); it != encodings->end(); ++it) { 130 for (it = encodings->begin(); it != encodings->end(); ++it) {
131 if (it->encoding_id) { 131 if (it->encoding_id) {
132 base::string16 encoding = it->encoding_display_name; 132 base::string16 encoding = it->encoding_display_name;
133 base::i18n::AdjustStringForLocaleDirection(&encoding); 133 base::i18n::AdjustStringForLocaleDirection(&encoding);
134 menu_items->push_back(EncodingMenuItem(it->encoding_id, encoding)); 134 menu_items->push_back(EncodingMenuItem(it->encoding_id, encoding));
135 } else { 135 } else {
136 menu_items->push_back(separator); 136 menu_items->push_back(separator);
137 } 137 }
138 } 138 }
139 } 139 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_command_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698