OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents, | 705 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents, |
706 OnMsgDidChangeNumWheelEvents) | 706 OnMsgDidChangeNumWheelEvents) |
707 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, | 707 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, |
708 OnMsgRunJavaScriptMessage) | 708 OnMsgRunJavaScriptMessage) |
709 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, | 709 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, |
710 OnMsgRunBeforeUnloadConfirm) | 710 OnMsgRunBeforeUnloadConfirm) |
711 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) | 711 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) |
712 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 712 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
713 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) | 713 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) |
714 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 714 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
| 715 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
715 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) | 716 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) |
716 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK) | 717 IPC_MESSAGE_HANDLER(ViewHostMsg_ShouldClose_ACK, OnMsgShouldCloseACK) |
717 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnMsgClosePageACK) | 718 IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnMsgClosePageACK) |
718 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) | 719 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) |
719 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, | 720 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, |
720 OnMsgSelectionBoundsChanged) | 721 OnMsgSelectionBoundsChanged) |
721 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, | 722 IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, |
722 OnAccessibilityNotifications) | 723 OnAccessibilityNotifications) |
723 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) | 724 IPC_MESSAGE_HANDLER(ViewHostMsg_ScriptEvalResponse, OnScriptEvalResponse) |
724 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) | 725 IPC_MESSAGE_HANDLER(ViewHostMsg_DidZoomURL, OnDidZoomURL) |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 content::Source<RenderViewHost>(this), | 1125 content::Source<RenderViewHost>(this), |
1125 content::NotificationService::NoDetails()); | 1126 content::NotificationService::NoDetails()); |
1126 } | 1127 } |
1127 | 1128 |
1128 void RenderViewHost::OnTakeFocus(bool reverse) { | 1129 void RenderViewHost::OnTakeFocus(bool reverse) { |
1129 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 1130 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
1130 if (view) | 1131 if (view) |
1131 view->TakeFocus(reverse); | 1132 view->TakeFocus(reverse); |
1132 } | 1133 } |
1133 | 1134 |
| 1135 void RenderViewHost::OnFocusedNodeChanged(bool is_editable_node) { |
| 1136 content::NotificationService::current()->Notify( |
| 1137 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 1138 content::Source<RenderViewHost>(this), |
| 1139 content::Details<const bool>(&is_editable_node)); |
| 1140 } |
| 1141 |
1134 void RenderViewHost::OnAddMessageToConsole(int32 level, | 1142 void RenderViewHost::OnAddMessageToConsole(int32 level, |
1135 const string16& message, | 1143 const string16& message, |
1136 int32 line_no, | 1144 int32 line_no, |
1137 const string16& source_id) { | 1145 const string16& source_id) { |
1138 // Pass through log level only on WebUI pages to limit console spew. | 1146 // Pass through log level only on WebUI pages to limit console spew. |
1139 int32 resolved_level = | 1147 int32 resolved_level = |
1140 (enabled_bindings_ & content::BINDINGS_POLICY_WEB_UI) ? level : 0; | 1148 (enabled_bindings_ & content::BINDINGS_POLICY_WEB_UI) ? level : 0; |
1141 | 1149 |
1142 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" << | 1150 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" << |
1143 message << "\", source: " << source_id << " (" << line_no << ")"; | 1151 message << "\", source: " << source_id << " (" << line_no << ")"; |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 | 1521 |
1514 void RenderViewHost::OnWebUISend(const GURL& source_url, | 1522 void RenderViewHost::OnWebUISend(const GURL& source_url, |
1515 const std::string& name, | 1523 const std::string& name, |
1516 const base::ListValue& args) { | 1524 const base::ListValue& args) { |
1517 delegate_->WebUISend(this, source_url, name, args); | 1525 delegate_->WebUISend(this, source_url, name, args); |
1518 } | 1526 } |
1519 | 1527 |
1520 void RenderViewHost::ClearPowerSaveBlockers() { | 1528 void RenderViewHost::ClearPowerSaveBlockers() { |
1521 STLDeleteValues(&power_save_blockers_); | 1529 STLDeleteValues(&power_save_blockers_); |
1522 } | 1530 } |
OLD | NEW |