OLD | NEW |
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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 return aw_contents; | 179 return aw_contents; |
180 } | 180 } |
181 | 181 |
182 // static | 182 // static |
183 AwSafeBrowsingUIManager::UIManagerClient* | 183 AwSafeBrowsingUIManager::UIManagerClient* |
184 AwSafeBrowsingUIManager::UIManagerClient::FromWebContents( | 184 AwSafeBrowsingUIManager::UIManagerClient::FromWebContents( |
185 WebContents* web_contents) { | 185 WebContents* web_contents) { |
186 return AwContents::FromWebContents(web_contents); | 186 return AwContents::FromWebContents(web_contents); |
187 } | 187 } |
188 | 188 |
| 189 // static |
| 190 AwRenderProcessGoneDelegate* AwRenderProcessGoneDelegate::FromWebContents( |
| 191 content::WebContents* web_contents) { |
| 192 return AwContents::FromWebContents(web_contents); |
| 193 } |
| 194 |
189 AwContents::AwContents(std::unique_ptr<WebContents> web_contents) | 195 AwContents::AwContents(std::unique_ptr<WebContents> web_contents) |
190 : content::WebContentsObserver(web_contents.get()), | 196 : content::WebContentsObserver(web_contents.get()), |
191 functor_(nullptr), | 197 functor_(nullptr), |
192 browser_view_renderer_( | 198 browser_view_renderer_( |
193 this, | 199 this, |
194 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)), | 200 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)), |
195 web_contents_(std::move(web_contents)), | 201 web_contents_(std::move(web_contents)), |
196 renderer_manager_key_(GLViewRendererManager::GetInstance()->NullKey()) { | 202 renderer_manager_key_(GLViewRendererManager::GetInstance()->NullKey()) { |
197 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, 1); | 203 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, 1); |
198 icon_helper_.reset(new IconHelper(web_contents_.get())); | 204 icon_helper_.reset(new IconHelper(web_contents_.get())); |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 } | 1314 } |
1309 | 1315 |
1310 bool AwContents::CanShowInterstitial() { | 1316 bool AwContents::CanShowInterstitial() { |
1311 JNIEnv* env = AttachCurrentThread(); | 1317 JNIEnv* env = AttachCurrentThread(); |
1312 const ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1318 const ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1313 if (obj.is_null()) | 1319 if (obj.is_null()) |
1314 return false; | 1320 return false; |
1315 return Java_AwContents_canShowInterstitial(env, obj); | 1321 return Java_AwContents_canShowInterstitial(env, obj); |
1316 } | 1322 } |
1317 | 1323 |
| 1324 void AwContents::OnRenderProcessGone(int child_process_id) { |
| 1325 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1326 JNIEnv* env = AttachCurrentThread(); |
| 1327 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1328 if (obj.is_null()) |
| 1329 return; |
| 1330 |
| 1331 Java_AwContents_onRenderProcessGone(env, obj, child_process_id); |
| 1332 } |
| 1333 |
| 1334 bool AwContents::OnRenderProcessGoneDetail(int child_process_id, |
| 1335 bool crashed) { |
| 1336 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1337 JNIEnv* env = AttachCurrentThread(); |
| 1338 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1339 if (obj.is_null()) |
| 1340 return false; |
| 1341 |
| 1342 return Java_AwContents_onRenderProcessGoneDetail(env, obj, |
| 1343 child_process_id, crashed); |
| 1344 } |
| 1345 |
1318 } // namespace android_webview | 1346 } // namespace android_webview |
OLD | NEW |