OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/web_contents/web_contents_android.h" | 5 #include "content/browser/web_contents/web_contents_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 host->GetRoutingID(), gfx::Rect())); | 388 host->GetRoutingID(), gfx::Rect())); |
389 } | 389 } |
390 | 390 |
391 void WebContentsAndroid::SelectWordAroundCaret(JNIEnv* env, jobject obj) { | 391 void WebContentsAndroid::SelectWordAroundCaret(JNIEnv* env, jobject obj) { |
392 RenderViewHost* host = web_contents_->GetRenderViewHost(); | 392 RenderViewHost* host = web_contents_->GetRenderViewHost(); |
393 if (!host) | 393 if (!host) |
394 return; | 394 return; |
395 host->SelectWordAroundCaret(); | 395 host->SelectWordAroundCaret(); |
396 } | 396 } |
397 | 397 |
| 398 void WebContentsAndroid::ExpandSelectionByCharacterOffset(JNIEnv* env, |
| 399 jobject obj, |
| 400 jint start_adjust, |
| 401 jint end_adjust) { |
| 402 web_contents_->ExpandSelectionByCharacterOffset(start_adjust, end_adjust); |
| 403 } |
| 404 |
398 void WebContentsAndroid::EvaluateJavaScript(JNIEnv* env, | 405 void WebContentsAndroid::EvaluateJavaScript(JNIEnv* env, |
399 jobject obj, | 406 jobject obj, |
400 jstring script, | 407 jstring script, |
401 jobject callback) { | 408 jobject callback) { |
402 RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 409 RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
403 DCHECK(rvh); | 410 DCHECK(rvh); |
404 | 411 |
405 if (!rvh->IsRenderViewLive()) { | 412 if (!rvh->IsRenderViewLive()) { |
406 if (!static_cast<WebContentsImpl*>(web_contents_)-> | 413 if (!static_cast<WebContentsImpl*>(web_contents_)-> |
407 CreateRenderViewForInitialEmptyDocument()) { | 414 CreateRenderViewForInitialEmptyDocument()) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 ContentViewCoreImpl* contentViewCore = | 469 ContentViewCoreImpl* contentViewCore = |
463 ContentViewCoreImpl::FromWebContents(web_contents_); | 470 ContentViewCoreImpl::FromWebContents(web_contents_); |
464 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = | 471 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = |
465 base::Bind(&AXTreeSnapshotCallback, j_callback, | 472 base::Bind(&AXTreeSnapshotCallback, j_callback, |
466 contentViewCore->GetScaleFactor()); | 473 contentViewCore->GetScaleFactor()); |
467 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( | 474 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( |
468 snapshot_callback); | 475 snapshot_callback); |
469 } | 476 } |
470 | 477 |
471 } // namespace content | 478 } // namespace content |
OLD | NEW |