Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 217183004: Migrate addMessageToConsole API to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) 1140 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent)
1141 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, 1141 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage,
1142 OnRunJavaScriptMessage) 1142 OnRunJavaScriptMessage)
1143 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, 1143 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm,
1144 OnRunBeforeUnloadConfirm) 1144 OnRunBeforeUnloadConfirm)
1145 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) 1145 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging)
1146 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) 1146 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
1147 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) 1147 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK)
1148 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) 1148 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
1149 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) 1149 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
1150 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole)
1151 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK) 1150 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK)
1152 IPC_MESSAGE_HANDLER(ViewHostMsg_SwapOut_ACK, OnSwapOutACK) 1151 IPC_MESSAGE_HANDLER(ViewHostMsg_SwapOut_ACK, OnSwapOutACK)
1153 #if defined(OS_ANDROID) 1152 #if defined(OS_ANDROID)
1154 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionRootBoundsChanged, 1153 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionRootBoundsChanged,
1155 OnSelectionRootBoundsChanged) 1154 OnSelectionRootBoundsChanged)
1156 #endif 1155 #endif
1157 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) 1156 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse)
1158 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) 1157 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL)
1159 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission, 1158 IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_RequestPermission,
1160 OnRequestDesktopNotificationPermission) 1159 OnRequestDesktopNotificationPermission)
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 base::Bind(base::IgnoreResult(&DismissVirtualKeyboardTask)), 1534 base::Bind(base::IgnoreResult(&DismissVirtualKeyboardTask)),
1536 TimeDelta::FromMilliseconds(kVirtualKeyboardDisplayWaitTimeoutMs)); 1535 TimeDelta::FromMilliseconds(kVirtualKeyboardDisplayWaitTimeoutMs));
1537 } 1536 }
1538 #endif 1537 #endif
1539 NotificationService::current()->Notify( 1538 NotificationService::current()->Notify(
1540 NOTIFICATION_FOCUS_CHANGED_IN_PAGE, 1539 NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
1541 Source<RenderViewHost>(this), 1540 Source<RenderViewHost>(this),
1542 Details<const bool>(&is_editable_node)); 1541 Details<const bool>(&is_editable_node));
1543 } 1542 }
1544 1543
1545 void RenderViewHostImpl::OnAddMessageToConsole(
1546 int32 level,
1547 const base::string16& message,
1548 int32 line_no,
1549 const base::string16& source_id) {
1550 if (delegate_->AddMessageToConsole(level, message, line_no, source_id))
1551 return;
1552
1553 // Pass through log level only on WebUI pages to limit console spew.
1554 int32 resolved_level = HasWebUIScheme(delegate_->GetURL()) ? level : 0;
1555
1556 if (resolved_level >= ::logging::GetMinLogLevel()) {
1557 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" <<
1558 message << "\", source: " << source_id << " (" << line_no << ")";
1559 }
1560 }
1561
1562 void RenderViewHostImpl::OnUserGesture() { 1544 void RenderViewHostImpl::OnUserGesture() {
1563 delegate_->OnUserGesture(); 1545 delegate_->OnUserGesture();
1564 } 1546 }
1565 1547
1566 void RenderViewHostImpl::OnClosePageACK() { 1548 void RenderViewHostImpl::OnClosePageACK() {
1567 decrement_in_flight_event_count(); 1549 decrement_in_flight_event_count();
1568 ClosePageIgnoringUnloadEvents(); 1550 ClosePageIgnoringUnloadEvents();
1569 } 1551 }
1570 1552
1571 void RenderViewHostImpl::NotifyRendererUnresponsive() { 1553 void RenderViewHostImpl::NotifyRendererUnresponsive() {
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 return true; 1933 return true;
1952 } 1934 }
1953 1935
1954 void RenderViewHostImpl::AttachToFrameTree() { 1936 void RenderViewHostImpl::AttachToFrameTree() {
1955 FrameTree* frame_tree = delegate_->GetFrameTree(); 1937 FrameTree* frame_tree = delegate_->GetFrameTree();
1956 1938
1957 frame_tree->ResetForMainFrameSwap(); 1939 frame_tree->ResetForMainFrameSwap();
1958 } 1940 }
1959 1941
1960 } // namespace content 1942 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698