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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 bool RenderWidgetHostViewAndroid::OnMessageReceived( | 367 bool RenderWidgetHostViewAndroid::OnMessageReceived( |
368 const IPC::Message& message) { | 368 const IPC::Message& message) { |
369 bool handled = true; | 369 bool handled = true; |
370 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 370 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
371 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 371 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
372 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, | 372 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, |
373 OnDidChangeBodyBackgroundColor) | 373 OnDidChangeBodyBackgroundColor) |
374 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, | 374 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, |
375 OnSetNeedsBeginFrames) | 375 OnSetNeedsBeginFrames) |
376 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | |
377 OnTextInputStateChanged) | |
378 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, | 376 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, |
379 OnSmartClipDataExtracted) | 377 OnSmartClipDataExtracted) |
380 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowUnhandledTapUIIfNeeded, | 378 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowUnhandledTapUIIfNeeded, |
381 OnShowUnhandledTapUIIfNeeded) | 379 OnShowUnhandledTapUIIfNeeded) |
382 IPC_MESSAGE_UNHANDLED(handled = false) | 380 IPC_MESSAGE_UNHANDLED(handled = false) |
383 IPC_END_MESSAGE_MAP() | 381 IPC_END_MESSAGE_MAP() |
384 return handled; | 382 return handled; |
385 } | 383 } |
386 | 384 |
387 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { | 385 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 | 657 |
660 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { | 658 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { |
661 // There are no cursors on Android. | 659 // There are no cursors on Android. |
662 } | 660 } |
663 | 661 |
664 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { | 662 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { |
665 // Do nothing. The UI notification is handled through ContentViewClient which | 663 // Do nothing. The UI notification is handled through ContentViewClient which |
666 // is TabContentsDelegate. | 664 // is TabContentsDelegate. |
667 } | 665 } |
668 | 666 |
669 void RenderWidgetHostViewAndroid::TextInputTypeChanged( | |
670 ui::TextInputType type, | |
671 ui::TextInputMode input_mode, | |
672 bool can_compose_inline, | |
673 int flags) { | |
674 // Unused on Android, which uses OnTextInputChanged instead. | |
675 } | |
676 | |
677 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { | 667 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
678 return reinterpret_cast<intptr_t>(&ime_adapter_android_); | 668 return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
679 } | 669 } |
680 | 670 |
681 void RenderWidgetHostViewAndroid::OnTextInputStateChanged( | 671 void RenderWidgetHostViewAndroid::TextInputStateChanged( |
682 const ViewHostMsg_TextInputState_Params& params) { | 672 const ViewHostMsg_TextInputState_Params& params) { |
683 // If the change is not originated from IME (e.g. Javascript, autofill), | 673 // If the change is not originated from IME (e.g. Javascript, autofill), |
684 // send back the renderer an acknowledgement, regardless of how we exit from | 674 // send back the renderer an acknowledgement, regardless of how we exit from |
685 // this method. | 675 // this method. |
686 base::ScopedClosureRunner ack_caller; | 676 base::ScopedClosureRunner ack_caller; |
687 if (params.is_non_ime_change) | 677 if (params.is_non_ime_change) |
688 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); | 678 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); |
689 | 679 |
690 if (!IsShowing()) | 680 if (!IsShowing()) |
691 return; | 681 return; |
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 results->orientationAngle = display.RotationAsDegree(); | 2030 results->orientationAngle = display.RotationAsDegree(); |
2041 results->orientationType = | 2031 results->orientationType = |
2042 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2032 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2043 gfx::DeviceDisplayInfo info; | 2033 gfx::DeviceDisplayInfo info; |
2044 results->depth = info.GetBitsPerPixel(); | 2034 results->depth = info.GetBitsPerPixel(); |
2045 results->depthPerComponent = info.GetBitsPerComponent(); | 2035 results->depthPerComponent = info.GetBitsPerComponent(); |
2046 results->isMonochrome = (results->depthPerComponent == 0); | 2036 results->isMonochrome = (results->depthPerComponent == 0); |
2047 } | 2037 } |
2048 | 2038 |
2049 } // namespace content | 2039 } // namespace content |
OLD | NEW |