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 "ui/base/resource/resource_data_dll_win.h" | 5 #include "ui/base/resource/resource_data_dll_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
9 #include "base/win/resource_util.h" | 9 #include "base/win/resource_util.h" |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 return false; | 41 return false; |
42 } | 42 } |
43 | 43 |
44 base::RefCountedStaticMemory* ResourceDataDLL::GetStaticMemory( | 44 base::RefCountedStaticMemory* ResourceDataDLL::GetStaticMemory( |
45 uint16 resource_id) const { | 45 uint16 resource_id) const { |
46 void* data_ptr; | 46 void* data_ptr; |
47 size_t data_size; | 47 size_t data_size; |
48 if (base::win::GetDataResourceFromModule(module_, resource_id, &data_ptr, | 48 if (base::win::GetDataResourceFromModule(module_, resource_id, &data_ptr, |
49 &data_size)) { | 49 &data_size)) { |
50 return new base::RefCountedStaticMemory( | 50 return new base::RefCountedStaticMemory(data_ptr, data_size); |
51 reinterpret_cast<const unsigned char*>(data_ptr), data_size); | |
52 } | 51 } |
53 return NULL; | 52 return NULL; |
54 } | 53 } |
55 | 54 |
56 ResourceHandle::TextEncodingType ResourceDataDLL::GetTextEncodingType() const { | 55 ResourceHandle::TextEncodingType ResourceDataDLL::GetTextEncodingType() const { |
57 return BINARY; | 56 return BINARY; |
58 } | 57 } |
59 | 58 |
60 ScaleFactor ResourceDataDLL::GetScaleFactor() const { | 59 ScaleFactor ResourceDataDLL::GetScaleFactor() const { |
61 return ui::SCALE_FACTOR_NONE; | 60 return ui::SCALE_FACTOR_NONE; |
62 } | 61 } |
63 | 62 |
64 } // namespace ui | 63 } // namespace ui |
OLD | NEW |