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