OLD | NEW |
---|---|
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 <sys/system_properties.h> | 7 #include <sys/system_properties.h> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 #include "base/pickle.h" | 28 #include "base/pickle.h" |
29 #include "base/string16.h" | 29 #include "base/string16.h" |
30 #include "base/supports_user_data.h" | 30 #include "base/supports_user_data.h" |
31 #include "cc/layer.h" | 31 #include "cc/layer.h" |
32 #include "components/navigation_interception/intercept_navigation_delegate.h" | 32 #include "components/navigation_interception/intercept_navigation_delegate.h" |
33 #include "content/public/browser/android/content_view_core.h" | 33 #include "content/public/browser/android/content_view_core.h" |
34 #include "content/public/browser/browser_thread.h" | 34 #include "content/public/browser/browser_thread.h" |
35 #include "content/public/browser/cert_store.h" | 35 #include "content/public/browser/cert_store.h" |
36 #include "content/public/browser/navigation_entry.h" | 36 #include "content/public/browser/navigation_entry.h" |
37 #include "content/public/browser/render_process_host.h" | 37 #include "content/public/browser/render_process_host.h" |
38 #include "content/public/browser/render_view_host.h" | |
38 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
39 #include "content/public/common/ssl_status.h" | 40 #include "content/public/common/ssl_status.h" |
40 #include "jni/AwContents_jni.h" | 41 #include "jni/AwContents_jni.h" |
41 #include "net/base/x509_certificate.h" | 42 #include "net/base/x509_certificate.h" |
42 #include "skia/ext/refptr.h" | 43 #include "skia/ext/refptr.h" |
43 #include "third_party/skia/include/core/SkBitmap.h" | 44 #include "third_party/skia/include/core/SkBitmap.h" |
44 #include "third_party/skia/include/core/SkCanvas.h" | 45 #include "third_party/skia/include/core/SkCanvas.h" |
45 #include "third_party/skia/include/core/SkDevice.h" | 46 #include "third_party/skia/include/core/SkDevice.h" |
46 #include "third_party/skia/include/core/SkPicture.h" | 47 #include "third_party/skia/include/core/SkPicture.h" |
47 #include "ui/gfx/android/java_bitmap.h" | 48 #include "ui/gfx/android/java_bitmap.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 AwContents* contents_; | 109 AwContents* contents_; |
109 }; | 110 }; |
110 | 111 |
111 } // namespace | 112 } // namespace |
112 | 113 |
113 // static | 114 // static |
114 AwContents* AwContents::FromWebContents(WebContents* web_contents) { | 115 AwContents* AwContents::FromWebContents(WebContents* web_contents) { |
115 return AwContentsUserData::GetContents(web_contents); | 116 return AwContentsUserData::GetContents(web_contents); |
116 } | 117 } |
117 | 118 |
119 // static | |
120 AwContents* AwContents::FromID(int render_process_id, int render_view_id) { | |
121 const content::RenderViewHost* rvh = | |
Kristian Monsen
2013/02/07 03:30:55
Should this only be used on the UI thread? In that
sgurun-gerrit only
2013/02/07 03:37:32
One of the methods that the FromID calls already c
| |
122 content::RenderViewHost::FromID(render_process_id, render_view_id); | |
123 if (!rvh) return NULL; | |
124 content::WebContents* web_contents = | |
125 content::WebContents::FromRenderViewHost(rvh); | |
126 if (!web_contents) return NULL; | |
127 return FromWebContents(web_contents); | |
128 } | |
129 | |
118 AwContents::AwContents(JNIEnv* env, | 130 AwContents::AwContents(JNIEnv* env, |
119 jobject obj, | 131 jobject obj, |
120 jobject web_contents_delegate) | 132 jobject web_contents_delegate) |
121 : java_ref_(env, obj), | 133 : java_ref_(env, obj), |
122 web_contents_delegate_( | 134 web_contents_delegate_( |
123 new AwWebContentsDelegate(env, web_contents_delegate)), | 135 new AwWebContentsDelegate(env, web_contents_delegate)), |
124 view_visible_(false), | 136 view_visible_(false), |
125 compositor_visible_(false), | 137 compositor_visible_(false), |
126 is_composite_pending_(false), | 138 is_composite_pending_(false), |
127 last_frame_context_(NULL) { | 139 last_frame_context_(NULL) { |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
911 CHECK_EQ(web_contents_->GetRenderProcessHost()->GetID(), process_id); | 923 CHECK_EQ(web_contents_->GetRenderProcessHost()->GetID(), process_id); |
912 if (render_view_id != web_contents_->GetRoutingID()) | 924 if (render_view_id != web_contents_->GetRoutingID()) |
913 return; | 925 return; |
914 | 926 |
915 // TODO(leandrogracia): delete when sw rendering uses Ubercompositor. | 927 // TODO(leandrogracia): delete when sw rendering uses Ubercompositor. |
916 // Invalidation should be provided by the compositor only. | 928 // Invalidation should be provided by the compositor only. |
917 Invalidate(); | 929 Invalidate(); |
918 } | 930 } |
919 | 931 |
920 } // namespace android_webview | 932 } // namespace android_webview |
OLD | NEW |