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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 public: | 28 public: |
29 // Returns the singleton of delegate. It doesn't create an instance. | 29 // Returns the singleton of delegate. It doesn't create an instance. |
30 static CastResourceDelegate* GetInstance(); | 30 static CastResourceDelegate* GetInstance(); |
31 | 31 |
32 CastResourceDelegate(); | 32 CastResourceDelegate(); |
33 virtual ~CastResourceDelegate(); | 33 virtual ~CastResourceDelegate(); |
34 | 34 |
35 // ui:ResourceBundle::Delegate implementation: | 35 // ui:ResourceBundle::Delegate implementation: |
36 virtual base::FilePath GetPathForResourcePack( | 36 virtual base::FilePath GetPathForResourcePack( |
37 const base::FilePath& pack_path, | 37 const base::FilePath& pack_path, |
38 ui::ScaleFactor scale_factor) OVERRIDE; | 38 ui::ScaleFactor scale_factor) override; |
39 virtual base::FilePath GetPathForLocalePack( | 39 virtual base::FilePath GetPathForLocalePack( |
40 const base::FilePath& pack_path, | 40 const base::FilePath& pack_path, |
41 const std::string& locale) OVERRIDE; | 41 const std::string& locale) override; |
42 virtual gfx::Image GetImageNamed(int resource_id) OVERRIDE; | 42 virtual gfx::Image GetImageNamed(int resource_id) override; |
43 virtual gfx::Image GetNativeImageNamed( | 43 virtual gfx::Image GetNativeImageNamed( |
44 int resource_id, | 44 int resource_id, |
45 ui::ResourceBundle::ImageRTL rtl) OVERRIDE; | 45 ui::ResourceBundle::ImageRTL rtl) override; |
46 virtual base::RefCountedStaticMemory* LoadDataResourceBytes( | 46 virtual base::RefCountedStaticMemory* LoadDataResourceBytes( |
47 int resource_id, | 47 int resource_id, |
48 ui::ScaleFactor scale_factor) OVERRIDE; | 48 ui::ScaleFactor scale_factor) override; |
49 virtual bool GetRawDataResource(int resource_id, | 49 virtual bool GetRawDataResource(int resource_id, |
50 ui::ScaleFactor scale_factor, | 50 ui::ScaleFactor scale_factor, |
51 base::StringPiece* value) OVERRIDE; | 51 base::StringPiece* value) override; |
52 virtual bool GetLocalizedString(int message_id, | 52 virtual bool GetLocalizedString(int message_id, |
53 base::string16* value) OVERRIDE; | 53 base::string16* value) override; |
54 virtual scoped_ptr<gfx::Font> GetFont( | 54 virtual scoped_ptr<gfx::Font> GetFont( |
55 ui::ResourceBundle::FontStyle style) OVERRIDE; | 55 ui::ResourceBundle::FontStyle style) override; |
56 | 56 |
57 // Adds/removes/clears extra localized strings. | 57 // Adds/removes/clears extra localized strings. |
58 void AddExtraLocalizedString(int resource_id, | 58 void AddExtraLocalizedString(int resource_id, |
59 const base::string16& localized); | 59 const base::string16& localized); |
60 void RemoveExtraLocalizedString(int resource_id); | 60 void RemoveExtraLocalizedString(int resource_id); |
61 void ClearAllExtraLocalizedStrings(); | 61 void ClearAllExtraLocalizedStrings(); |
62 | 62 |
63 private: | 63 private: |
64 typedef base::hash_map<int, base::string16> ExtraLocaledStringMap; | 64 typedef base::hash_map<int, base::string16> ExtraLocaledStringMap; |
65 | 65 |
66 ExtraLocaledStringMap extra_localized_strings_; | 66 ExtraLocaledStringMap extra_localized_strings_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(CastResourceDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(CastResourceDelegate); |
69 }; | 69 }; |
70 | 70 |
71 } // namespace chromecast | 71 } // namespace chromecast |
72 | 72 |
73 #endif // CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ | 73 #endif // CHROMECAST_COMMON_CAST_RESOURCE_DELEGATE_H_ |
OLD | NEW |