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

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 12697002: [Android WebView] Provide more information about WebView for web debugging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/browser_view_renderer_impl.h" 9 #include "android_webview/browser/browser_view_renderer_impl.h"
10 #include "android_webview/browser/net_disk_cache_remover.h" 10 #include "android_webview/browser/net_disk_cache_remover.h"
11 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" 11 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h"
12 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" 12 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h"
13 #include "android_webview/common/aw_hit_test_data.h" 13 #include "android_webview/common/aw_hit_test_data.h"
14 #include "android_webview/native/aw_browser_dependency_factory.h" 14 #include "android_webview/native/aw_browser_dependency_factory.h"
15 #include "android_webview/native/aw_contents_client_bridge.h" 15 #include "android_webview/native/aw_contents_client_bridge.h"
16 #include "android_webview/native/aw_contents_io_thread_client_impl.h" 16 #include "android_webview/native/aw_contents_io_thread_client_impl.h"
17 #include "android_webview/native/aw_web_contents_delegate.h" 17 #include "android_webview/native/aw_web_contents_delegate.h"
18 #include "android_webview/native/java_browser_view_renderer_helper.h" 18 #include "android_webview/native/java_browser_view_renderer_helper.h"
19 #include "android_webview/native/state_serializer.h" 19 #include "android_webview/native/state_serializer.h"
20 #include "android_webview/public/browser/draw_gl.h" 20 #include "android_webview/public/browser/draw_gl.h"
21 #include "base/android/jni_android.h" 21 #include "base/android/jni_android.h"
22 #include "base/android/jni_array.h" 22 #include "base/android/jni_array.h"
23 #include "base/android/jni_string.h" 23 #include "base/android/jni_string.h"
24 #include "base/android/scoped_java_ref.h"
24 #include "base/bind.h" 25 #include "base/bind.h"
25 #include "base/callback.h" 26 #include "base/callback.h"
26 #include "base/message_loop.h" 27 #include "base/message_loop.h"
27 #include "base/pickle.h" 28 #include "base/pickle.h"
28 #include "base/string16.h" 29 #include "base/string16.h"
29 #include "base/supports_user_data.h" 30 #include "base/supports_user_data.h"
30 #include "components/navigation_interception/intercept_navigation_delegate.h" 31 #include "components/navigation_interception/intercept_navigation_delegate.h"
31 #include "content/public/browser/android/content_view_core.h" 32 #include "content/public/browser/android/content_view_core.h"
32 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
33 #include "content/public/browser/cert_store.h" 34 #include "content/public/browser/cert_store.h"
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 } 666 }
666 667
667 void AwContents::FocusFirstNode(JNIEnv* env, jobject obj) { 668 void AwContents::FocusFirstNode(JNIEnv* env, jobject obj) {
668 web_contents_->FocusThroughTabTraversal(false); 669 web_contents_->FocusThroughTabTraversal(false);
669 } 670 }
670 671
671 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) { 672 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) {
672 return reinterpret_cast<jint>(pending_contents_.release()); 673 return reinterpret_cast<jint>(pending_contents_.release());
673 } 674 }
674 675
676 gfx::Point AwContents::GetLocationOnScreen() {
677 JNIEnv* env = AttachCurrentThread();
678 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
679 if (obj.is_null()) return gfx::Point();
680 std::vector<int> location;
681 base::android::JavaIntArrayToIntVector(
682 env,
683 Java_AwContents_getLocationOnScreen(env, obj.obj()).obj(),
684 &location);
685 return gfx::Point(location[0], location[1]);
686 }
687
675 ScopedJavaLocalRef<jobject> AwContents::CapturePicture(JNIEnv* env, 688 ScopedJavaLocalRef<jobject> AwContents::CapturePicture(JNIEnv* env,
676 jobject obj) { 689 jobject obj) {
677 return browser_view_renderer_->CapturePicture(); 690 return browser_view_renderer_->CapturePicture();
678 } 691 }
679 692
680 void AwContents::EnableOnNewPicture(JNIEnv* env, 693 void AwContents::EnableOnNewPicture(JNIEnv* env,
681 jobject obj, 694 jobject obj,
682 jboolean enabled, 695 jboolean enabled,
683 jboolean invalidation_only) { 696 jboolean invalidation_only) {
684 BrowserViewRenderer::OnNewPictureMode mode = 697 BrowserViewRenderer::OnNewPictureMode mode =
685 BrowserViewRenderer::kOnNewPictureDisabled; 698 BrowserViewRenderer::kOnNewPictureDisabled;
686 if (enabled) { 699 if (enabled) {
687 mode = invalidation_only ? 700 mode = invalidation_only ?
688 BrowserViewRenderer::kOnNewPictureInvalidationOnly : 701 BrowserViewRenderer::kOnNewPictureInvalidationOnly :
689 BrowserViewRenderer::kOnNewPictureEnabled; 702 BrowserViewRenderer::kOnNewPictureEnabled;
690 } 703 }
691 704
692 browser_view_renderer_->EnableOnNewPicture(mode); 705 browser_view_renderer_->EnableOnNewPicture(mode);
693 } 706 }
694 707
695 } // namespace android_webview 708 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698