| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1113 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) | 1113 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) |
| 1114 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, | 1114 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, |
| 1115 OnRunJavaScriptMessage) | 1115 OnRunJavaScriptMessage) |
| 1116 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, | 1116 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, |
| 1117 OnRunBeforeUnloadConfirm) | 1117 OnRunBeforeUnloadConfirm) |
| 1118 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) | 1118 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) |
| 1119 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 1119 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
| 1120 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) | 1120 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) |
| 1121 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 1121 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
| 1122 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | 1122 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
| 1123 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) | |
| 1124 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) | 1123 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) |
| 1125 #if defined(OS_ANDROID) | 1124 #if defined(OS_ANDROID) |
| 1126 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionRootBoundsChanged, | 1125 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionRootBoundsChanged, |
| 1127 OnSelectionRootBoundsChanged) | 1126 OnSelectionRootBoundsChanged) |
| 1128 #endif | 1127 #endif |
| 1129 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) | 1128 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) |
| 1130 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) | 1129 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) |
| 1131 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, | 1130 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, |
| 1132 OnRequestDesktopNotificationPermission) | 1131 OnRequestDesktopNotificationPermission) |
| 1133 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, | 1132 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_Show, |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 base::Bind(base::IgnoreResult(&DismissVirtualKeyboardTask)), | 1505 base::Bind(base::IgnoreResult(&DismissVirtualKeyboardTask)), |
| 1507 TimeDelta::FromMilliseconds(kVirtualKeyboardDisplayWaitTimeoutMs)); | 1506 TimeDelta::FromMilliseconds(kVirtualKeyboardDisplayWaitTimeoutMs)); |
| 1508 } | 1507 } |
| 1509 #endif | 1508 #endif |
| 1510 NotificationService::current()->Notify( | 1509 NotificationService::current()->Notify( |
| 1511 NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 1510 NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 1512 Source<RenderViewHost>(this), | 1511 Source<RenderViewHost>(this), |
| 1513 Details<const bool>(&is_editable_node)); | 1512 Details<const bool>(&is_editable_node)); |
| 1514 } | 1513 } |
| 1515 | 1514 |
| 1516 void RenderViewHostImpl::OnAddMessageToConsole( | |
| 1517 int32 level, | |
| 1518 const base::string16& message, | |
| 1519 int32 line_no, | |
| 1520 const base::string16& source_id) { | |
| 1521 if (delegate_->AddMessageToConsole(level, message, line_no, source_id)) | |
| 1522 return; | |
| 1523 | |
| 1524 // Pass through log level only on WebUI pages to limit console spew. | |
| 1525 int32 resolved_level = HasWebUIScheme(delegate_->GetURL()) ? level : 0; | |
| 1526 | |
| 1527 if (resolved_level >= ::logging::GetMinLogLevel()) { | |
| 1528 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" << | |
| 1529 message << "\", source: " << source_id << " (" << line_no << ")"; | |
| 1530 } | |
| 1531 } | |
| 1532 | |
| 1533 void RenderViewHostImpl::OnUserGesture() { | 1515 void RenderViewHostImpl::OnUserGesture() { |
| 1534 delegate_->OnUserGesture(); | 1516 delegate_->OnUserGesture(); |
| 1535 } | 1517 } |
| 1536 | 1518 |
| 1537 void RenderViewHostImpl::OnClosePageACK() { | 1519 void RenderViewHostImpl::OnClosePageACK() { |
| 1538 decrement_in_flight_event_count(); | 1520 decrement_in_flight_event_count(); |
| 1539 ClosePageIgnoringUnloadEvents(); | 1521 ClosePageIgnoringUnloadEvents(); |
| 1540 } | 1522 } |
| 1541 | 1523 |
| 1542 void RenderViewHostImpl::NotifyRendererUnresponsive() { | 1524 void RenderViewHostImpl::NotifyRendererUnresponsive() { |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1922 return true; | 1904 return true; |
| 1923 } | 1905 } |
| 1924 | 1906 |
| 1925 void RenderViewHostImpl::AttachToFrameTree() { | 1907 void RenderViewHostImpl::AttachToFrameTree() { |
| 1926 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1908 FrameTree* frame_tree = delegate_->GetFrameTree(); |
| 1927 | 1909 |
| 1928 frame_tree->ResetForMainFrameSwap(); | 1910 frame_tree->ResetForMainFrameSwap(); |
| 1929 } | 1911 } |
| 1930 | 1912 |
| 1931 } // namespace content | 1913 } // namespace content |
| OLD | NEW |