| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/encoding_menu_controller.h" | 5 #include "chrome/browser/encoding_menu_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/i18n/rtl.h" |
| 8 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| 10 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/character_encoding.h" | 12 #include "chrome/browser/character_encoding.h" |
| 12 #include "chrome/browser/pref_service.h" | 13 #include "chrome/browser/pref_service.h" |
| 13 #include "chrome/browser/profile.h" | 14 #include "chrome/browser/profile.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
| 16 | 17 |
| 17 const int EncodingMenuController::kValidEncodingIds[] = { | 18 const int EncodingMenuController::kValidEncodingIds[] = { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 prefs::kRecentlySelectedEncoding))); | 129 prefs::kRecentlySelectedEncoding))); |
| 129 DCHECK(encodings); | 130 DCHECK(encodings); |
| 130 DCHECK(!encodings->empty()); | 131 DCHECK(!encodings->empty()); |
| 131 | 132 |
| 132 // Build up output list for menu. | 133 // Build up output list for menu. |
| 133 std::vector<CharacterEncoding::EncodingInfo>::const_iterator it; | 134 std::vector<CharacterEncoding::EncodingInfo>::const_iterator it; |
| 134 for (it = encodings->begin(); it != encodings->end(); ++it) { | 135 for (it = encodings->begin(); it != encodings->end(); ++it) { |
| 135 if (it->encoding_id) { | 136 if (it->encoding_id) { |
| 136 std::wstring encoding = it->encoding_display_name; | 137 std::wstring encoding = it->encoding_display_name; |
| 137 std::wstring bidi_safe_encoding; | 138 std::wstring bidi_safe_encoding; |
| 138 if (l10n_util::AdjustStringForLocaleDirection(encoding, | 139 if (base::i18n::AdjustStringForLocaleDirection(encoding, |
| 139 &bidi_safe_encoding)) | 140 &bidi_safe_encoding)) |
| 140 encoding.swap(bidi_safe_encoding); | 141 encoding.swap(bidi_safe_encoding); |
| 141 menuItems->push_back(EncodingMenuItem(it->encoding_id, | 142 menuItems->push_back(EncodingMenuItem(it->encoding_id, |
| 142 WideToUTF16(encoding))); | 143 WideToUTF16(encoding))); |
| 143 } else { | 144 } else { |
| 144 menuItems->push_back(separator); | 145 menuItems->push_back(separator); |
| 145 } | 146 } |
| 146 } | 147 } |
| 147 } | 148 } |
| OLD | NEW |