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::AdjustSelectionByCharacterOffset(JNIEnv* env, |
| 399 jobject obj, |
| 400 jint start_adjust, |
| 401 jint end_adjust) { |
| 402 web_contents_->AdjustSelectionByCharacterOffset(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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 477 |
471 void WebContentsAndroid::ResumeMediaSession(JNIEnv* env, jobject obj) { | 478 void WebContentsAndroid::ResumeMediaSession(JNIEnv* env, jobject obj) { |
472 web_contents_->ResumeMediaSession(); | 479 web_contents_->ResumeMediaSession(); |
473 } | 480 } |
474 | 481 |
475 void WebContentsAndroid::SuspendMediaSession(JNIEnv* env, jobject obj) { | 482 void WebContentsAndroid::SuspendMediaSession(JNIEnv* env, jobject obj) { |
476 web_contents_->SuspendMediaSession(); | 483 web_contents_->SuspendMediaSession(); |
477 } | 484 } |
478 | 485 |
479 } // namespace content | 486 } // namespace content |
OLD | NEW |