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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | 295 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
296 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL) | 296 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL) |
297 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 297 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
298 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) | 298 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) |
299 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 299 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
300 OnRegisterProtocolHandler) | 300 OnRegisterProtocolHandler) |
301 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterIntentHandler, | 301 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterIntentHandler, |
302 OnRegisterIntentHandler) | 302 OnRegisterIntentHandler) |
303 IPC_MESSAGE_HANDLER(ViewHostMsg_WebIntentDispatch, | 303 IPC_MESSAGE_HANDLER(ViewHostMsg_WebIntentDispatch, |
304 OnWebIntentDispatch) | 304 OnWebIntentDispatch) |
| 305 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
305 IPC_MESSAGE_UNHANDLED(handled = false) | 306 IPC_MESSAGE_UNHANDLED(handled = false) |
306 IPC_END_MESSAGE_MAP_EX() | 307 IPC_END_MESSAGE_MAP_EX() |
307 | 308 |
308 if (!message_is_ok) { | 309 if (!message_is_ok) { |
309 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); | 310 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); |
310 GetRenderProcessHost()->ReceivedBadMessage(); | 311 GetRenderProcessHost()->ReceivedBadMessage(); |
311 } | 312 } |
312 | 313 |
313 return handled; | 314 return handled; |
314 } | 315 } |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 | 1129 |
1129 void TabContents::OnWebIntentDispatch(const IPC::Message& message, | 1130 void TabContents::OnWebIntentDispatch(const IPC::Message& message, |
1130 const string16& action, | 1131 const string16& action, |
1131 const string16& type, | 1132 const string16& type, |
1132 const string16& data, | 1133 const string16& data, |
1133 int intent_id) { | 1134 int intent_id) { |
1134 delegate()->WebIntentDispatch(this, message.routing_id(), action, type, | 1135 delegate()->WebIntentDispatch(this, message.routing_id(), action, type, |
1135 data, intent_id); | 1136 data, intent_id); |
1136 } | 1137 } |
1137 | 1138 |
| 1139 void TabContents::OnFindReply(int request_id, |
| 1140 int number_of_matches, |
| 1141 const gfx::Rect& selection_rect, |
| 1142 int active_match_ordinal, |
| 1143 bool final_update) { |
| 1144 delegate()->FindReply(this, request_id, number_of_matches, selection_rect, |
| 1145 active_match_ordinal, final_update); |
| 1146 } |
| 1147 |
1138 // Notifies the RenderWidgetHost instance about the fact that the page is | 1148 // Notifies the RenderWidgetHost instance about the fact that the page is |
1139 // loading, or done loading and calls the base implementation. | 1149 // loading, or done loading and calls the base implementation. |
1140 void TabContents::SetIsLoading(bool is_loading, | 1150 void TabContents::SetIsLoading(bool is_loading, |
1141 LoadNotificationDetails* details) { | 1151 LoadNotificationDetails* details) { |
1142 if (is_loading == is_loading_) | 1152 if (is_loading == is_loading_) |
1143 return; | 1153 return; |
1144 | 1154 |
1145 if (!is_loading) { | 1155 if (!is_loading) { |
1146 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); | 1156 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); |
1147 load_state_host_.clear(); | 1157 load_state_host_.clear(); |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1983 } | 1993 } |
1984 | 1994 |
1985 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 1995 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
1986 render_manager_.SwapInRenderViewHost(rvh); | 1996 render_manager_.SwapInRenderViewHost(rvh); |
1987 } | 1997 } |
1988 | 1998 |
1989 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1999 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
1990 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2000 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
1991 rwh_view->SetSize(view()->GetContainerSize()); | 2001 rwh_view->SetSize(view()->GetContainerSize()); |
1992 } | 2002 } |
OLD | NEW |