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 #include "webkit/support/platform_support.h" | 5 #include "webkit/support/platform_support.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { | 29 base::StringPiece GetRawDataResource(HMODULE module, int resource_id) { |
30 void* data_ptr; | 30 void* data_ptr; |
31 size_t data_size; | 31 size_t data_size; |
32 return base::GetDataResourceFromModule(module, resource_id, &data_ptr, | 32 return base::GetDataResourceFromModule(module, resource_id, &data_ptr, |
33 &data_size) | 33 &data_size) |
34 ? base::StringPiece(static_cast<char*>(data_ptr), data_size) | 34 ? base::StringPiece(static_cast<char*>(data_ptr), data_size) |
35 : base::StringPiece(); | 35 : base::StringPiece(); |
36 } | 36 } |
37 | 37 |
38 base::StringPiece NetResourceProvider(int key) { | 38 base::StringPiece ResourceProvider(int key) { |
39 return GetRawDataResource(::GetModuleHandle(NULL), key); | 39 return GetRawDataResource(::GetModuleHandle(NULL), key); |
40 } | 40 } |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 namespace webkit_support { | 44 namespace webkit_support { |
45 | 45 |
46 // TODO(tkent): Implement some of the followings for platform-dependent tasks | 46 // TODO(tkent): Implement some of the followings for platform-dependent tasks |
47 // such as loading resource. | 47 // such as loading resource. |
48 | 48 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 static std::string resize_corner_data; | 92 static std::string resize_corner_data; |
93 if (resize_corner_data.empty()) { | 93 if (resize_corner_data.empty()) { |
94 FilePath path = GetResourceFilePath("textAreaResizeCorner.png"); | 94 FilePath path = GetResourceFilePath("textAreaResizeCorner.png"); |
95 bool success = file_util::ReadFileToString(path, &resize_corner_data); | 95 bool success = file_util::ReadFileToString(path, &resize_corner_data); |
96 if (!success) { | 96 if (!success) { |
97 LOG(FATAL) << "Failed reading: " << path.value(); | 97 LOG(FATAL) << "Failed reading: " << path.value(); |
98 } | 98 } |
99 } | 99 } |
100 return resize_corner_data; | 100 return resize_corner_data; |
101 } | 101 } |
102 | |
103 case IDR_SEARCH_CANCEL: | |
104 case IDR_SEARCH_CANCEL_PRESSED: | |
105 case IDR_SEARCH_MAGNIFIER: | |
106 case IDR_SEARCH_MAGNIFIER_RESULTS: | |
107 case IDR_MEDIA_PAUSE_BUTTON: | |
108 case IDR_MEDIA_PLAY_BUTTON: | |
109 case IDR_MEDIA_PLAY_BUTTON_DISABLED: | |
110 case IDR_MEDIA_SOUND_FULL_BUTTON: | |
111 case IDR_MEDIA_SOUND_NONE_BUTTON: | |
112 case IDR_MEDIA_SOUND_DISABLED: | |
113 case IDR_MEDIA_SLIDER_THUMB: | |
114 case IDR_MEDIA_VOLUME_SLIDER_THUMB: | |
115 case IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS: | |
116 return NetResourceProvider(resource_id); | |
117 | |
118 default: | |
119 break; | |
120 } | 102 } |
121 | 103 |
122 return base::StringPiece(); | 104 return ResourceProvider(resource_id); |
123 } | 105 } |
124 | 106 |
125 } // namespace webkit_glue | 107 } // namespace webkit_glue |
OLD | NEW |