| 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 return; | 548 return; |
| 549 size_t pos = range.GetMin() - offset; | 549 size_t pos = range.GetMin() - offset; |
| 550 size_t n = range.length(); | 550 size_t n = range.length(); |
| 551 | 551 |
| 552 DCHECK(pos + n <= text.length()) << "The text can not fully cover range."; | 552 DCHECK(pos + n <= text.length()) << "The text can not fully cover range."; |
| 553 if (pos >= text.length()) { | 553 if (pos >= text.length()) { |
| 554 NOTREACHED() << "The text can not cover range."; | 554 NOTREACHED() << "The text can not cover range."; |
| 555 return; | 555 return; |
| 556 } | 556 } |
| 557 | 557 |
| 558 std::string utf8_selection = UTF16ToUTF8(text.substr(pos, n)); | 558 std::string utf8_selection = base::UTF16ToUTF8(text.substr(pos, n)); |
| 559 | 559 |
| 560 content_view_core_->OnSelectionChanged(utf8_selection); | 560 content_view_core_->OnSelectionChanged(utf8_selection); |
| 561 } | 561 } |
| 562 | 562 |
| 563 void RenderWidgetHostViewAndroid::SelectionBoundsChanged( | 563 void RenderWidgetHostViewAndroid::SelectionBoundsChanged( |
| 564 const ViewHostMsg_SelectionBounds_Params& params) { | 564 const ViewHostMsg_SelectionBounds_Params& params) { |
| 565 if (content_view_core_) { | 565 if (content_view_core_) { |
| 566 content_view_core_->OnSelectionBoundsChanged(params); | 566 content_view_core_->OnSelectionBoundsChanged(params); |
| 567 } | 567 } |
| 568 } | 568 } |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 // RenderWidgetHostView, public: | 1407 // RenderWidgetHostView, public: |
| 1408 | 1408 |
| 1409 // static | 1409 // static |
| 1410 RenderWidgetHostView* | 1410 RenderWidgetHostView* |
| 1411 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { | 1411 RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost* widget) { |
| 1412 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); | 1412 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(widget); |
| 1413 return new RenderWidgetHostViewAndroid(rwhi, NULL); | 1413 return new RenderWidgetHostViewAndroid(rwhi, NULL); |
| 1414 } | 1414 } |
| 1415 | 1415 |
| 1416 } // namespace content | 1416 } // namespace content |
| OLD | NEW |