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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 void WebContentsAndroid::Copy(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 267 void WebContentsAndroid::Copy(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
268 web_contents_->Copy(); | 268 web_contents_->Copy(); |
269 } | 269 } |
270 | 270 |
271 void WebContentsAndroid::Paste(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 271 void WebContentsAndroid::Paste(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
272 web_contents_->Paste(); | 272 web_contents_->Paste(); |
273 } | 273 } |
274 | 274 |
| 275 void WebContentsAndroid::PasteAsPlainText(JNIEnv* env, |
| 276 const JavaParamRef<jobject>& obj) { |
| 277 // Paste as if user typed the characters, which should match current style of |
| 278 // the caret location. |
| 279 web_contents_->PasteAndMatchStyle(); |
| 280 } |
| 281 |
275 void WebContentsAndroid::Replace(JNIEnv* env, | 282 void WebContentsAndroid::Replace(JNIEnv* env, |
276 const JavaParamRef<jobject>& obj, | 283 const JavaParamRef<jobject>& obj, |
277 const JavaParamRef<jstring>& jstr) { | 284 const JavaParamRef<jstring>& jstr) { |
278 web_contents_->Replace(base::android::ConvertJavaStringToUTF16(env, jstr)); | 285 web_contents_->Replace(base::android::ConvertJavaStringToUTF16(env, jstr)); |
279 } | 286 } |
280 | 287 |
281 void WebContentsAndroid::SelectAll(JNIEnv* env, | 288 void WebContentsAndroid::SelectAll(JNIEnv* env, |
282 const JavaParamRef<jobject>& obj) { | 289 const JavaParamRef<jobject>& obj) { |
283 web_contents_->SelectAll(); | 290 web_contents_->SelectAll(); |
284 } | 291 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); | 720 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); |
714 } | 721 } |
715 | 722 |
716 void WebContentsAndroid::SetMediaSession( | 723 void WebContentsAndroid::SetMediaSession( |
717 const ScopedJavaLocalRef<jobject>& j_media_session) { | 724 const ScopedJavaLocalRef<jobject>& j_media_session) { |
718 JNIEnv* env = base::android::AttachCurrentThread(); | 725 JNIEnv* env = base::android::AttachCurrentThread(); |
719 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); | 726 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); |
720 } | 727 } |
721 | 728 |
722 } // namespace content | 729 } // namespace content |
OLD | NEW |