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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( | 665 void RenderWidgetHostViewAndroid::OnDidChangeBodyBackgroundColor( |
666 SkColor color) { | 666 SkColor color) { |
667 if (cached_background_color_ == color) | 667 if (cached_background_color_ == color) |
668 return; | 668 return; |
669 | 669 |
670 cached_background_color_ = color; | 670 cached_background_color_ = color; |
671 if (content_view_core_) | 671 if (content_view_core_) |
672 content_view_core_->OnBackgroundColorChanged(color); | 672 content_view_core_->OnBackgroundColorChanged(color); |
673 } | 673 } |
674 | 674 |
675 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrame(bool enabled) { | 675 void RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames(bool enabled) { |
676 DCHECK(!using_synchronous_compositor_); | 676 DCHECK(!using_synchronous_compositor_); |
677 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::OnSetNeedsBeginFrame", | 677 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::OnSetNeedsBeginFrames", |
678 "enabled", enabled); | 678 "enabled", enabled); |
679 if (enabled) | 679 if (enabled) |
680 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); | 680 RequestVSyncUpdate(PERSISTENT_BEGIN_FRAME); |
681 else | 681 else |
682 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; | 682 outstanding_vsync_requests_ &= ~PERSISTENT_BEGIN_FRAME; |
683 } | 683 } |
684 | 684 |
685 void RenderWidgetHostViewAndroid::OnStartContentIntent( | 685 void RenderWidgetHostViewAndroid::OnStartContentIntent( |
686 const GURL& content_url) { | 686 const GURL& content_url) { |
687 if (content_view_core_) | 687 if (content_view_core_) |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 results->orientationAngle = display.RotationAsDegree(); | 1792 results->orientationAngle = display.RotationAsDegree(); |
1793 results->orientationType = | 1793 results->orientationType = |
1794 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1794 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1795 gfx::DeviceDisplayInfo info; | 1795 gfx::DeviceDisplayInfo info; |
1796 results->depth = info.GetBitsPerPixel(); | 1796 results->depth = info.GetBitsPerPixel(); |
1797 results->depthPerComponent = info.GetBitsPerComponent(); | 1797 results->depthPerComponent = info.GetBitsPerComponent(); |
1798 results->isMonochrome = (results->depthPerComponent == 0); | 1798 results->isMonochrome = (results->depthPerComponent == 0); |
1799 } | 1799 } |
1800 | 1800 |
1801 } // namespace content | 1801 } // namespace content |
OLD | NEW |