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