| 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 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if (view) { | 334 if (view) { |
| 335 view_ = view->GetWeakPtr(); | 335 view_ = view->GetWeakPtr(); |
| 336 // Views start out not needing begin frames, so only update its state | 336 // Views start out not needing begin frames, so only update its state |
| 337 // if the value has changed. | 337 // if the value has changed. |
| 338 if (needs_begin_frames_) | 338 if (needs_begin_frames_) |
| 339 view_->SetNeedsBeginFrames(needs_begin_frames_); | 339 view_->SetNeedsBeginFrames(needs_begin_frames_); |
| 340 } else { | 340 } else { |
| 341 view_.reset(); | 341 view_.reset(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 // If the renderer has not yet been initialized, then the surface ID | |
| 345 // namespace will be sent during initialization. | |
| 346 if (view_ && renderer_initialized_) { | |
| 347 Send(new ViewMsg_SetFrameSinkId(routing_id_, view_->GetFrameSinkId())); | |
| 348 } | |
| 349 | |
| 350 synthetic_gesture_controller_.reset(); | 344 synthetic_gesture_controller_.reset(); |
| 351 } | 345 } |
| 352 | 346 |
| 353 RenderProcessHost* RenderWidgetHostImpl::GetProcess() const { | 347 RenderProcessHost* RenderWidgetHostImpl::GetProcess() const { |
| 354 return process_; | 348 return process_; |
| 355 } | 349 } |
| 356 | 350 |
| 357 int RenderWidgetHostImpl::GetRoutingID() const { | 351 int RenderWidgetHostImpl::GetRoutingID() const { |
| 358 return routing_id_; | 352 return routing_id_; |
| 359 } | 353 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 void RenderWidgetHostImpl::SetNeedsFlush() { | 400 void RenderWidgetHostImpl::SetNeedsFlush() { |
| 407 if (view_) | 401 if (view_) |
| 408 view_->OnSetNeedsFlushInput(); | 402 view_->OnSetNeedsFlushInput(); |
| 409 } | 403 } |
| 410 | 404 |
| 411 void RenderWidgetHostImpl::Init() { | 405 void RenderWidgetHostImpl::Init() { |
| 412 DCHECK(process_->HasConnection()); | 406 DCHECK(process_->HasConnection()); |
| 413 | 407 |
| 414 renderer_initialized_ = true; | 408 renderer_initialized_ = true; |
| 415 | 409 |
| 416 // If the RWHV has not yet been set, the surface ID namespace will get | |
| 417 // passed down by the call to SetView(). | |
| 418 if (view_) { | |
| 419 Send(new ViewMsg_SetFrameSinkId(routing_id_, view_->GetFrameSinkId())); | |
| 420 } | |
| 421 | |
| 422 SendScreenRects(); | 410 SendScreenRects(); |
| 423 WasResized(); | 411 WasResized(); |
| 424 | 412 |
| 425 if (owner_delegate_) | 413 if (owner_delegate_) |
| 426 owner_delegate_->RenderWidgetDidInit(); | 414 owner_delegate_->RenderWidgetDidInit(); |
| 427 } | 415 } |
| 428 | 416 |
| 429 void RenderWidgetHostImpl::InitForFrame() { | 417 void RenderWidgetHostImpl::InitForFrame() { |
| 430 DCHECK(process_->HasConnection()); | 418 DCHECK(process_->HasConnection()); |
| 431 renderer_initialized_ = true; | 419 renderer_initialized_ = true; |
| (...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2215 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2203 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
| 2216 } | 2204 } |
| 2217 | 2205 |
| 2218 BrowserAccessibilityManager* | 2206 BrowserAccessibilityManager* |
| 2219 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2207 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
| 2220 return delegate_ ? | 2208 return delegate_ ? |
| 2221 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2209 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
| 2222 } | 2210 } |
| 2223 | 2211 |
| 2224 } // namespace content | 2212 } // namespace content |
| OLD | NEW |