| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) | 362 IPC_MESSAGE_HANDLER(ViewMsg_SelectAll, OnSelectAll) |
| 363 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) | 363 IPC_MESSAGE_HANDLER(ViewMsg_CopyImageAt, OnCopyImageAt) |
| 364 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) | 364 IPC_MESSAGE_HANDLER(ViewMsg_Find, OnFind) |
| 365 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) | 365 IPC_MESSAGE_HANDLER(ViewMsg_Zoom, OnZoom) |
| 366 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) | 366 IPC_MESSAGE_HANDLER(ViewMsg_SetPageEncoding, OnSetPageEncoding) |
| 367 IPC_MESSAGE_HANDLER(ViewMsg_InspectElement, OnInspectElement) | 367 IPC_MESSAGE_HANDLER(ViewMsg_InspectElement, OnInspectElement) |
| 368 IPC_MESSAGE_HANDLER(ViewMsg_ShowJavaScriptConsole, OnShowJavaScriptConsole) | 368 IPC_MESSAGE_HANDLER(ViewMsg_ShowJavaScriptConsole, OnShowJavaScriptConsole) |
| 369 IPC_MESSAGE_HANDLER(ViewMsg_SetupDevToolsClient, OnSetupDevToolsClient) | 369 IPC_MESSAGE_HANDLER(ViewMsg_SetupDevToolsClient, OnSetupDevToolsClient) |
| 370 IPC_MESSAGE_HANDLER(ViewMsg_DownloadImage, OnDownloadImage) | 370 IPC_MESSAGE_HANDLER(ViewMsg_DownloadImage, OnDownloadImage) |
| 371 IPC_MESSAGE_HANDLER(ViewMsg_ScriptEvalRequest, OnScriptEvalRequest) | 371 IPC_MESSAGE_HANDLER(ViewMsg_ScriptEvalRequest, OnScriptEvalRequest) |
| 372 IPC_MESSAGE_HANDLER(ViewMsg_CSSInsertRequest, OnCSSInsertRequest) |
| 372 IPC_MESSAGE_HANDLER(ViewMsg_AddMessageToConsole, OnAddMessageToConsole) | 373 IPC_MESSAGE_HANDLER(ViewMsg_AddMessageToConsole, OnAddMessageToConsole) |
| 373 IPC_MESSAGE_HANDLER(ViewMsg_DebugAttach, OnDebugAttach) | 374 IPC_MESSAGE_HANDLER(ViewMsg_DebugAttach, OnDebugAttach) |
| 374 IPC_MESSAGE_HANDLER(ViewMsg_DebugDetach, OnDebugDetach) | 375 IPC_MESSAGE_HANDLER(ViewMsg_DebugDetach, OnDebugDetach) |
| 375 IPC_MESSAGE_HANDLER(ViewMsg_ReservePageIDRange, OnReservePageIDRange) | 376 IPC_MESSAGE_HANDLER(ViewMsg_ReservePageIDRange, OnReservePageIDRange) |
| 376 IPC_MESSAGE_HANDLER(ViewMsg_UploadFile, OnUploadFileRequest) | 377 IPC_MESSAGE_HANDLER(ViewMsg_UploadFile, OnUploadFileRequest) |
| 377 IPC_MESSAGE_HANDLER(ViewMsg_FormFill, OnFormFill) | 378 IPC_MESSAGE_HANDLER(ViewMsg_FormFill, OnFormFill) |
| 378 IPC_MESSAGE_HANDLER(ViewMsg_FillPasswordForm, OnFillPasswordForm) | 379 IPC_MESSAGE_HANDLER(ViewMsg_FillPasswordForm, OnFillPasswordForm) |
| 379 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragEnter, OnDragTargetDragEnter) | 380 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragEnter, OnDragTargetDragEnter) |
| 380 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragOver, OnDragTargetDragOver) | 381 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragOver, OnDragTargetDragOver) |
| 381 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragLeave, OnDragTargetDragLeave) | 382 IPC_MESSAGE_HANDLER(ViewMsg_DragTargetDragLeave, OnDragTargetDragLeave) |
| (...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2447 void RenderView::EvaluateScript(const std::wstring& frame_xpath, | 2448 void RenderView::EvaluateScript(const std::wstring& frame_xpath, |
| 2448 const std::wstring& script) { | 2449 const std::wstring& script) { |
| 2449 WebFrame* web_frame = GetChildFrame(frame_xpath); | 2450 WebFrame* web_frame = GetChildFrame(frame_xpath); |
| 2450 if (!web_frame) | 2451 if (!web_frame) |
| 2451 return; | 2452 return; |
| 2452 | 2453 |
| 2453 web_frame->ExecuteScript( | 2454 web_frame->ExecuteScript( |
| 2454 webkit_glue::WebScriptSource(WideToUTF8(script))); | 2455 webkit_glue::WebScriptSource(WideToUTF8(script))); |
| 2455 } | 2456 } |
| 2456 | 2457 |
| 2458 void RenderView::InsertCSS(const std::wstring& frame_xpath, |
| 2459 const std::string& css) { |
| 2460 WebFrame* web_frame = GetChildFrame(frame_xpath); |
| 2461 if (!web_frame) |
| 2462 return; |
| 2463 |
| 2464 web_frame->InsertCSSStyles(css); |
| 2465 } |
| 2466 |
| 2457 void RenderView::OnScriptEvalRequest(const std::wstring& frame_xpath, | 2467 void RenderView::OnScriptEvalRequest(const std::wstring& frame_xpath, |
| 2458 const std::wstring& jscript) { | 2468 const std::wstring& jscript) { |
| 2459 EvaluateScript(frame_xpath, jscript); | 2469 EvaluateScript(frame_xpath, jscript); |
| 2460 } | 2470 } |
| 2461 | 2471 |
| 2472 void RenderView::OnCSSInsertRequest(const std::wstring& frame_xpath, |
| 2473 const std::string& css) { |
| 2474 InsertCSS(frame_xpath, css); |
| 2475 } |
| 2476 |
| 2462 void RenderView::OnAddMessageToConsole(const std::wstring& frame_xpath, | 2477 void RenderView::OnAddMessageToConsole(const std::wstring& frame_xpath, |
| 2463 const std::wstring& msg, | 2478 const std::wstring& msg, |
| 2464 ConsoleMessageLevel level) { | 2479 ConsoleMessageLevel level) { |
| 2465 WebFrame* web_frame = GetChildFrame(frame_xpath); | 2480 WebFrame* web_frame = GetChildFrame(frame_xpath); |
| 2466 if (!web_frame) | 2481 if (!web_frame) |
| 2467 return; | 2482 return; |
| 2468 | 2483 |
| 2469 web_frame->AddMessageToConsole(msg, level); | 2484 web_frame->AddMessageToConsole(msg, level); |
| 2470 } | 2485 } |
| 2471 | 2486 |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2932 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); | 2947 DCHECK(audio_renderers_.Lookup(stream_id) != NULL); |
| 2933 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); | 2948 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); |
| 2934 } | 2949 } |
| 2935 | 2950 |
| 2936 void RenderView::OnResize(const gfx::Size& new_size, | 2951 void RenderView::OnResize(const gfx::Size& new_size, |
| 2937 const gfx::Rect& resizer_rect) { | 2952 const gfx::Rect& resizer_rect) { |
| 2938 if (webview()) | 2953 if (webview()) |
| 2939 webview()->HideAutofillPopup(); | 2954 webview()->HideAutofillPopup(); |
| 2940 RenderWidget::OnResize(new_size, resizer_rect); | 2955 RenderWidget::OnResize(new_size, resizer_rect); |
| 2941 } | 2956 } |
| OLD | NEW |