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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentLoadedInFrame, | 288 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentLoadedInFrame, |
289 OnDocumentLoadedInFrame) | 289 OnDocumentLoadedInFrame) |
290 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad) | 290 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad) |
291 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateContentRestrictions, | 291 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateContentRestrictions, |
292 OnUpdateContentRestrictions) | 292 OnUpdateContentRestrictions) |
293 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 293 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
294 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 294 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
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) |
| 299 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
| 300 OnRegisterProtocolHandler) |
| 301 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterIntentHandler, |
| 302 OnRegisterIntentHandler) |
| 303 IPC_MESSAGE_HANDLER(ViewHostMsg_WebIntentDispatch, |
| 304 OnWebIntentDispatch) |
298 IPC_MESSAGE_UNHANDLED(handled = false) | 305 IPC_MESSAGE_UNHANDLED(handled = false) |
299 IPC_END_MESSAGE_MAP_EX() | 306 IPC_END_MESSAGE_MAP_EX() |
300 | 307 |
301 if (!message_is_ok) { | 308 if (!message_is_ok) { |
302 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); | 309 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RVD")); |
303 GetRenderProcessHost()->ReceivedBadMessage(); | 310 GetRenderProcessHost()->ReceivedBadMessage(); |
304 } | 311 } |
305 | 312 |
306 return handled; | 313 return handled; |
307 } | 314 } |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 1102 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
1096 Source<TabContents>(this), | 1103 Source<TabContents>(this), |
1097 Details<const bool>(&is_editable_node)); | 1104 Details<const bool>(&is_editable_node)); |
1098 } | 1105 } |
1099 | 1106 |
1100 void TabContents::OnEnumerateDirectory(int request_id, | 1107 void TabContents::OnEnumerateDirectory(int request_id, |
1101 const FilePath& path) { | 1108 const FilePath& path) { |
1102 delegate()->EnumerateDirectory(this, request_id, path); | 1109 delegate()->EnumerateDirectory(this, request_id, path); |
1103 } | 1110 } |
1104 | 1111 |
| 1112 void TabContents::OnJSOutOfMemory() { |
| 1113 delegate()->JSOutOfMemory(this); |
| 1114 } |
| 1115 |
| 1116 void TabContents::OnRegisterProtocolHandler(const std::string& protocol, |
| 1117 const GURL& url, |
| 1118 const string16& title) { |
| 1119 delegate()->RegisterProtocolHandler(this, protocol, url, title); |
| 1120 } |
| 1121 |
| 1122 void TabContents::OnRegisterIntentHandler(const string16& action, |
| 1123 const string16& type, |
| 1124 const string16& href, |
| 1125 const string16& title) { |
| 1126 delegate()->RegisterIntentHandler(this, action, type, href, title); |
| 1127 } |
| 1128 |
| 1129 void TabContents::OnWebIntentDispatch(const IPC::Message& message, |
| 1130 const string16& action, |
| 1131 const string16& type, |
| 1132 const string16& data, |
| 1133 int intent_id) { |
| 1134 delegate()->WebIntentDispatch(this, message.routing_id(), action, type, |
| 1135 data, intent_id); |
| 1136 } |
| 1137 |
1105 // Notifies the RenderWidgetHost instance about the fact that the page is | 1138 // Notifies the RenderWidgetHost instance about the fact that the page is |
1106 // loading, or done loading and calls the base implementation. | 1139 // loading, or done loading and calls the base implementation. |
1107 void TabContents::SetIsLoading(bool is_loading, | 1140 void TabContents::SetIsLoading(bool is_loading, |
1108 LoadNotificationDetails* details) { | 1141 LoadNotificationDetails* details) { |
1109 if (is_loading == is_loading_) | 1142 if (is_loading == is_loading_) |
1110 return; | 1143 return; |
1111 | 1144 |
1112 if (!is_loading) { | 1145 if (!is_loading) { |
1113 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); | 1146 load_state_ = net::LoadStateWithParam(net::LOAD_STATE_IDLE, string16()); |
1114 load_state_host_.clear(); | 1147 load_state_host_.clear(); |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 } | 1979 } |
1947 | 1980 |
1948 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 1981 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
1949 render_manager_.SwapInRenderViewHost(rvh); | 1982 render_manager_.SwapInRenderViewHost(rvh); |
1950 } | 1983 } |
1951 | 1984 |
1952 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1985 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
1953 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1986 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
1954 rwh_view->SetSize(view()->GetContainerSize()); | 1987 rwh_view->SetSize(view()->GetContainerSize()); |
1955 } | 1988 } |
OLD | NEW |