| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 OnDidDisplayInsecureContent) | 308 OnDidDisplayInsecureContent) |
| 309 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, | 309 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, |
| 310 OnDidRunInsecureContent) | 310 OnDidRunInsecureContent) |
| 311 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentLoadedInFrame, | 311 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentLoadedInFrame, |
| 312 OnDocumentLoadedInFrame) | 312 OnDocumentLoadedInFrame) |
| 313 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad) | 313 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad) |
| 314 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateContentRestrictions, | 314 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateContentRestrictions, |
| 315 OnUpdateContentRestrictions) | 315 OnUpdateContentRestrictions) |
| 316 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 316 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
| 317 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 317 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
| 318 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | |
| 319 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL) | 318 IPC_MESSAGE_HANDLER(ViewHostMsg_SaveURLAs, OnSaveURL) |
| 320 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 319 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
| 321 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) | 320 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) |
| 322 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, | 321 IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler, |
| 323 OnRegisterProtocolHandler) | 322 OnRegisterProtocolHandler) |
| 324 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) | 323 IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply) |
| 325 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) | 324 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin) |
| 326 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) | 325 IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed) |
| 327 IPC_MESSAGE_UNHANDLED(handled = false) | 326 IPC_MESSAGE_UNHANDLED(handled = false) |
| 328 IPC_END_MESSAGE_MAP_EX() | 327 IPC_END_MESSAGE_MAP_EX() |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 } | 1144 } |
| 1146 | 1145 |
| 1147 void TabContents::OnUpdateZoomLimits(int minimum_percent, | 1146 void TabContents::OnUpdateZoomLimits(int minimum_percent, |
| 1148 int maximum_percent, | 1147 int maximum_percent, |
| 1149 bool remember) { | 1148 bool remember) { |
| 1150 minimum_zoom_percent_ = minimum_percent; | 1149 minimum_zoom_percent_ = minimum_percent; |
| 1151 maximum_zoom_percent_ = maximum_percent; | 1150 maximum_zoom_percent_ = maximum_percent; |
| 1152 temporary_zoom_settings_ = !remember; | 1151 temporary_zoom_settings_ = !remember; |
| 1153 } | 1152 } |
| 1154 | 1153 |
| 1155 void TabContents::OnFocusedNodeChanged(bool is_editable_node) { | |
| 1156 content::NotificationService::current()->Notify( | |
| 1157 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | |
| 1158 content::Source<TabContents>(this), | |
| 1159 content::Details<const bool>(&is_editable_node)); | |
| 1160 } | |
| 1161 | |
| 1162 void TabContents::OnEnumerateDirectory(int request_id, | 1154 void TabContents::OnEnumerateDirectory(int request_id, |
| 1163 const FilePath& path) { | 1155 const FilePath& path) { |
| 1164 delegate()->EnumerateDirectory(this, request_id, path); | 1156 delegate()->EnumerateDirectory(this, request_id, path); |
| 1165 } | 1157 } |
| 1166 | 1158 |
| 1167 void TabContents::OnJSOutOfMemory() { | 1159 void TabContents::OnJSOutOfMemory() { |
| 1168 delegate()->JSOutOfMemory(this); | 1160 delegate()->JSOutOfMemory(this); |
| 1169 } | 1161 } |
| 1170 | 1162 |
| 1171 void TabContents::OnRegisterProtocolHandler(const std::string& protocol, | 1163 void TabContents::OnRegisterProtocolHandler(const std::string& protocol, |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2069 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2078 // Can be NULL during tests. | 2070 // Can be NULL during tests. |
| 2079 if (rwh_view) | 2071 if (rwh_view) |
| 2080 rwh_view->SetSize(view()->GetContainerSize()); | 2072 rwh_view->SetSize(view()->GetContainerSize()); |
| 2081 } | 2073 } |
| 2082 | 2074 |
| 2083 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { | 2075 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { |
| 2084 return render_view_host() ? | 2076 return render_view_host() ? |
| 2085 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; | 2077 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; |
| 2086 } | 2078 } |
| OLD | NEW |