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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 OnShowFullscreenWidget) | 878 OnShowFullscreenWidget) |
879 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) | 879 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) |
880 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | 880 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) |
881 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone) | 881 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone) |
882 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateState, OnUpdateState) | 882 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateState, OnUpdateState) |
883 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnUpdateTargetURL) | 883 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateTargetURL, OnUpdateTargetURL) |
884 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 884 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
885 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 885 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
886 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, | 886 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, |
887 OnDocumentAvailableInMainFrame) | 887 OnDocumentAvailableInMainFrame) |
888 IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen, OnToggleFullscreen) | |
889 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, | 888 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, |
890 OnDidContentsPreferredSizeChange) | 889 OnDidContentsPreferredSizeChange) |
891 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, | 890 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, |
892 OnRouteCloseEvent) | 891 OnRouteCloseEvent) |
893 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) | 892 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnRouteMessageEvent) |
894 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) | 893 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnStartDragging) |
895 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 894 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
896 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) | 895 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) |
897 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 896 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
898 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | 897 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 if (!uses_temporary_zoom_level) | 1106 if (!uses_temporary_zoom_level) |
1108 return; | 1107 return; |
1109 | 1108 |
1110 HostZoomMapImpl* host_zoom_map = | 1109 HostZoomMapImpl* host_zoom_map = |
1111 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); | 1110 static_cast<HostZoomMapImpl*>(HostZoomMap::Get(GetSiteInstance())); |
1112 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), | 1111 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), |
1113 GetRoutingID(), | 1112 GetRoutingID(), |
1114 host_zoom_map->GetDefaultZoomLevel()); | 1113 host_zoom_map->GetDefaultZoomLevel()); |
1115 } | 1114 } |
1116 | 1115 |
1117 void RenderViewHostImpl::OnToggleFullscreen(bool enter_fullscreen) { | |
1118 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
1119 delegate_->ToggleFullscreenMode(enter_fullscreen); | |
1120 // We need to notify the contents that its fullscreen state has changed. This | |
1121 // is done as part of the resize message. | |
1122 WasResized(); | |
1123 } | |
1124 | |
1125 void RenderViewHostImpl::OnDidContentsPreferredSizeChange( | 1116 void RenderViewHostImpl::OnDidContentsPreferredSizeChange( |
1126 const gfx::Size& new_size) { | 1117 const gfx::Size& new_size) { |
1127 delegate_->UpdatePreferredSize(new_size); | 1118 delegate_->UpdatePreferredSize(new_size); |
1128 } | 1119 } |
1129 | 1120 |
1130 void RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) { | 1121 void RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) { |
1131 delegate_->ResizeDueToAutoResize(new_size); | 1122 delegate_->ResizeDueToAutoResize(new_size); |
1132 } | 1123 } |
1133 | 1124 |
1134 void RenderViewHostImpl::OnRouteCloseEvent() { | 1125 void RenderViewHostImpl::OnRouteCloseEvent() { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 | 1322 |
1332 void RenderViewHostImpl::OnTextSurroundingSelectionResponse( | 1323 void RenderViewHostImpl::OnTextSurroundingSelectionResponse( |
1333 const base::string16& content, | 1324 const base::string16& content, |
1334 size_t start_offset, | 1325 size_t start_offset, |
1335 size_t end_offset) { | 1326 size_t end_offset) { |
1336 if (!view_) | 1327 if (!view_) |
1337 return; | 1328 return; |
1338 view_->OnTextSurroundingSelectionResponse(content, start_offset, end_offset); | 1329 view_->OnTextSurroundingSelectionResponse(content, start_offset, end_offset); |
1339 } | 1330 } |
1340 | 1331 |
1341 void RenderViewHostImpl::ExitFullscreen() { | |
1342 RejectMouseLockOrUnlockIfNecessary(); | |
1343 // Notify delegate_ and renderer of fullscreen state change. | |
1344 OnToggleFullscreen(false); | |
1345 } | |
1346 | |
1347 WebPreferences RenderViewHostImpl::GetWebkitPreferences() { | 1332 WebPreferences RenderViewHostImpl::GetWebkitPreferences() { |
1348 if (!web_preferences_.get()) { | 1333 if (!web_preferences_.get()) { |
1349 OnWebkitPreferencesChanged(); | 1334 OnWebkitPreferencesChanged(); |
1350 } | 1335 } |
1351 return *web_preferences_; | 1336 return *web_preferences_; |
1352 } | 1337 } |
1353 | 1338 |
1354 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { | 1339 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { |
1355 web_preferences_.reset(new WebPreferences(prefs)); | 1340 web_preferences_.reset(new WebPreferences(prefs)); |
1356 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); | 1341 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1471 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1487 | 1472 |
1488 frame_tree->ResetForMainFrameSwap(); | 1473 frame_tree->ResetForMainFrameSwap(); |
1489 } | 1474 } |
1490 | 1475 |
1491 void RenderViewHostImpl::SelectWordAroundCaret() { | 1476 void RenderViewHostImpl::SelectWordAroundCaret() { |
1492 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1477 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1493 } | 1478 } |
1494 | 1479 |
1495 } // namespace content | 1480 } // namespace content |
OLD | NEW |