| 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), | 1123 host_zoom_map->SetTemporaryZoomLevel(GetProcess()->GetID(), |
| 1124 GetRoutingID(), | 1124 GetRoutingID(), |
| 1125 host_zoom_map->GetDefaultZoomLevel()); | 1125 host_zoom_map->GetDefaultZoomLevel()); |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 void RenderViewHostImpl::OnDidContentsPreferredSizeChange( | 1128 void RenderViewHostImpl::OnDidContentsPreferredSizeChange( |
| 1129 const gfx::Size& new_size) { | 1129 const gfx::Size& new_size) { |
| 1130 delegate_->UpdatePreferredSize(new_size); | 1130 delegate_->UpdatePreferredSize(new_size); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 void RenderViewHostImpl::OnRenderAutoResized(const gfx::Size& new_size) { | |
| 1134 delegate_->ResizeDueToAutoResize(new_size); | |
| 1135 } | |
| 1136 | |
| 1137 void RenderViewHostImpl::OnRouteCloseEvent() { | 1133 void RenderViewHostImpl::OnRouteCloseEvent() { |
| 1138 // Have the delegate route this to the active RenderViewHost. | 1134 // Have the delegate route this to the active RenderViewHost. |
| 1139 delegate_->RouteCloseEvent(this); | 1135 delegate_->RouteCloseEvent(this); |
| 1140 } | 1136 } |
| 1141 | 1137 |
| 1142 void RenderViewHostImpl::OnStartDragging( | 1138 void RenderViewHostImpl::OnStartDragging( |
| 1143 const DropData& drop_data, | 1139 const DropData& drop_data, |
| 1144 WebDragOperationsMask drag_operations_mask, | 1140 WebDragOperationsMask drag_operations_mask, |
| 1145 const SkBitmap& bitmap, | 1141 const SkBitmap& bitmap, |
| 1146 const gfx::Vector2d& bitmap_offset_in_dip, | 1142 const gfx::Vector2d& bitmap_offset_in_dip, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 origin.Offset(view_bounds_in_screen.x(), view_bounds_in_screen.y()); | 1224 origin.Offset(view_bounds_in_screen.x(), view_bounds_in_screen.y()); |
| 1229 gfx::Rect node_bounds_in_screen(origin.x(), origin.y(), | 1225 gfx::Rect node_bounds_in_screen(origin.x(), origin.y(), |
| 1230 node_bounds_in_viewport.width(), | 1226 node_bounds_in_viewport.width(), |
| 1231 node_bounds_in_viewport.height()); | 1227 node_bounds_in_viewport.height()); |
| 1232 FocusedNodeDetails details = {is_editable_node, node_bounds_in_screen}; | 1228 FocusedNodeDetails details = {is_editable_node, node_bounds_in_screen}; |
| 1233 NotificationService::current()->Notify(NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 1229 NotificationService::current()->Notify(NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 1234 Source<RenderViewHost>(this), | 1230 Source<RenderViewHost>(this), |
| 1235 Details<FocusedNodeDetails>(&details)); | 1231 Details<FocusedNodeDetails>(&details)); |
| 1236 } | 1232 } |
| 1237 | 1233 |
| 1238 void RenderViewHostImpl::OnUserGesture() { | |
| 1239 delegate_->OnUserGesture(); | |
| 1240 } | |
| 1241 | |
| 1242 void RenderViewHostImpl::OnClosePageACK() { | 1234 void RenderViewHostImpl::OnClosePageACK() { |
| 1243 GetWidget()->decrement_in_flight_event_count(); | 1235 GetWidget()->decrement_in_flight_event_count(); |
| 1244 ClosePageIgnoringUnloadEvents(); | 1236 ClosePageIgnoringUnloadEvents(); |
| 1245 } | 1237 } |
| 1246 | 1238 |
| 1247 void RenderViewHostImpl::NotifyRendererUnresponsive() { | |
| 1248 delegate_->RendererUnresponsive(this); | |
| 1249 } | |
| 1250 | |
| 1251 void RenderViewHostImpl::NotifyRendererResponsive() { | |
| 1252 delegate_->RendererResponsive(this); | |
| 1253 } | |
| 1254 | |
| 1255 void RenderViewHostImpl::RequestToLockMouse(bool user_gesture, | |
| 1256 bool last_unlocked_by_target) { | |
| 1257 delegate_->RequestToLockMouse(user_gesture, last_unlocked_by_target); | |
| 1258 } | |
| 1259 | |
| 1260 bool RenderViewHostImpl::IsFullscreenGranted() const { | 1239 bool RenderViewHostImpl::IsFullscreenGranted() const { |
| 1261 return delegate_->IsFullscreenForCurrentTab(); | 1240 return delegate_->IsFullscreenForCurrentTab(); |
| 1262 } | 1241 } |
| 1263 | 1242 |
| 1264 blink::WebDisplayMode RenderViewHostImpl::GetDisplayMode() const { | 1243 blink::WebDisplayMode RenderViewHostImpl::GetDisplayMode() const { |
| 1265 return delegate_->GetDisplayMode(); | 1244 return delegate_->GetDisplayMode(); |
| 1266 } | 1245 } |
| 1267 | 1246 |
| 1268 void RenderViewHostImpl::OnFocus() { | 1247 void RenderViewHostImpl::OnFocus() { |
| 1269 // Note: We allow focus and blur from swapped out RenderViewHosts, even when | 1248 // Note: We allow focus and blur from swapped out RenderViewHosts, even when |
| 1270 // the active RenderViewHost is in a different BrowsingInstance (e.g., WebUI). | 1249 // the active RenderViewHost is in a different BrowsingInstance (e.g., WebUI). |
| 1271 delegate_->Activate(); | 1250 delegate_->Activate(); |
| 1272 } | 1251 } |
| 1273 | 1252 |
| 1274 gfx::Rect RenderViewHostImpl::GetRootWindowResizerRect() const { | |
| 1275 return delegate_->GetRootWindowResizerRect(); | |
| 1276 } | |
| 1277 | |
| 1278 void RenderViewHostImpl::ForwardMouseEvent( | 1253 void RenderViewHostImpl::ForwardMouseEvent( |
| 1279 const blink::WebMouseEvent& mouse_event) { | 1254 const blink::WebMouseEvent& mouse_event) { |
| 1280 RenderWidgetHostImpl::ForwardMouseEvent(mouse_event); | 1255 RenderWidgetHostImpl::ForwardMouseEvent(mouse_event); |
| 1281 if (mouse_event.type == WebInputEvent::MouseWheel && | 1256 if (mouse_event.type == WebInputEvent::MouseWheel && |
| 1282 GetWidget()->ignore_input_events()) { | 1257 GetWidget()->ignore_input_events()) { |
| 1283 delegate_->OnIgnoredUIEvent(); | 1258 delegate_->OnIgnoredUIEvent(); |
| 1284 } | 1259 } |
| 1285 } | 1260 } |
| 1286 | 1261 |
| 1287 void RenderViewHostImpl::ForwardKeyboardEvent( | 1262 void RenderViewHostImpl::ForwardKeyboardEvent( |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 } else { | 1446 } else { |
| 1472 render_view_ready_on_process_launch_ = true; | 1447 render_view_ready_on_process_launch_ = true; |
| 1473 } | 1448 } |
| 1474 } | 1449 } |
| 1475 | 1450 |
| 1476 void RenderViewHostImpl::RenderViewReady() { | 1451 void RenderViewHostImpl::RenderViewReady() { |
| 1477 delegate_->RenderViewReady(this); | 1452 delegate_->RenderViewReady(this); |
| 1478 } | 1453 } |
| 1479 | 1454 |
| 1480 } // namespace content | 1455 } // namespace content |
| OLD | NEW |