Chromium Code Reviews| 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1204 | 1204 |
| 1205 void RenderWidgetHostImpl::AddKeyboardListener(KeyboardListener* listener) { | 1205 void RenderWidgetHostImpl::AddKeyboardListener(KeyboardListener* listener) { |
| 1206 keyboard_listeners_.push_back(listener); | 1206 keyboard_listeners_.push_back(listener); |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 void RenderWidgetHostImpl::RemoveKeyboardListener( | 1209 void RenderWidgetHostImpl::RemoveKeyboardListener( |
| 1210 KeyboardListener* listener) { | 1210 KeyboardListener* listener) { |
| 1211 keyboard_listeners_.remove(listener); | 1211 keyboard_listeners_.remove(listener); |
| 1212 } | 1212 } |
| 1213 | 1213 |
| 1214 void RenderWidgetHostImpl::GetWebScreenInfo(WebKit::WebScreenInfo* result) { | |
| 1215 if (GetView()) { | |
|
Evan Stade
2013/02/07 01:34:53
no curlies
Ilya Sherman
2013/02/07 01:58:29
Done.
| |
| 1216 static_cast<RenderWidgetHostViewPort*>(GetView())->GetScreenInfo(result); | |
| 1217 } else { | |
| 1218 RenderWidgetHostViewPort::GetDefaultScreenInfo(result); | |
| 1219 } | |
| 1220 } | |
| 1221 | |
| 1214 void RenderWidgetHostImpl::NotifyScreenInfoChanged() { | 1222 void RenderWidgetHostImpl::NotifyScreenInfoChanged() { |
| 1215 WebKit::WebScreenInfo screen_info; | 1223 WebKit::WebScreenInfo screen_info; |
| 1216 GetWebScreenInfo(&screen_info); | 1224 GetWebScreenInfo(&screen_info); |
| 1217 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); | 1225 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); |
| 1218 } | 1226 } |
| 1219 | 1227 |
| 1220 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, | 1228 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, |
| 1221 base::TimeDelta interval) { | 1229 base::TimeDelta interval) { |
| 1222 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); | 1230 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); |
| 1223 } | 1231 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1368 | 1376 |
| 1369 void RenderWidgetHostImpl::InitializeOverscrollController() { | 1377 void RenderWidgetHostImpl::InitializeOverscrollController() { |
| 1370 overscroll_controller_.reset(new OverscrollController(this)); | 1378 overscroll_controller_.reset(new OverscrollController(this)); |
| 1371 } | 1379 } |
| 1372 | 1380 |
| 1373 bool RenderWidgetHostImpl::IsInOverscrollGesture() const { | 1381 bool RenderWidgetHostImpl::IsInOverscrollGesture() const { |
| 1374 return overscroll_controller_.get() && | 1382 return overscroll_controller_.get() && |
| 1375 overscroll_controller_->overscroll_mode() != OVERSCROLL_NONE; | 1383 overscroll_controller_->overscroll_mode() != OVERSCROLL_NONE; |
| 1376 } | 1384 } |
| 1377 | 1385 |
| 1378 void RenderWidgetHostImpl::GetWebScreenInfo(WebKit::WebScreenInfo* result) { | |
| 1379 if (GetView()) { | |
| 1380 static_cast<RenderWidgetHostViewPort*>(GetView())->GetScreenInfo(result); | |
| 1381 } else { | |
| 1382 RenderWidgetHostViewPort::GetDefaultScreenInfo(result); | |
| 1383 } | |
| 1384 } | |
| 1385 | |
| 1386 void RenderWidgetHostImpl::Destroy() { | 1386 void RenderWidgetHostImpl::Destroy() { |
| 1387 NotificationService::current()->Notify( | 1387 NotificationService::current()->Notify( |
| 1388 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, | 1388 NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, |
| 1389 Source<RenderWidgetHost>(this), | 1389 Source<RenderWidgetHost>(this), |
| 1390 NotificationService::NoDetails()); | 1390 NotificationService::NoDetails()); |
| 1391 | 1391 |
| 1392 // Tell the view to die. | 1392 // Tell the view to die. |
| 1393 // Note that in the process of the view shutting down, it can call a ton | 1393 // Note that in the process of the view shutting down, it can call a ton |
| 1394 // of other messages on us. So if you do any other deinitialization here, | 1394 // of other messages on us. So if you do any other deinitialization here, |
| 1395 // do it after this call to view_->Destroy(). | 1395 // do it after this call to view_->Destroy(). |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2391 return; | 2391 return; |
| 2392 | 2392 |
| 2393 OnRenderAutoResized(new_size); | 2393 OnRenderAutoResized(new_size); |
| 2394 } | 2394 } |
| 2395 | 2395 |
| 2396 void RenderWidgetHostImpl::DetachDelegate() { | 2396 void RenderWidgetHostImpl::DetachDelegate() { |
| 2397 delegate_ = NULL; | 2397 delegate_ = NULL; |
| 2398 } | 2398 } |
| 2399 | 2399 |
| 2400 } // namespace content | 2400 } // namespace content |
| OLD | NEW |