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 #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 "app/l10n_util.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
12 #include "base/string_tokenizer.h" | 13 #include "base/string_tokenizer.h" |
13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
14 #include "chrome/app/chrome_dll_resource.h" | 15 #include "chrome/app/chrome_dll_resource.h" |
15 #include "chrome/common/l10n_util.h" | |
16 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
17 #include "unicode/ucnv.h" | 17 #include "unicode/ucnv.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // The maximum length of short list of recently user selected encodings is 3. | 21 // The maximum length of short list of recently user selected encodings is 3. |
22 const size_t kUserSelectedEncodingsMaxLength = 3; | 22 const size_t kUserSelectedEncodingsMaxLength = 3; |
23 | 23 |
24 typedef struct { | 24 typedef struct { |
25 int resource_id; | 25 int resource_id; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 // Insert new encoding to head of selected encoding list. | 466 // Insert new encoding to head of selected encoding list. |
467 *selected_encodings = encoding_name; | 467 *selected_encodings = encoding_name; |
468 // Generate the string for rest selected encoding list. | 468 // Generate the string for rest selected encoding list. |
469 for (std::vector<int>::const_iterator it = selected_encoding_list.begin(); | 469 for (std::vector<int>::const_iterator it = selected_encoding_list.begin(); |
470 it != selected_encoding_list.end(); ++it) { | 470 it != selected_encoding_list.end(); ++it) { |
471 selected_encodings->append(1, L','); | 471 selected_encodings->append(1, L','); |
472 selected_encodings->append(GetCanonicalEncodingNameByCommandId(*it)); | 472 selected_encodings->append(GetCanonicalEncodingNameByCommandId(*it)); |
473 } | 473 } |
474 return true; | 474 return true; |
475 } | 475 } |
OLD | NEW |