| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 // Do nothing. The UI notification is handled through ContentViewClient which | 504 // Do nothing. The UI notification is handled through ContentViewClient which |
| 505 // is TabContentsDelegate. | 505 // is TabContentsDelegate. |
| 506 } | 506 } |
| 507 | 507 |
| 508 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { | 508 long RenderWidgetHostViewAndroid::GetNativeImeAdapter() { |
| 509 return reinterpret_cast<intptr_t>(&ime_adapter_android_); | 509 return reinterpret_cast<intptr_t>(&ime_adapter_android_); |
| 510 } | 510 } |
| 511 | 511 |
| 512 void RenderWidgetHostViewAndroid::TextInputStateChanged( | 512 void RenderWidgetHostViewAndroid::TextInputStateChanged( |
| 513 const ViewHostMsg_TextInputState_Params& params) { | 513 const ViewHostMsg_TextInputState_Params& params) { |
| 514 if (selection_controller_) { |
| 515 const bool is_editable_node = params.type != ui::TEXT_INPUT_TYPE_NONE; |
| 516 selection_controller_->OnSelectionEditable(is_editable_node); |
| 517 } |
| 518 |
| 514 // If the change is not originated from IME (e.g. Javascript, autofill), | 519 // If the change is not originated from IME (e.g. Javascript, autofill), |
| 515 // send back the renderer an acknowledgement, regardless of how we exit from | 520 // send back the renderer an acknowledgement, regardless of how we exit from |
| 516 // this method. | 521 // this method. |
| 517 base::ScopedClosureRunner ack_caller; | 522 base::ScopedClosureRunner ack_caller; |
| 518 if (params.is_non_ime_change) | 523 if (params.is_non_ime_change) |
| 519 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); | 524 ack_caller.Reset(base::Bind(&SendImeEventAck, host_)); |
| 520 | 525 |
| 521 if (!IsShowing()) | 526 if (!IsShowing()) |
| 522 return; | 527 return; |
| 523 | 528 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 bool enabled) { | 627 bool enabled) { |
| 623 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); | 628 gesture_provider_.SetMultiTouchZoomSupportEnabled(enabled); |
| 624 } | 629 } |
| 625 | 630 |
| 626 void RenderWidgetHostViewAndroid::ImeCancelComposition() { | 631 void RenderWidgetHostViewAndroid::ImeCancelComposition() { |
| 627 ime_adapter_android_.CancelComposition(); | 632 ime_adapter_android_.CancelComposition(); |
| 628 } | 633 } |
| 629 | 634 |
| 630 void RenderWidgetHostViewAndroid::FocusedNodeChanged(bool is_editable_node) { | 635 void RenderWidgetHostViewAndroid::FocusedNodeChanged(bool is_editable_node) { |
| 631 ime_adapter_android_.FocusedNodeChanged(is_editable_node); | 636 ime_adapter_android_.FocusedNodeChanged(is_editable_node); |
| 632 if (selection_controller_) | |
| 633 selection_controller_->OnSelectionEditable(is_editable_node); | |
| 634 } | 637 } |
| 635 | 638 |
| 636 void RenderWidgetHostViewAndroid::RenderProcessGone( | 639 void RenderWidgetHostViewAndroid::RenderProcessGone( |
| 637 base::TerminationStatus status, int error_code) { | 640 base::TerminationStatus status, int error_code) { |
| 638 Destroy(); | 641 Destroy(); |
| 639 } | 642 } |
| 640 | 643 |
| 641 void RenderWidgetHostViewAndroid::Destroy() { | 644 void RenderWidgetHostViewAndroid::Destroy() { |
| 642 RemoveLayers(); | 645 RemoveLayers(); |
| 643 SetContentViewCore(NULL); | 646 SetContentViewCore(NULL); |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1639 results->orientationAngle = display.RotationAsDegree(); | 1642 results->orientationAngle = display.RotationAsDegree(); |
| 1640 results->orientationType = | 1643 results->orientationType = |
| 1641 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1644 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1642 gfx::DeviceDisplayInfo info; | 1645 gfx::DeviceDisplayInfo info; |
| 1643 results->depth = info.GetBitsPerPixel(); | 1646 results->depth = info.GetBitsPerPixel(); |
| 1644 results->depthPerComponent = info.GetBitsPerComponent(); | 1647 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1645 results->isMonochrome = (results->depthPerComponent == 0); | 1648 results->isMonochrome = (results->depthPerComponent == 0); |
| 1646 } | 1649 } |
| 1647 | 1650 |
| 1648 } // namespace content | 1651 } // namespace content |
| OLD | NEW |