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_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 } | 1000 } |
1001 | 1001 |
1002 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( | 1002 void RenderWidgetHostViewAndroid::SynchronousFrameMetadata( |
1003 const cc::CompositorFrameMetadata& frame_metadata) { | 1003 const cc::CompositorFrameMetadata& frame_metadata) { |
1004 // This is a subset of OnSwapCompositorFrame() used in the synchronous | 1004 // This is a subset of OnSwapCompositorFrame() used in the synchronous |
1005 // compositor flow. | 1005 // compositor flow. |
1006 OnFrameMetadataUpdated(frame_metadata); | 1006 OnFrameMetadataUpdated(frame_metadata); |
1007 ComputeContentsSize(frame_metadata); | 1007 ComputeContentsSize(frame_metadata); |
1008 | 1008 |
1009 // DevTools ScreenCast support for Android WebView. | 1009 // DevTools ScreenCast support for Android WebView. |
1010 if (DevToolsAgentHost::HasFor(RenderViewHost::From(GetRenderWidgetHost()))) { | 1010 WebContents* web_contents = content_view_core_->GetWebContents(); |
| 1011 if (DevToolsAgentHost::HasFor(web_contents)) { |
1011 scoped_refptr<DevToolsAgentHost> dtah = | 1012 scoped_refptr<DevToolsAgentHost> dtah = |
1012 DevToolsAgentHost::GetOrCreateFor( | 1013 DevToolsAgentHost::GetOrCreateFor(web_contents); |
1013 RenderViewHost::From(GetRenderWidgetHost())); | |
1014 // Unblock the compositor. | 1014 // Unblock the compositor. |
1015 BrowserThread::PostTask( | 1015 BrowserThread::PostTask( |
1016 BrowserThread::UI, FROM_HERE, | 1016 BrowserThread::UI, FROM_HERE, |
1017 base::Bind(&RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame, | 1017 base::Bind(&RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame, |
1018 static_cast<RenderViewDevToolsAgentHost*>(dtah.get()), | 1018 static_cast<RenderViewDevToolsAgentHost*>(dtah.get()), |
1019 frame_metadata)); | 1019 frame_metadata)); |
1020 } | 1020 } |
1021 } | 1021 } |
1022 | 1022 |
1023 void RenderWidgetHostViewAndroid::SetOverlayVideoMode(bool enabled) { | 1023 void RenderWidgetHostViewAndroid::SetOverlayVideoMode(bool enabled) { |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 results->orientationAngle = display.RotationAsDegree(); | 1691 results->orientationAngle = display.RotationAsDegree(); |
1692 results->orientationType = | 1692 results->orientationType = |
1693 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1693 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1694 gfx::DeviceDisplayInfo info; | 1694 gfx::DeviceDisplayInfo info; |
1695 results->depth = info.GetBitsPerPixel(); | 1695 results->depth = info.GetBitsPerPixel(); |
1696 results->depthPerComponent = info.GetBitsPerComponent(); | 1696 results->depthPerComponent = info.GetBitsPerComponent(); |
1697 results->isMonochrome = (results->depthPerComponent == 0); | 1697 results->isMonochrome = (results->depthPerComponent == 0); |
1698 } | 1698 } |
1699 | 1699 |
1700 } // namespace content | 1700 } // namespace content |
OLD | NEW |