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/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 | 303 |
304 bool RenderWidgetHostViewAndroid::OnMessageReceived( | 304 bool RenderWidgetHostViewAndroid::OnMessageReceived( |
305 const IPC::Message& message) { | 305 const IPC::Message& message) { |
306 bool handled = true; | 306 bool handled = true; |
307 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 307 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
308 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 308 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
309 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, | 309 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, |
310 OnDidChangeBodyBackgroundColor) | 310 OnDidChangeBodyBackgroundColor) |
311 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame, | 311 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, |
312 OnSetNeedsBeginFrame) | 312 OnSetNeedsBeginFrames) |
313 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | 313 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, |
314 OnTextInputStateChanged) | 314 OnTextInputStateChanged) |
315 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, | 315 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, |
316 OnSmartClipDataExtracted) | 316 OnSmartClipDataExtracted) |
317 IPC_MESSAGE_UNHANDLED(handled = false) | 317 IPC_MESSAGE_UNHANDLED(handled = false) |
318 IPC_END_MESSAGE_MAP() | 318 IPC_END_MESSAGE_MAP() |
319 return handled; | 319 return handled; |
320 } | 320 } |
321 | 321 |
322 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { | 322 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( | 666 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( |
667 SkColor color) { | 667 SkColor color) { |
668 if (cached_background_color_ == color) | 668 if (cached_background_color_ == color) |
669 return; | 669 return; |
670 | 670 |
671 cached_background_color_ = color; | 671 cached_background_color_ = color; |
672 if (content_view_core_) | 672 if (content_view_core_) |
673 content_view_core_->OnBackgroundColorChanged(color); | 673 content_view_core_->OnBackgroundColorChanged(color); |
674 } | 674 } |
675 | 675 |
676 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrame(bool enabled) { | 676 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames(bool enabled) { |
677 DCHECK(!using_synchronous_compositor_); | 677 DCHECK(!using_synchronous_compositor_); |
678 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::OnSetNeedsBeginFrame", | 678 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames", |
679 "enabled", enabled); | 679 "enabled", enabled); |
680 if (enabled) | 680 if (enabled) |
681 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); | 681 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); |
682 else | 682 else |
683 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; | 683 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; |
684 } | 684 } |
685 | 685 |
686 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 686 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
687 const GURL& content_url) { | 687 const GURL& content_url) { |
688 if (content_view_core_) | 688 if (content_view_core_) |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 results->orientationAngle = display.RotationAsDegree(); | 1811 results->orientationAngle = display.RotationAsDegree(); |
1812 results->orientationType = | 1812 results->orientationType = |
1813 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1813 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1814 gfx::DeviceDisplayInfo info; | 1814 gfx::DeviceDisplayInfo info; |
1815 results->depth = info.GetBitsPerPixel(); | 1815 results->depth = info.GetBitsPerPixel(); |
1816 results->depthPerComponent = info.GetBitsPerComponent(); | 1816 results->depthPerComponent = info.GetBitsPerComponent(); |
1817 results->isMonochrome = (results->depthPerComponent == 0); | 1817 results->isMonochrome = (results->depthPerComponent == 0); |
1818 } | 1818 } |
1819 | 1819 |
1820 } // namespace content | 1820 } // namespace content |
OLD | NEW |