| 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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 | 1217 |
| 1218 void RenderWidgetHostImpl::AddKeyboardListener(KeyboardListener* listener) { | 1218 void RenderWidgetHostImpl::AddKeyboardListener(KeyboardListener* listener) { |
| 1219 keyboard_listeners_.push_back(listener); | 1219 keyboard_listeners_.push_back(listener); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 void RenderWidgetHostImpl::RemoveKeyboardListener( | 1222 void RenderWidgetHostImpl::RemoveKeyboardListener( |
| 1223 KeyboardListener* listener) { | 1223 KeyboardListener* listener) { |
| 1224 keyboard_listeners_.remove(listener); | 1224 keyboard_listeners_.remove(listener); |
| 1225 } | 1225 } |
| 1226 | 1226 |
| 1227 void RenderWidgetHostImpl::GetWebScreenInfo(WebKit::WebScreenInfo* result) { |
| 1228 if (GetView()) |
| 1229 static_cast<RenderWidgetHostViewPort*>(GetView())->GetScreenInfo(result); |
| 1230 else |
| 1231 RenderWidgetHostViewPort::GetDefaultScreenInfo(result); |
| 1232 } |
| 1233 |
| 1227 void RenderWidgetHostImpl::NotifyScreenInfoChanged() { | 1234 void RenderWidgetHostImpl::NotifyScreenInfoChanged() { |
| 1228 WebKit::WebScreenInfo screen_info; | 1235 WebKit::WebScreenInfo screen_info; |
| 1229 GetWebScreenInfo(&screen_info); | 1236 GetWebScreenInfo(&screen_info); |
| 1230 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); | 1237 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); |
| 1231 } | 1238 } |
| 1232 | 1239 |
| 1233 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, | 1240 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, |
| 1234 base::TimeDelta interval) { | 1241 base::TimeDelta interval) { |
| 1235 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); | 1242 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); |
| 1236 } | 1243 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 | 1384 |
| 1378 void RenderWidgetHostImpl::SetShouldAutoResize(bool enable) { | 1385 void RenderWidgetHostImpl::SetShouldAutoResize(bool enable) { |
| 1379 should_auto_resize_ = enable; | 1386 should_auto_resize_ = enable; |
| 1380 } | 1387 } |
| 1381 | 1388 |
| 1382 bool RenderWidgetHostImpl::IsInOverscrollGesture() const { | 1389 bool RenderWidgetHostImpl::IsInOverscrollGesture() const { |
| 1383 return overscroll_controller_.get() && | 1390 return overscroll_controller_.get() && |
| 1384 overscroll_controller_->overscroll_mode() != OVERSCROLL_NONE; | 1391 overscroll_controller_->overscroll_mode() != OVERSCROLL_NONE; |
| 1385 } | 1392 } |
| 1386 | 1393 |
| 1387 void RenderWidgetHostImpl::GetWebScreenInfo(WebKit::WebScreenInfo* result) { | |
| 1388 if (GetView()) { | |
| 1389 static_cast<RenderWidgetHostViewPort*>(GetView())->GetScreenInfo(result); | |
| 1390 } else { | |
| 1391 RenderWidgetHostViewPort::GetDefaultScreenInfo(result); | |
| 1392 } | |
| 1393 } | |
| 1394 | |
| 1395 void RenderWidgetHostImpl::Destroy() { | 1394 void RenderWidgetHostImpl::Destroy() { |
| 1396 NotificationService::current()->Notify( | 1395 NotificationService::current()->Notify( |
| 1397 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, | 1396 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, |
| 1398 Source<RenderWidgetHost>(this), | 1397 Source<RenderWidgetHost>(this), |
| 1399 NotificationService::NoDetails()); | 1398 NotificationService::NoDetails()); |
| 1400 | 1399 |
| 1401 // Tell the view to die. | 1400 // Tell the view to die. |
| 1402 // Note that in the process of the view shutting down, it can call a ton | 1401 // Note that in the process of the view shutting down, it can call a ton |
| 1403 // of other messages on us. So if you do any other deinitialization here, | 1402 // of other messages on us. So if you do any other deinitialization here, |
| 1404 // do it after this call to view_->Destroy(). | 1403 // do it after this call to view_->Destroy(). |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 return; | 2403 return; |
| 2405 | 2404 |
| 2406 OnRenderAutoResized(new_size); | 2405 OnRenderAutoResized(new_size); |
| 2407 } | 2406 } |
| 2408 | 2407 |
| 2409 void RenderWidgetHostImpl::DetachDelegate() { | 2408 void RenderWidgetHostImpl::DetachDelegate() { |
| 2410 delegate_ = NULL; | 2409 delegate_ = NULL; |
| 2411 } | 2410 } |
| 2412 | 2411 |
| 2413 } // namespace content | 2412 } // namespace content |
| OLD | NEW |