| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() { | 419 void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() { |
| 420 // We only use callbacks once, therefore we make a new list for registration | 420 // We only use callbacks once, therefore we make a new list for registration |
| 421 // before we start, and discard the old list entries when we are done. | 421 // before we start, and discard the old list entries when we are done. |
| 422 FrameSwappedCallbackList process_callbacks; | 422 FrameSwappedCallbackList process_callbacks; |
| 423 process_callbacks.swap(frame_swapped_callbacks_); | 423 process_callbacks.swap(frame_swapped_callbacks_); |
| 424 for (std::unique_ptr<base::Closure>& callback : process_callbacks) | 424 for (std::unique_ptr<base::Closure>& callback : process_callbacks) |
| 425 callback->Run(); | 425 callback->Run(); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void RenderWidgetHostViewChildFrame::GetScreenInfo( | |
| 429 blink::WebScreenInfo* results) { | |
| 430 if (!frame_connector_) | |
| 431 return; | |
| 432 frame_connector_->GetScreenInfo(results); | |
| 433 } | |
| 434 | |
| 435 gfx::Rect RenderWidgetHostViewChildFrame::GetBoundsInRootWindow() { | 428 gfx::Rect RenderWidgetHostViewChildFrame::GetBoundsInRootWindow() { |
| 436 gfx::Rect rect; | 429 gfx::Rect rect; |
| 437 if (frame_connector_) { | 430 if (frame_connector_) { |
| 438 RenderWidgetHostViewBase* root_view = | 431 RenderWidgetHostViewBase* root_view = |
| 439 frame_connector_->GetRootRenderWidgetHostView(); | 432 frame_connector_->GetRootRenderWidgetHostView(); |
| 440 | 433 |
| 441 // The root_view can be null in tests when using a TestWebContents. | 434 // The root_view can be null in tests when using a TestWebContents. |
| 442 if (root_view) | 435 if (root_view) |
| 443 rect = root_view->GetBoundsInRootWindow(); | 436 rect = root_view->GetBoundsInRootWindow(); |
| 444 } | 437 } |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 693 |
| 701 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 694 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
| 702 return true; | 695 return true; |
| 703 } | 696 } |
| 704 | 697 |
| 705 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 698 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
| 706 return surface_id_; | 699 return surface_id_; |
| 707 }; | 700 }; |
| 708 | 701 |
| 709 } // namespace content | 702 } // namespace content |
| OLD | NEW |