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