| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 IPC_MESSAGE_HANDLER(ViewMsg_PopupNotificationVisiblityChanged, | 434 IPC_MESSAGE_HANDLER(ViewMsg_PopupNotificationVisiblityChanged, |
| 435 OnPopupNotificationVisiblityChanged) | 435 OnPopupNotificationVisiblityChanged) |
| 436 IPC_MESSAGE_HANDLER(ViewMsg_RequestAudioPacket, OnRequestAudioPacket) | 436 IPC_MESSAGE_HANDLER(ViewMsg_RequestAudioPacket, OnRequestAudioPacket) |
| 437 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamCreated, OnAudioStreamCreated) | 437 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamCreated, OnAudioStreamCreated) |
| 438 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamStateChanged, | 438 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamStateChanged, |
| 439 OnAudioStreamStateChanged) | 439 OnAudioStreamStateChanged) |
| 440 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamVolume, OnAudioStreamVolume) | 440 IPC_MESSAGE_HANDLER(ViewMsg_NotifyAudioStreamVolume, OnAudioStreamVolume) |
| 441 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) | 441 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) |
| 442 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionResponse, OnExtensionResponse) | 442 IPC_MESSAGE_HANDLER(ViewMsg_ExtensionResponse, OnExtensionResponse) |
| 443 IPC_MESSAGE_HANDLER(ViewMsg_RequestSelectionText, OnRequestSelectionText) | 443 IPC_MESSAGE_HANDLER(ViewMsg_RequestSelectionText, OnRequestSelectionText) |
| 444 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedNode, OnClearFocusedNode) |
| 444 | 445 |
| 445 // Have the super handle all other messages. | 446 // Have the super handle all other messages. |
| 446 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) | 447 IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) |
| 447 IPC_END_MESSAGE_MAP() | 448 IPC_END_MESSAGE_MAP() |
| 448 } | 449 } |
| 449 | 450 |
| 450 void RenderView::SendThumbnail() { | 451 void RenderView::SendThumbnail() { |
| 451 WebFrame* main_frame = webview()->GetMainFrame(); | 452 WebFrame* main_frame = webview()->GetMainFrame(); |
| 452 if (!main_frame) | 453 if (!main_frame) |
| 453 return; | 454 return; |
| (...skipping 2550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3004 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); | 3005 Send(new ViewHostMsg_SetAudioVolume(routing_id_, stream_id, left, right)); |
| 3005 } | 3006 } |
| 3006 | 3007 |
| 3007 void RenderView::OnResize(const gfx::Size& new_size, | 3008 void RenderView::OnResize(const gfx::Size& new_size, |
| 3008 const gfx::Rect& resizer_rect) { | 3009 const gfx::Rect& resizer_rect) { |
| 3009 if (webview()) | 3010 if (webview()) |
| 3010 webview()->HideAutofillPopup(); | 3011 webview()->HideAutofillPopup(); |
| 3011 RenderWidget::OnResize(new_size, resizer_rect); | 3012 RenderWidget::OnResize(new_size, resizer_rect); |
| 3012 } | 3013 } |
| 3013 | 3014 |
| 3015 void RenderView::OnClearFocusedNode() { |
| 3016 if (webview()) |
| 3017 webview()->ClearFocusedNode(); |
| 3018 } |
| 3019 |
| 3014 void RenderView::SendExtensionRequest(const std::string& name, | 3020 void RenderView::SendExtensionRequest(const std::string& name, |
| 3015 const std::string& args, | 3021 const std::string& args, |
| 3016 int callback_id, | 3022 int callback_id, |
| 3017 WebFrame* callback_frame) { | 3023 WebFrame* callback_frame) { |
| 3018 DCHECK(RenderThread::current()->message_loop() == MessageLoop::current()); | 3024 DCHECK(RenderThread::current()->message_loop() == MessageLoop::current()); |
| 3019 | 3025 |
| 3020 if (callback_id != -1) { | 3026 if (callback_id != -1) { |
| 3021 DCHECK(callback_frame) << "Callback specified without frame"; | 3027 DCHECK(callback_frame) << "Callback specified without frame"; |
| 3022 pending_extension_callbacks_.AddWithID(callback_frame, callback_id); | 3028 pending_extension_callbacks_.AddWithID(callback_frame, callback_id); |
| 3023 } | 3029 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3141 "Renderer.Other.StartToFinishDoc", start_to_finish_doc); | 3147 "Renderer.Other.StartToFinishDoc", start_to_finish_doc); |
| 3142 UMA_HISTOGRAM_TIMES( | 3148 UMA_HISTOGRAM_TIMES( |
| 3143 "Renderer.Other.FinishDocToFinish", finish_doc_to_finish); | 3149 "Renderer.Other.FinishDocToFinish", finish_doc_to_finish); |
| 3144 UMA_HISTOGRAM_TIMES( | 3150 UMA_HISTOGRAM_TIMES( |
| 3145 "Renderer.Other.RequestToFinish", request_to_finish); | 3151 "Renderer.Other.RequestToFinish", request_to_finish); |
| 3146 UMA_HISTOGRAM_TIMES( | 3152 UMA_HISTOGRAM_TIMES( |
| 3147 "Renderer.Other.StartToFinish", start_to_finish); | 3153 "Renderer.Other.StartToFinish", start_to_finish); |
| 3148 break; | 3154 break; |
| 3149 } | 3155 } |
| 3150 } | 3156 } |
| OLD | NEW |