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 27 matching lines...) Expand all Loading... |
38 #include "android_webview/public/browser/draw_gl.h" | 38 #include "android_webview/public/browser/draw_gl.h" |
39 #include "base/android/jni_android.h" | 39 #include "base/android/jni_android.h" |
40 #include "base/android/jni_array.h" | 40 #include "base/android/jni_array.h" |
41 #include "base/android/jni_string.h" | 41 #include "base/android/jni_string.h" |
42 #include "base/android/locale_utils.h" | 42 #include "base/android/locale_utils.h" |
43 #include "base/android/scoped_java_ref.h" | 43 #include "base/android/scoped_java_ref.h" |
44 #include "base/atomicops.h" | 44 #include "base/atomicops.h" |
45 #include "base/bind.h" | 45 #include "base/bind.h" |
46 #include "base/callback.h" | 46 #include "base/callback.h" |
47 #include "base/command_line.h" | 47 #include "base/command_line.h" |
| 48 #include "base/location.h" |
48 #include "base/memory/memory_pressure_listener.h" | 49 #include "base/memory/memory_pressure_listener.h" |
49 #include "base/memory/ptr_util.h" | 50 #include "base/memory/ptr_util.h" |
50 #include "base/message_loop/message_loop.h" | |
51 #include "base/pickle.h" | 51 #include "base/pickle.h" |
| 52 #include "base/single_thread_task_runner.h" |
52 #include "base/strings/string16.h" | 53 #include "base/strings/string16.h" |
53 #include "base/supports_user_data.h" | 54 #include "base/supports_user_data.h" |
| 55 #include "base/threading/thread_task_runner_handle.h" |
54 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 56 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
55 #include "components/autofill/core/browser/autofill_manager.h" | 57 #include "components/autofill/core/browser/autofill_manager.h" |
56 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 58 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 59 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
58 #include "components/navigation_interception/intercept_navigation_delegate.h" | 60 #include "components/navigation_interception/intercept_navigation_delegate.h" |
59 #include "content/public/browser/android/content_view_core.h" | 61 #include "content/public/browser/android/content_view_core.h" |
60 #include "content/public/browser/android/synchronous_compositor.h" | 62 #include "content/public/browser/android/synchronous_compositor.h" |
61 #include "content/public/browser/browser_thread.h" | 63 #include "content/public/browser/browser_thread.h" |
62 #include "content/public/browser/cert_store.h" | 64 #include "content/public/browser/cert_store.h" |
63 #include "content/public/browser/child_process_security_policy.h" | 65 #include "content/public/browser/child_process_security_policy.h" |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 return browser_view_renderer_.OnDrawSoftware(canvas_holder->GetCanvas()); | 963 return browser_view_renderer_.OnDrawSoftware(canvas_holder->GetCanvas()); |
962 } | 964 } |
963 | 965 |
964 void AwContents::SetPendingWebContentsForPopup( | 966 void AwContents::SetPendingWebContentsForPopup( |
965 std::unique_ptr<content::WebContents> pending) { | 967 std::unique_ptr<content::WebContents> pending) { |
966 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 968 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
967 if (pending_contents_.get()) { | 969 if (pending_contents_.get()) { |
968 // TODO(benm): Support holding multiple pop up window requests. | 970 // TODO(benm): Support holding multiple pop up window requests. |
969 LOG(WARNING) << "Blocking popup window creation as an outstanding " | 971 LOG(WARNING) << "Blocking popup window creation as an outstanding " |
970 << "popup window is still pending."; | 972 << "popup window is still pending."; |
971 base::MessageLoop::current()->DeleteSoon(FROM_HERE, pending.release()); | 973 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, |
| 974 pending.release()); |
972 return; | 975 return; |
973 } | 976 } |
974 pending_contents_.reset(new AwContents(std::move(pending))); | 977 pending_contents_.reset(new AwContents(std::move(pending))); |
975 // Set dip_scale for pending contents, which is necessary for the later | 978 // Set dip_scale for pending contents, which is necessary for the later |
976 // SynchronousCompositor and InputHandler setup. | 979 // SynchronousCompositor and InputHandler setup. |
977 pending_contents_->SetDipScaleInternal(browser_view_renderer_.dip_scale()); | 980 pending_contents_->SetDipScaleInternal(browser_view_renderer_.dip_scale()); |
978 } | 981 } |
979 | 982 |
980 void AwContents::FocusFirstNode(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 983 void AwContents::FocusFirstNode(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
981 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 984 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 const JavaParamRef<jobject>& obj) { | 1282 const JavaParamRef<jobject>& obj) { |
1280 web_contents_->ResumeLoadingCreatedWebContents(); | 1283 web_contents_->ResumeLoadingCreatedWebContents(); |
1281 } | 1284 } |
1282 | 1285 |
1283 void SetShouldDownloadFavicons(JNIEnv* env, | 1286 void SetShouldDownloadFavicons(JNIEnv* env, |
1284 const JavaParamRef<jclass>& jclazz) { | 1287 const JavaParamRef<jclass>& jclazz) { |
1285 g_should_download_favicons = true; | 1288 g_should_download_favicons = true; |
1286 } | 1289 } |
1287 | 1290 |
1288 } // namespace android_webview | 1291 } // namespace android_webview |
OLD | NEW |