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

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

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: Fix non-Android compile issue Created 4 years 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 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 clip_rect_object); 1523 clip_rect_object);
1524 } 1524 }
1525 1525
1526 void ContentViewCoreImpl::WebContentsDestroyed() { 1526 void ContentViewCoreImpl::WebContentsDestroyed() {
1527 WebContentsViewAndroid* wcva = static_cast<WebContentsViewAndroid*>( 1527 WebContentsViewAndroid* wcva = static_cast<WebContentsViewAndroid*>(
1528 static_cast<WebContentsImpl*>(web_contents())->GetView()); 1528 static_cast<WebContentsImpl*>(web_contents())->GetView());
1529 DCHECK(wcva); 1529 DCHECK(wcva);
1530 wcva->SetContentViewCore(NULL); 1530 wcva->SetContentViewCore(NULL);
1531 } 1531 }
1532 1532
1533 bool ContentViewCoreImpl::PullStart() {
1534 JNIEnv* env = AttachCurrentThread();
1535 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1536 if (!obj.is_null())
1537 return Java_ContentViewCore_onOverscrollRefreshStart(env, obj);
1538 return false;
1539 }
1540
1541 void ContentViewCoreImpl::PullUpdate(float delta) {
1542 JNIEnv* env = AttachCurrentThread();
1543 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1544 if (!obj.is_null())
1545 Java_ContentViewCore_onOverscrollRefreshUpdate(env, obj, delta);
1546 }
1547
1548 void ContentViewCoreImpl::PullRelease(bool allow_refresh) {
1549 JNIEnv* env = AttachCurrentThread();
1550 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1551 if (!obj.is_null()) {
1552 Java_ContentViewCore_onOverscrollRefreshRelease(env, obj, allow_refresh);
1553 }
1554 }
1555
1556 void ContentViewCoreImpl::PullReset() {
1557 JNIEnv* env = AttachCurrentThread();
1558 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1559 if (!obj.is_null())
1560 Java_ContentViewCore_onOverscrollRefreshReset(env, obj);
1561 }
1562
1563 // This is called for each ContentView. 1533 // This is called for each ContentView.
1564 jlong Init(JNIEnv* env, 1534 jlong Init(JNIEnv* env,
1565 const JavaParamRef<jobject>& obj, 1535 const JavaParamRef<jobject>& obj,
1566 const JavaParamRef<jobject>& jweb_contents, 1536 const JavaParamRef<jobject>& jweb_contents,
1567 const JavaParamRef<jobject>& jview_android_delegate, 1537 const JavaParamRef<jobject>& jview_android_delegate,
1568 jlong jwindow_android, 1538 jlong jwindow_android,
1569 jfloat dipScale, 1539 jfloat dipScale,
1570 const JavaParamRef<jobject>& retained_objects_set) { 1540 const JavaParamRef<jobject>& retained_objects_set) {
1571 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>( 1541 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(
1572 WebContents::FromJavaWebContents(jweb_contents)); 1542 WebContents::FromJavaWebContents(jweb_contents));
(...skipping 26 matching lines...) Expand all
1599 return ScopedJavaLocalRef<jobject>(); 1569 return ScopedJavaLocalRef<jobject>();
1600 1570
1601 return view->GetJavaObject(); 1571 return view->GetJavaObject();
1602 } 1572 }
1603 1573
1604 bool RegisterContentViewCore(JNIEnv* env) { 1574 bool RegisterContentViewCore(JNIEnv* env) {
1605 return RegisterNativesImpl(env); 1575 return RegisterNativesImpl(env);
1606 } 1576 }
1607 1577
1608 } // namespace content 1578 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698