OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file declares a helper class for selecting a supported language from a | 5 // This file declares a helper class for selecting a supported language from a |
6 // set of candidates. | 6 // set of candidates. |
7 | 7 |
8 #ifndef CHROME_INSTALLER_UTIL_LANGUAGE_SELECTOR_H_ | 8 #ifndef CHROME_INSTALLER_UTIL_LANGUAGE_SELECTOR_H_ |
9 #define CHROME_INSTALLER_UTIL_LANGUAGE_SELECTOR_H_ | 9 #define CHROME_INSTALLER_UTIL_LANGUAGE_SELECTOR_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 | 16 |
17 namespace installer_util { | 17 namespace installer { |
18 | 18 |
19 // A helper class for selecting a supported language from a set of candidates. | 19 // A helper class for selecting a supported language from a set of candidates. |
20 // By default, the candidates are retrieved from the operating system. | 20 // By default, the candidates are retrieved from the operating system. |
21 class LanguageSelector { | 21 class LanguageSelector { |
22 public: | 22 public: |
23 // Default constructor will select from the set of languages supported by the | 23 // Default constructor will select from the set of languages supported by the |
24 // operating system. | 24 // operating system. |
25 LanguageSelector(); | 25 LanguageSelector(); |
26 | 26 |
27 // Constructor for testing purposes. | 27 // Constructor for testing purposes. |
(...skipping 20 matching lines...) Expand all Loading... |
48 SelectPred_Fn select_predicate, | 48 SelectPred_Fn select_predicate, |
49 std::wstring* matched_name, int* matched_offset); | 49 std::wstring* matched_name, int* matched_offset); |
50 void DoSelect(const std::vector<std::wstring>& candidates); | 50 void DoSelect(const std::vector<std::wstring>& candidates); |
51 | 51 |
52 std::wstring matched_candidate_; | 52 std::wstring matched_candidate_; |
53 int offset_; | 53 int offset_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(LanguageSelector); | 55 DISALLOW_COPY_AND_ASSIGN(LanguageSelector); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace installer_util. | 58 } // namespace installer. |
59 | 59 |
60 #endif // CHROME_INSTALLER_UTIL_LANGUAGE_SELECTOR_H_ | 60 #endif // CHROME_INSTALLER_UTIL_LANGUAGE_SELECTOR_H_ |
OLD | NEW |