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

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

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: Move web_contents_view_android.h header in web_contents_android.h into cc file, modify CreateRefres… 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 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"
11 #include "base/android/jni_string.h" 11 #include "base/android/jni_string.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/containers/hash_tables.h" 13 #include "base/containers/hash_tables.h"
14 #include "base/json/json_writer.h" 14 #include "base/json/json_writer.h"
15 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "content/browser/accessibility/browser_accessibility_android.h" 17 #include "content/browser/accessibility/browser_accessibility_android.h"
18 #include "content/browser/accessibility/browser_accessibility_manager_android.h" 18 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
19 #include "content/browser/android/content_view_core_impl.h" 19 #include "content/browser/android/content_view_core_impl.h"
20 #include "content/browser/android/interstitial_page_delegate_android.h" 20 #include "content/browser/android/interstitial_page_delegate_android.h"
21 #include "content/browser/frame_host/interstitial_page_impl.h" 21 #include "content/browser/frame_host/interstitial_page_impl.h"
22 #include "content/browser/media/android/browser_media_player_manager.h" 22 #include "content/browser/media/android/browser_media_player_manager.h"
23 #include "content/browser/media/android/media_web_contents_observer_android.h" 23 #include "content/browser/media/android/media_web_contents_observer_android.h"
24 #include "content/browser/renderer_host/render_view_host_impl.h" 24 #include "content/browser/renderer_host/render_view_host_impl.h"
25 #include "content/browser/web_contents/web_contents_impl.h" 25 #include "content/browser/web_contents/web_contents_impl.h"
26 #include "content/browser/web_contents/web_contents_view_android.h"
26 #include "content/common/devtools_messages.h" 27 #include "content/common/devtools_messages.h"
27 #include "content/common/frame_messages.h" 28 #include "content/common/frame_messages.h"
28 #include "content/common/input_messages.h" 29 #include "content/common/input_messages.h"
29 #include "content/common/view_messages.h" 30 #include "content/common/view_messages.h"
30 #include "content/public/browser/android/app_web_message_port_service.h" 31 #include "content/public/browser/android/app_web_message_port_service.h"
31 #include "content/public/browser/browser_context.h" 32 #include "content/public/browser/browser_context.h"
32 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
33 #include "content/public/browser/message_port_provider.h" 34 #include "content/public/browser/message_port_provider.h"
34 #include "content/public/browser/render_widget_host.h" 35 #include "content/public/browser/render_widget_host.h"
35 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 snapshot_callback); 610 snapshot_callback);
610 } 611 }
611 612
612 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding( 613 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding(
613 JNIEnv* env, 614 JNIEnv* env,
614 const JavaParamRef<jobject>& obj) const { 615 const JavaParamRef<jobject>& obj) const {
615 return base::android::ConvertUTF8ToJavaString(env, 616 return base::android::ConvertUTF8ToJavaString(env,
616 web_contents_->GetEncoding()); 617 web_contents_->GetEncoding());
617 } 618 }
618 619
620 void WebContentsAndroid::SetOverscrollRefreshHandler(
621 JNIEnv* env,
622 const base::android::JavaParamRef<jobject>& obj,
623 jlong overscroll_refresh_handler_ptr) {
624 WebContentsViewAndroid* view =
625 static_cast<WebContentsViewAndroid*>(web_contents_->GetView());
626 view->SetOverscrollRefreshHandler(
627 reinterpret_cast<ui::OverscrollRefreshHandler*>(
Ted C 2016/11/29 00:06:08 I believe this is undefined behavior in C++ and so
rlanday 2016/11/29 00:46:25 Ah, interesting... Fixing this (maybe by adding @
628 overscroll_refresh_handler_ptr));
629 }
630
619 void WebContentsAndroid::GetContentBitmap( 631 void WebContentsAndroid::GetContentBitmap(
620 JNIEnv* env, 632 JNIEnv* env,
621 const JavaParamRef<jobject>& obj, 633 const JavaParamRef<jobject>& obj,
622 const JavaParamRef<jobject>& jcallback, 634 const JavaParamRef<jobject>& jcallback,
623 const JavaParamRef<jobject>& color_type, 635 const JavaParamRef<jobject>& color_type,
624 jfloat scale, 636 jfloat scale,
625 jfloat x, 637 jfloat x,
626 jfloat y, 638 jfloat y,
627 jfloat width, 639 jfloat width,
628 jfloat height) { 640 jfloat height) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); 735 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes);
724 } 736 }
725 737
726 void WebContentsAndroid::SetMediaSession( 738 void WebContentsAndroid::SetMediaSession(
727 const ScopedJavaLocalRef<jobject>& j_media_session) { 739 const ScopedJavaLocalRef<jobject>& j_media_session) {
728 JNIEnv* env = base::android::AttachCurrentThread(); 740 JNIEnv* env = base::android::AttachCurrentThread();
729 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); 741 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session);
730 } 742 }
731 743
732 } // namespace content 744 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698