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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 2380743003: Refactor ContentViewClient (2/6) (Closed)
Patch Set: tests Created 4 years, 2 months 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 view->OnShowingPastePopup(gfx::PointF(x_dip, y_dip)); 659 view->OnShowingPastePopup(gfx::PointF(x_dip, y_dip));
660 660
661 JNIEnv* env = AttachCurrentThread(); 661 JNIEnv* env = AttachCurrentThread();
662 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 662 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
663 if (obj.is_null()) 663 if (obj.is_null())
664 return; 664 return;
665 Java_ContentViewCore_showPastePopup(env, obj, x_dip, 665 Java_ContentViewCore_showPastePopup(env, obj, x_dip,
666 y_dip); 666 y_dip);
667 } 667 }
668 668
669 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url,
670 bool is_main_frame) {
671 JNIEnv* env = AttachCurrentThread();
672 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
673 if (j_obj.is_null())
674 return;
675 ScopedJavaLocalRef<jstring> jcontent_url =
676 ConvertUTF8ToJavaString(env, content_url.spec());
677 Java_ContentViewCore_startContentIntent(env, j_obj, jcontent_url,
678 is_main_frame);
679 }
680
681 void ContentViewCoreImpl::ShowDisambiguationPopup( 669 void ContentViewCoreImpl::ShowDisambiguationPopup(
682 const gfx::Rect& rect_pixels, 670 const gfx::Rect& rect_pixels,
683 const SkBitmap& zoomed_bitmap) { 671 const SkBitmap& zoomed_bitmap) {
684 JNIEnv* env = AttachCurrentThread(); 672 JNIEnv* env = AttachCurrentThread();
685 673
686 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 674 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
687 if (obj.is_null()) 675 if (obj.is_null())
688 return; 676 return;
689 677
690 ScopedJavaLocalRef<jobject> rect_object(CreateJavaRect(env, rect_pixels)); 678 ScopedJavaLocalRef<jobject> rect_object(CreateJavaRect(env, rect_pixels));
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 return ScopedJavaLocalRef<jobject>(); 1565 return ScopedJavaLocalRef<jobject>();
1578 1566
1579 return view->GetJavaObject(); 1567 return view->GetJavaObject();
1580 } 1568 }
1581 1569
1582 bool RegisterContentViewCore(JNIEnv* env) { 1570 bool RegisterContentViewCore(JNIEnv* env) {
1583 return RegisterNativesImpl(env); 1571 return RegisterNativesImpl(env);
1584 } 1572 }
1585 1573
1586 } // namespace content 1574 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698