OLD | NEW |
---|---|
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/character_encoding.h" | 5 #include "chrome/browser/character_encoding.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 { "windows-1258", "Windows-1258" }, | 100 { "windows-1258", "Windows-1258" }, |
101 }; | 101 }; |
102 | 102 |
103 const int kCanonicalDisplayNameOverridesLength = | 103 const int kCanonicalDisplayNameOverridesLength = |
104 arraysize(kCanonicalDisplayNameOverrides); | 104 arraysize(kCanonicalDisplayNameOverrides); |
105 | 105 |
106 typedef std::map<std::string, const char*> CanonicalNameDisplayNameMapType; | 106 typedef std::map<std::string, const char*> CanonicalNameDisplayNameMapType; |
107 | 107 |
108 class CanonicalEncodingMap { | 108 class CanonicalEncodingMap { |
109 public: | 109 public: |
110 CanonicalEncodingMap() | 110 CanonicalEncodingMap() {} |
Nico
2013/06/12 04:42:27
Maybe delete this completely?
dcheng
2013/06/12 12:01:27
We can't, due to the DISALLOW_COPY_AND_ASSIGN macr
| |
111 : id_to_encoding_name_map_(NULL), | |
112 encoding_name_to_id_map_(NULL), | |
113 encoding_name_to_display_name_map_(NULL) { } | |
114 const IdToCanonicalEncodingNameMapType* GetIdToCanonicalEncodingNameMapData(); | 111 const IdToCanonicalEncodingNameMapType* GetIdToCanonicalEncodingNameMapData(); |
115 const CanonicalEncodingNameToIdMapType* GetCanonicalEncodingNameToIdMapData(); | 112 const CanonicalEncodingNameToIdMapType* GetCanonicalEncodingNameToIdMapData(); |
116 const CanonicalNameDisplayNameMapType* GetCanonicalNameDisplayNameMapData(); | 113 const CanonicalNameDisplayNameMapType* GetCanonicalNameDisplayNameMapData(); |
117 std::vector<int>* locale_dependent_encoding_ids() { | 114 std::vector<int>* locale_dependent_encoding_ids() { |
118 return &locale_dependent_encoding_ids_; | 115 return &locale_dependent_encoding_ids_; |
119 } | 116 } |
120 | 117 |
121 std::vector<CharacterEncoding::EncodingInfo>* current_display_encodings() { | 118 std::vector<CharacterEncoding::EncodingInfo>* current_display_encodings() { |
122 return ¤t_display_encodings_; | 119 return ¤t_display_encodings_; |
123 } | 120 } |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
537 // Insert new encoding to head of selected encoding list. | 534 // Insert new encoding to head of selected encoding list. |
538 *selected_encodings = encoding_name; | 535 *selected_encodings = encoding_name; |
539 // Generate the string for rest selected encoding list. | 536 // Generate the string for rest selected encoding list. |
540 for (std::vector<int>::const_iterator it = selected_encoding_list.begin(); | 537 for (std::vector<int>::const_iterator it = selected_encoding_list.begin(); |
541 it != selected_encoding_list.end(); ++it) { | 538 it != selected_encoding_list.end(); ++it) { |
542 selected_encodings->append(1, L','); | 539 selected_encodings->append(1, L','); |
543 selected_encodings->append(GetCanonicalEncodingNameByCommandId(*it)); | 540 selected_encodings->append(GetCanonicalEncodingNameByCommandId(*it)); |
544 } | 541 } |
545 return true; | 542 return true; |
546 } | 543 } |
OLD | NEW |