OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ | 5 #ifndef CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ |
6 #define CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ | 6 #define CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | |
11 | 10 |
12 #include "base/macros.h" | 11 #include "base/macros.h" |
13 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
14 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
15 | 14 |
16 namespace base { | 15 namespace base { |
17 class FilePath; | 16 class FilePath; |
18 } | 17 } |
19 | 18 |
20 namespace gfx { | 19 namespace gfx { |
(...skipping 29 matching lines...) Expand all Loading... |
50 base::StringPiece* value) override; | 49 base::StringPiece* value) override; |
51 bool GetLocalizedString(int message_id, base::string16* value) override; | 50 bool GetLocalizedString(int message_id, base::string16* value) override; |
52 | 51 |
53 // Adds/removes/clears extra localized strings. | 52 // Adds/removes/clears extra localized strings. |
54 void AddExtraLocalizedString(int resource_id, | 53 void AddExtraLocalizedString(int resource_id, |
55 const base::string16& localized); | 54 const base::string16& localized); |
56 void RemoveExtraLocalizedString(int resource_id); | 55 void RemoveExtraLocalizedString(int resource_id); |
57 void ClearAllExtraLocalizedStrings(); | 56 void ClearAllExtraLocalizedStrings(); |
58 | 57 |
59 private: | 58 private: |
60 using ExtraLocaledStringMap = std::unordered_map<int, base::string16>; | 59 typedef base::hash_map<int, base::string16> ExtraLocaledStringMap; |
61 | 60 |
62 ExtraLocaledStringMap extra_localized_strings_; | 61 ExtraLocaledStringMap extra_localized_strings_; |
63 | 62 |
64 DISALLOW_COPY_AND_ASSIGN(CastResourceDelegate); | 63 DISALLOW_COPY_AND_ASSIGN(CastResourceDelegate); |
65 }; | 64 }; |
66 | 65 |
67 } // namespace chromecast | 66 } // namespace chromecast |
68 | 67 |
69 #endif // CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ | 68 #endif // CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ |
OLD | NEW |