Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: content/browser/web_contents/web_contents_android.cc

Issue 2407303005: Let embedder provide select action mode (Closed)
Patch Set: Move FloatingPaste into WebActionMode Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 return web_contents_->DownloadImage( 683 return web_contents_->DownloadImage(
684 url, is_fav_icon, max_bitmap_size, bypass_cache, 684 url, is_fav_icon, max_bitmap_size, bypass_cache,
685 base::Bind(&WebContentsAndroid::OnFinishDownloadImage, 685 base::Bind(&WebContentsAndroid::OnFinishDownloadImage,
686 weak_factory_.GetWeakPtr(), 686 weak_factory_.GetWeakPtr(),
687 base::Owned(new ScopedJavaGlobalRef<jobject>( 687 base::Owned(new ScopedJavaGlobalRef<jobject>(
688 env, obj)), 688 env, obj)),
689 base::Owned(new ScopedJavaGlobalRef<jobject>( 689 base::Owned(new ScopedJavaGlobalRef<jobject>(
690 env, jcallback)))); 690 env, jcallback))));
691 } 691 }
692 692
693 void WebContentsAndroid::DismissTextHandles(
694 JNIEnv* env,
695 const base::android::JavaParamRef<jobject>& obj) {
696 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid();
697 if (view)
698 view->DismissTextHandles();
699 }
700
693 void WebContentsAndroid::OnFinishGetContentBitmap( 701 void WebContentsAndroid::OnFinishGetContentBitmap(
694 ScopedJavaGlobalRef<jobject>* obj, 702 ScopedJavaGlobalRef<jobject>* obj,
695 ScopedJavaGlobalRef<jobject>* callback, 703 ScopedJavaGlobalRef<jobject>* callback,
696 const SkBitmap& bitmap, 704 const SkBitmap& bitmap,
697 ReadbackResponse response) { 705 ReadbackResponse response) {
698 JNIEnv* env = base::android::AttachCurrentThread(); 706 JNIEnv* env = base::android::AttachCurrentThread();
699 ScopedJavaLocalRef<jobject> java_bitmap; 707 ScopedJavaLocalRef<jobject> java_bitmap;
700 if (response == READBACK_SUCCESS) 708 if (response == READBACK_SUCCESS)
701 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); 709 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap);
702 Java_WebContentsImpl_onGetContentBitmapFinished(env, *obj, *callback, 710 Java_WebContentsImpl_onGetContentBitmapFinished(env, *obj, *callback,
(...skipping 24 matching lines...) Expand all
727 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap); 735 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap);
728 } 736 }
729 for (const gfx::Size& size : sizes) { 737 for (const gfx::Size& size : sizes) {
730 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(), 738 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(),
731 size.height()); 739 size.height());
732 } 740 }
733 Java_WebContentsImpl_onDownloadImageFinished( 741 Java_WebContentsImpl_onDownloadImageFinished(
734 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); 742 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes);
735 } 743 }
736 } // namespace content 744 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698