| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 OnMoveRangeSelectionExtent) | 1007 OnMoveRangeSelectionExtent) |
| 1008 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) | 1008 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) |
| 1009 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) | 1009 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) |
| 1010 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, | 1010 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, |
| 1011 OnExtendSelectionAndDelete) | 1011 OnExtendSelectionAndDelete) |
| 1012 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, | 1012 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, |
| 1013 OnSetCompositionFromExistingText) | 1013 OnSetCompositionFromExistingText) |
| 1014 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, | 1014 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, |
| 1015 OnExecuteNoValueEditCommand) | 1015 OnExecuteNoValueEditCommand) |
| 1016 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) | 1016 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) |
| 1017 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) | 1017 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, AddMessageToConsole) |
| 1018 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, | 1018 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, |
| 1019 OnJavaScriptExecuteRequest) | 1019 OnJavaScriptExecuteRequest) |
| 1020 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, | 1020 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, |
| 1021 OnJavaScriptExecuteRequestForTests) | 1021 OnJavaScriptExecuteRequestForTests) |
| 1022 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, | 1022 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, |
| 1023 OnJavaScriptExecuteRequestInIsolatedWorld) | 1023 OnJavaScriptExecuteRequestInIsolatedWorld) |
| 1024 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, | 1024 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, |
| 1025 OnVisualStateRequest) | 1025 OnVisualStateRequest) |
| 1026 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, | 1026 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, |
| 1027 OnSetEditableSelectionOffsets) | 1027 OnSetEditableSelectionOffsets) |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 if (!frame_->hasSelection()) | 1342 if (!frame_->hasSelection()) |
| 1343 return; | 1343 return; |
| 1344 | 1344 |
| 1345 frame_->replaceMisspelledRange(text); | 1345 frame_->replaceMisspelledRange(text); |
| 1346 } | 1346 } |
| 1347 | 1347 |
| 1348 void RenderFrameImpl::OnCSSInsertRequest(const std::string& css) { | 1348 void RenderFrameImpl::OnCSSInsertRequest(const std::string& css) { |
| 1349 frame_->document().insertStyleSheet(WebString::fromUTF8(css)); | 1349 frame_->document().insertStyleSheet(WebString::fromUTF8(css)); |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 void RenderFrameImpl::OnAddMessageToConsole(ConsoleMessageLevel level, | |
| 1353 const std::string& message) { | |
| 1354 if (devtools_agent_) | |
| 1355 devtools_agent_->AddMessageToConsole(level, message); | |
| 1356 } | |
| 1357 | |
| 1358 void RenderFrameImpl::OnJavaScriptExecuteRequest( | 1352 void RenderFrameImpl::OnJavaScriptExecuteRequest( |
| 1359 const base::string16& jscript, | 1353 const base::string16& jscript, |
| 1360 int id, | 1354 int id, |
| 1361 bool notify_result) { | 1355 bool notify_result) { |
| 1362 TRACE_EVENT_INSTANT0("test_tracing", "OnJavaScriptExecuteRequest", | 1356 TRACE_EVENT_INSTANT0("test_tracing", "OnJavaScriptExecuteRequest", |
| 1363 TRACE_EVENT_SCOPE_THREAD); | 1357 TRACE_EVENT_SCOPE_THREAD); |
| 1364 | 1358 |
| 1365 v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); | 1359 v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
| 1366 v8::Local<v8::Value> result = | 1360 v8::Local<v8::Value> result = |
| 1367 frame_->executeScriptAndReturnValue(WebScriptSource(jscript)); | 1361 frame_->executeScriptAndReturnValue(WebScriptSource(jscript)); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 isolate, mojo::js::Core::kModuleName, mojo::js::Core::GetModule(isolate)); | 1882 isolate, mojo::js::Core::kModuleName, mojo::js::Core::GetModule(isolate)); |
| 1889 registry->AddBuiltinModule(isolate, | 1883 registry->AddBuiltinModule(isolate, |
| 1890 mojo::js::Support::kModuleName, | 1884 mojo::js::Support::kModuleName, |
| 1891 mojo::js::Support::GetModule(isolate)); | 1885 mojo::js::Support::GetModule(isolate)); |
| 1892 registry->AddBuiltinModule( | 1886 registry->AddBuiltinModule( |
| 1893 isolate, | 1887 isolate, |
| 1894 ServiceRegistryJsWrapper::kModuleName, | 1888 ServiceRegistryJsWrapper::kModuleName, |
| 1895 ServiceRegistryJsWrapper::Create(isolate, &service_registry_).ToV8()); | 1889 ServiceRegistryJsWrapper::Create(isolate, &service_registry_).ToV8()); |
| 1896 } | 1890 } |
| 1897 | 1891 |
| 1892 void RenderFrameImpl::AddMessageToConsole(ConsoleMessageLevel level, |
| 1893 const std::string& message) { |
| 1894 if (devtools_agent_) |
| 1895 devtools_agent_->AddMessageToConsole(level, message); |
| 1896 } |
| 1897 |
| 1898 // blink::WebFrameClient implementation ---------------------------------------- | 1898 // blink::WebFrameClient implementation ---------------------------------------- |
| 1899 | 1899 |
| 1900 blink::WebPluginPlaceholder* RenderFrameImpl::createPluginPlaceholder( | 1900 blink::WebPluginPlaceholder* RenderFrameImpl::createPluginPlaceholder( |
| 1901 blink::WebLocalFrame* frame, | 1901 blink::WebLocalFrame* frame, |
| 1902 const blink::WebPluginParams& params) { | 1902 const blink::WebPluginParams& params) { |
| 1903 DCHECK_EQ(frame_, frame); | 1903 DCHECK_EQ(frame_, frame); |
| 1904 return GetContentClient() | 1904 return GetContentClient() |
| 1905 ->renderer() | 1905 ->renderer() |
| 1906 ->CreatePluginPlaceholder(this, frame, params) | 1906 ->CreatePluginPlaceholder(this, frame, params) |
| 1907 .release(); | 1907 .release(); |
| (...skipping 3014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4922 #elif defined(ENABLE_BROWSER_CDMS) | 4922 #elif defined(ENABLE_BROWSER_CDMS) |
| 4923 cdm_manager_, | 4923 cdm_manager_, |
| 4924 #endif | 4924 #endif |
| 4925 this); | 4925 this); |
| 4926 } | 4926 } |
| 4927 | 4927 |
| 4928 return cdm_factory_; | 4928 return cdm_factory_; |
| 4929 } | 4929 } |
| 4930 | 4930 |
| 4931 } // namespace content | 4931 } // namespace content |
| OLD | NEW |