| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_CHARACTER_ENCODING_H__ | 5 #ifndef CHROME_BROWSER_CHARACTER_ENCODING_H__ |
| 6 #define CHROME_BROWSER_CHARACTER_ENCODING_H__ | 6 #define CHROME_BROWSER_CHARACTER_ENCODING_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // from zero to GetSupportCanonicalEncodingCount() - 1. THIS FUNCTION | 51 // from zero to GetSupportCanonicalEncodingCount() - 1. THIS FUNCTION |
| 52 // IS NOT THREADSAFE. You must run this function only in UI thread. | 52 // IS NOT THREADSAFE. You must run this function only in UI thread. |
| 53 static std::wstring GetCanonicalEncodingNameByIndex(int index); | 53 static std::wstring GetCanonicalEncodingNameByIndex(int index); |
| 54 | 54 |
| 55 // Return display name of canonical encoding according to the index, | 55 // Return display name of canonical encoding according to the index, |
| 56 // which starts from zero to GetSupportCanonicalEncodingCount() - 1. | 56 // which starts from zero to GetSupportCanonicalEncodingCount() - 1. |
| 57 // THIS FUNCTION IS NOT THREADSAFE. You must run this function | 57 // THIS FUNCTION IS NOT THREADSAFE. You must run this function |
| 58 // only in UI thread. | 58 // only in UI thread. |
| 59 static std::wstring GetCanonicalEncodingDisplayNameByIndex(int index); | 59 static std::wstring GetCanonicalEncodingDisplayNameByIndex(int index); |
| 60 | 60 |
| 61 // Return encoding command id according to the index, which starts from |
| 62 // zero to GetSupportCanonicalEncodingCount() - 1. Otherwise returns 0. |
| 63 static int GetEncodingCommandIdByIndex(int index); |
| 64 |
| 61 // Return canonical encoding name according to the encoding alias name. THIS | 65 // Return canonical encoding name according to the encoding alias name. THIS |
| 62 // FUNCTION IS NOT THREADSAFE. You must run this function only in UI thread. | 66 // FUNCTION IS NOT THREADSAFE. You must run this function only in UI thread. |
| 63 static std::wstring GetCanonicalEncodingNameByAliasName( | 67 static std::wstring GetCanonicalEncodingNameByAliasName( |
| 64 const std::wstring& alias_name); | 68 const std::wstring& alias_name); |
| 65 | 69 |
| 66 // Returns the pointer of a vector of EncodingInfos corresponding to | 70 // Returns the pointer of a vector of EncodingInfos corresponding to |
| 67 // encodings to display in the encoding menu. The locale-dependent static | 71 // encodings to display in the encoding menu. The locale-dependent static |
| 68 // encodings come at the top of the list and recently selected encodings | 72 // encodings come at the top of the list and recently selected encodings |
| 69 // come next. Finally, the rest of encodings are listed. | 73 // come next. Finally, the rest of encodings are listed. |
| 70 // The vector will be created and destroyed by CharacterEncoding. | 74 // The vector will be created and destroyed by CharacterEncoding. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 94 static int GetCommandIdByCanonicalEncodingName( | 98 static int GetCommandIdByCanonicalEncodingName( |
| 95 const std::wstring& encoding_name); | 99 const std::wstring& encoding_name); |
| 96 | 100 |
| 97 private: | 101 private: |
| 98 // Disallow instantiating it since this class only contains static methods. | 102 // Disallow instantiating it since this class only contains static methods. |
| 99 DISALLOW_IMPLICIT_CONSTRUCTORS(CharacterEncoding); | 103 DISALLOW_IMPLICIT_CONSTRUCTORS(CharacterEncoding); |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 #endif // CHROME_BROWSER_CHARACTER_ENCODING_H__ | 106 #endif // CHROME_BROWSER_CHARACTER_ENCODING_H__ |
| 103 | 107 |
| OLD | NEW |