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/sys_utils.h" | 9 #include "base/android/sys_utils.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 bool RenderWidgetHostViewAndroid::OnMessageReceived( | 212 bool RenderWidgetHostViewAndroid::OnMessageReceived( |
213 const IPC::Message& message) { | 213 const IPC::Message& message) { |
214 bool handled = true; | 214 bool handled = true; |
215 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) | 215 IPC_BEGIN_MESSAGE_MAP(RenderWidgetHostViewAndroid, message) |
216 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) | 216 IPC_MESSAGE_HANDLER(ViewHostMsg_StartContentIntent, OnStartContentIntent) |
217 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, | 217 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeBodyBackgroundColor, |
218 OnDidChangeBodyBackgroundColor) | 218 OnDidChangeBodyBackgroundColor) |
219 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame, | 219 IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrame, |
220 OnSetNeedsBeginFrame) | 220 OnSetNeedsBeginFrame) |
221 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | |
222 OnTextInputStateChanged) | |
223 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, | 221 IPC_MESSAGE_HANDLER(ViewHostMsg_SmartClipDataExtracted, |
224 OnSmartClipDataExtracted) | 222 OnSmartClipDataExtracted) |
225 IPC_MESSAGE_UNHANDLED(handled = false) | 223 IPC_MESSAGE_UNHANDLED(handled = false) |
226 IPC_END_MESSAGE_MAP() | 224 IPC_END_MESSAGE_MAP() |
227 return handled; | 225 return handled; |
228 } | 226 } |
229 | 227 |
230 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { | 228 void RenderWidgetHostViewAndroid::InitAsChild(gfx::NativeView parent_view) { |
231 NOTIMPLEMENTED(); | 229 NOTIMPLEMENTED(); |
232 } | 230 } |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 467 |
470 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { | 468 void RenderWidgetHostViewAndroid::UpdateCursor(const WebCursor& cursor) { |
471 // There are no cursors on Android. | 469 // There are no cursors on Android. |
472 } | 470 } |
473 | 471 |
474 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { | 472 void RenderWidgetHostViewAndroid::SetIsLoading(bool is_loading) { |
475 // Do nothing. The UI notification is handled through ContentViewClient which | 473 // Do nothing. The UI notification is handled through ContentViewClient which |
476 // is TabContentsDelegate. | 474 // is TabContentsDelegate. |
477 } | 475 } |
478 | 476 |
479 void RenderWidgetHostViewAndroid::TextInputTypeChanged( | |
480 ui::TextInputType type, | |
481 ui::TextInputMode input_mode, | |
482 bool can_compose_inline) { | |
483 // Unused on Android, which uses OnTextInputChanged instead. | |
484 } | |
485 | |
486 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { | 477 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
487 return reinterpret_cast<intptr_t>(&ime_adapter_android_); | 478 return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
488 } | 479 } |
489 | 480 |
490 void RenderWidgetHostViewAndroid::OnTextInputStateChanged( | 481 void RenderWidgetHostViewAndroid::TextInputStateChanged( |
491 const ViewHostMsg_TextInputState_Params& params) { | 482 const ViewHostMsg_TextInputState_Params& params) { |
492 // If the change is not originated from IME (e.g. Javascript, autofill), | 483 // If the change is not originated from IME (e.g. Javascript, autofill), |
493 // send back the renderer an acknowledgement, regardless of how we exit from | 484 // send back the renderer an acknowledgement, regardless of how we exit from |
494 // this method. | 485 // this method. |
495 base::ScopedClosureRunner ack_caller; | 486 base::ScopedClosureRunner ack_caller; |
496 if (params.is_non_ime_change) | 487 if (params.is_non_ime_change) |
497 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); | 488 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); |
498 | 489 |
499 if (!IsShowing()) | 490 if (!IsShowing()) |
500 return; | 491 return; |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 results->availableRect = display.work_area(); | 1440 results->availableRect = display.work_area(); |
1450 results->deviceScaleFactor = display.device_scale_factor(); | 1441 results->deviceScaleFactor = display.device_scale_factor(); |
1451 results->orientationAngle = display.RotationAsDegree(); | 1442 results->orientationAngle = display.RotationAsDegree(); |
1452 gfx::DeviceDisplayInfo info; | 1443 gfx::DeviceDisplayInfo info; |
1453 results->depth = info.GetBitsPerPixel(); | 1444 results->depth = info.GetBitsPerPixel(); |
1454 results->depthPerComponent = info.GetBitsPerComponent(); | 1445 results->depthPerComponent = info.GetBitsPerComponent(); |
1455 results->isMonochrome = (results->depthPerComponent == 0); | 1446 results->isMonochrome = (results->depthPerComponent == 0); |
1456 } | 1447 } |
1457 | 1448 |
1458 } // namespace content | 1449 } // namespace content |
OLD | NEW |