| 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_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 } | 1247 } |
| 1248 | 1248 |
| 1249 void RenderWidgetHostImpl::RemoveKeyboardListener( | 1249 void RenderWidgetHostImpl::RemoveKeyboardListener( |
| 1250 KeyboardListener* listener) { | 1250 KeyboardListener* listener) { |
| 1251 // Ensure that the element is actually in the list. | 1251 // Ensure that the element is actually in the list. |
| 1252 DCHECK(std::find(keyboard_listeners_.begin(), keyboard_listeners_.end(), | 1252 DCHECK(std::find(keyboard_listeners_.begin(), keyboard_listeners_.end(), |
| 1253 listener) != keyboard_listeners_.end()); | 1253 listener) != keyboard_listeners_.end()); |
| 1254 keyboard_listeners_.remove(listener); | 1254 keyboard_listeners_.remove(listener); |
| 1255 } | 1255 } |
| 1256 | 1256 |
| 1257 void RenderWidgetHostImpl::GetWebScreenInfo(WebKit::WebScreenInfo* result) { |
| 1258 if (GetView()) |
| 1259 static_cast<RenderWidgetHostViewPort*>(GetView())->GetScreenInfo(result); |
| 1260 else |
| 1261 RenderWidgetHostViewPort::GetDefaultScreenInfo(result); |
| 1262 } |
| 1263 |
| 1257 void RenderWidgetHostImpl::NotifyScreenInfoChanged() { | 1264 void RenderWidgetHostImpl::NotifyScreenInfoChanged() { |
| 1258 WebKit::WebScreenInfo screen_info; | 1265 WebKit::WebScreenInfo screen_info; |
| 1259 GetWebScreenInfo(&screen_info); | 1266 GetWebScreenInfo(&screen_info); |
| 1260 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); | 1267 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); |
| 1261 } | 1268 } |
| 1262 | 1269 |
| 1263 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, | 1270 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, |
| 1264 base::TimeDelta interval) { | 1271 base::TimeDelta interval) { |
| 1265 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); | 1272 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); |
| 1266 } | 1273 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 | 1414 |
| 1408 void RenderWidgetHostImpl::SetShouldAutoResize(bool enable) { | 1415 void RenderWidgetHostImpl::SetShouldAutoResize(bool enable) { |
| 1409 should_auto_resize_ = enable; | 1416 should_auto_resize_ = enable; |
| 1410 } | 1417 } |
| 1411 | 1418 |
| 1412 bool RenderWidgetHostImpl::IsInOverscrollGesture() const { | 1419 bool RenderWidgetHostImpl::IsInOverscrollGesture() const { |
| 1413 return overscroll_controller_.get() && | 1420 return overscroll_controller_.get() && |
| 1414 overscroll_controller_->overscroll_mode() != OVERSCROLL_NONE; | 1421 overscroll_controller_->overscroll_mode() != OVERSCROLL_NONE; |
| 1415 } | 1422 } |
| 1416 | 1423 |
| 1417 void RenderWidgetHostImpl::GetWebScreenInfo(WebKit::WebScreenInfo* result) { | |
| 1418 if (GetView()) { | |
| 1419 static_cast<RenderWidgetHostViewPort*>(GetView())->GetScreenInfo(result); | |
| 1420 } else { | |
| 1421 RenderWidgetHostViewPort::GetDefaultScreenInfo(result); | |
| 1422 } | |
| 1423 } | |
| 1424 | |
| 1425 void RenderWidgetHostImpl::Destroy() { | 1424 void RenderWidgetHostImpl::Destroy() { |
| 1426 NotificationService::current()->Notify( | 1425 NotificationService::current()->Notify( |
| 1427 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, | 1426 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, |
| 1428 Source<RenderWidgetHost>(this), | 1427 Source<RenderWidgetHost>(this), |
| 1429 NotificationService::NoDetails()); | 1428 NotificationService::NoDetails()); |
| 1430 | 1429 |
| 1431 // Tell the view to die. | 1430 // Tell the view to die. |
| 1432 // Note that in the process of the view shutting down, it can call a ton | 1431 // Note that in the process of the view shutting down, it can call a ton |
| 1433 // of other messages on us. So if you do any other deinitialization here, | 1432 // of other messages on us. So if you do any other deinitialization here, |
| 1434 // do it after this call to view_->Destroy(). | 1433 // do it after this call to view_->Destroy(). |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2439 return; | 2438 return; |
| 2440 | 2439 |
| 2441 OnRenderAutoResized(new_size); | 2440 OnRenderAutoResized(new_size); |
| 2442 } | 2441 } |
| 2443 | 2442 |
| 2444 void RenderWidgetHostImpl::DetachDelegate() { | 2443 void RenderWidgetHostImpl::DetachDelegate() { |
| 2445 delegate_ = NULL; | 2444 delegate_ = NULL; |
| 2446 } | 2445 } |
| 2447 | 2446 |
| 2448 } // namespace content | 2447 } // namespace content |
| OLD | NEW |