OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 OnShowFullscreenWidget) | 886 OnShowFullscreenWidget) |
887 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) | 887 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) |
888 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | 888 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) |
889 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone) | 889 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone) |
890 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateState, OnUpdateState) | 890 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateState, OnUpdateState) |
891 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnUpdateTargetURL) | 891 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnUpdateTargetURL) |
892 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 892 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
893 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 893 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
894 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, | 894 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, |
895 OnDocumentAvailableInMainFrame) | 895 OnDocumentAvailableInMainFrame) |
896 IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen, OnToggleFullscreen) | |
897 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, | 896 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, |
898 OnDidContentsPreferredSizeChange) | 897 OnDidContentsPreferredSizeChange) |
899 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, | 898 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, |
900 OnRouteCloseEvent) | 899 OnRouteCloseEvent) |
901 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) | 900 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) |
902 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) | 901 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) |
903 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 902 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
904 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) | 903 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) |
905 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 904 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
906 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | 905 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 if (!uses_temporary_zoom_level) | 1114 if (!uses_temporary_zoom_level) |
1116 return; | 1115 return; |
1117 | 1116 |
1118 HostZoomMapImpl* host_zoom_map = | 1117 HostZoomMapImpl* host_zoom_map = |
1119 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); | 1118 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); |
1120 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), | 1119 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), |
1121 GetRoutingID(), | 1120 GetRoutingID(), |
1122 host_zoom_map->GetDefaultZoomLevel()); | 1121 host_zoom_map->GetDefaultZoomLevel()); |
1123 } | 1122 } |
1124 | 1123 |
1125 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { | |
1126 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
1127 delegate_->ToggleFullscreenMode(enter_fullscreen); | |
1128 // We need to notify the contents that its fullscreen state has changed. This | |
1129 // is done as part of the resize message. | |
1130 WasResized(); | |
1131 } | |
1132 | |
1133 void RenderViewHostImpl::OnDidContentsPreferredSizeChange( | 1124 void RenderViewHostImpl::OnDidContentsPreferredSizeChange( |
1134 const gfx::Size& new_size) { | 1125 const gfx::Size& new_size) { |
1135 delegate_->UpdatePreferredSize(new_size); | 1126 delegate_->UpdatePreferredSize(new_size); |
1136 } | 1127 } |
1137 | 1128 |
1138 void RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) { | 1129 void RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) { |
1139 delegate_->ResizeDueToAutoResize(new_size); | 1130 delegate_->ResizeDueToAutoResize(new_size); |
1140 } | 1131 } |
1141 | 1132 |
1142 void RenderViewHostImpl::OnRouteCloseEvent() { | 1133 void RenderViewHostImpl::OnRouteCloseEvent() { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 | 1320 |
1330 void RenderViewHostImpl::OnTextSurroundingSelectionResponse( | 1321 void RenderViewHostImpl::OnTextSurroundingSelectionResponse( |
1331 const base::string16& content, | 1322 const base::string16& content, |
1332 size_t start_offset, | 1323 size_t start_offset, |
1333 size_t end_offset) { | 1324 size_t end_offset) { |
1334 if (!view_) | 1325 if (!view_) |
1335 return; | 1326 return; |
1336 view_->OnTextSurroundingSelectionResponse(content, start_offset, end_offset); | 1327 view_->OnTextSurroundingSelectionResponse(content, start_offset, end_offset); |
1337 } | 1328 } |
1338 | 1329 |
1339 void RenderViewHostImpl::ExitFullscreen() { | |
1340 RejectMouseLockOrUnlockIfNecessary(); | |
1341 // Notify delegate_ and renderer of fullscreen state change. | |
1342 OnToggleFullscreen(false); | |
1343 } | |
1344 | |
1345 WebPreferences RenderViewHostImpl::GetWebkitPreferences() { | 1330 WebPreferences RenderViewHostImpl::GetWebkitPreferences() { |
1346 if (!web_preferences_.get()) { | 1331 if (!web_preferences_.get()) { |
1347 OnWebkitPreferencesChanged(); | 1332 OnWebkitPreferencesChanged(); |
1348 } | 1333 } |
1349 return *web_preferences_; | 1334 return *web_preferences_; |
1350 } | 1335 } |
1351 | 1336 |
1352 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { | 1337 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { |
1353 web_preferences_.reset(new WebPreferences(prefs)); | 1338 web_preferences_.reset(new WebPreferences(prefs)); |
1354 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); | 1339 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1469 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1485 | 1470 |
1486 frame_tree->ResetForMainFrameSwap(); | 1471 frame_tree->ResetForMainFrameSwap(); |
1487 } | 1472 } |
1488 | 1473 |
1489 void RenderViewHostImpl::SelectWordAroundCaret() { | 1474 void RenderViewHostImpl::SelectWordAroundCaret() { |
1490 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1475 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1491 } | 1476 } |
1492 | 1477 |
1493 } // namespace content | 1478 } // namespace content |
OLD | NEW |