| 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 #include "chromecast/renderer/cast_content_renderer_client.h" | 5 #include "chromecast/renderer/cast_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Inject JavaScript files in the correct dependency order. | 169 // Inject JavaScript files in the correct dependency order. |
| 170 static const int mojo_resource_ids[] = { | 170 static const int mojo_resource_ids[] = { |
| 171 IDR_MOJO_UNICODE_JS, | 171 IDR_MOJO_UNICODE_JS, |
| 172 IDR_MOJO_BUFFER_JS, | 172 IDR_MOJO_BUFFER_JS, |
| 173 IDR_MOJO_INTERFACE_TYPES_JS, | 173 IDR_MOJO_INTERFACE_TYPES_JS, |
| 174 IDR_MOJO_CODEC_JS, | 174 IDR_MOJO_CODEC_JS, |
| 175 IDR_MOJO_CONNECTOR_JS, | 175 IDR_MOJO_CONNECTOR_JS, |
| 176 IDR_MOJO_VALIDATOR_JS, | 176 IDR_MOJO_VALIDATOR_JS, |
| 177 IDR_MOJO_ROUTER_JS, | 177 IDR_MOJO_ROUTER_JS, |
| 178 IDR_MOJO_BINDINGS_JS, | 178 IDR_MOJO_BINDINGS_JS, |
| 179 IDR_MOJO_CONNECTION_JS, | |
| 180 }; | 179 }; |
| 181 for (size_t i = 0; i < arraysize(mojo_resource_ids); i++) { | 180 for (size_t i = 0; i < arraysize(mojo_resource_ids); i++) { |
| 182 ExecuteJavaScript(render_frame, mojo_resource_ids[i]); | 181 ExecuteJavaScript(render_frame, mojo_resource_ids[i]); |
| 183 } | 182 } |
| 184 } | 183 } |
| 185 | 184 |
| 186 void ExecuteJavaScript(content::RenderFrame* render_frame, int resource_id) { | 185 void ExecuteJavaScript(content::RenderFrame* render_frame, int resource_id) { |
| 187 const std::string& js_string = ui::ResourceBundle::GetSharedInstance() | 186 const std::string& js_string = ui::ResourceBundle::GetSharedInstance() |
| 188 .GetRawDataResource(resource_id) | 187 .GetRawDataResource(resource_id) |
| 189 .as_string(); | 188 .as_string(); |
| 190 render_frame->ExecuteJavaScript(base::UTF8ToUTF16(js_string)); | 189 render_frame->ExecuteJavaScript(base::UTF8ToUTF16(js_string)); |
| 191 } | 190 } |
| 192 | 191 |
| 193 } // namespace shell | 192 } // namespace shell |
| 194 } // namespace chromecast | 193 } // namespace chromecast |
| OLD | NEW |