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 "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 #include "content/browser/renderer_host/input/web_input_event_builders_android.h " | 30 #include "content/browser/renderer_host/input/web_input_event_builders_android.h " |
31 #include "content/browser/renderer_host/input/web_input_event_util.h" | 31 #include "content/browser/renderer_host/input/web_input_event_util.h" |
32 #include "content/browser/renderer_host/java/java_bound_object.h" | 32 #include "content/browser/renderer_host/java/java_bound_object.h" |
33 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h" | 33 #include "content/browser/renderer_host/java/java_bridge_dispatcher_host_manager .h" |
34 #include "content/browser/renderer_host/render_view_host_impl.h" | 34 #include "content/browser/renderer_host/render_view_host_impl.h" |
35 #include "content/browser/renderer_host/render_widget_host_impl.h" | 35 #include "content/browser/renderer_host/render_widget_host_impl.h" |
36 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 36 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
37 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host. h" | 37 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host. h" |
38 #include "content/browser/ssl/ssl_host_state.h" | 38 #include "content/browser/ssl/ssl_host_state.h" |
39 #include "content/browser/web_contents/web_contents_view_android.h" | 39 #include "content/browser/web_contents/web_contents_view_android.h" |
40 #include "content/common/frame_messages.h" | |
40 #include "content/common/input/web_input_event_traits.h" | 41 #include "content/common/input/web_input_event_traits.h" |
41 #include "content/common/input_messages.h" | 42 #include "content/common/input_messages.h" |
42 #include "content/common/view_messages.h" | 43 #include "content/common/view_messages.h" |
43 #include "content/public/browser/browser_accessibility_state.h" | 44 #include "content/public/browser/browser_accessibility_state.h" |
44 #include "content/public/browser/browser_context.h" | 45 #include "content/public/browser/browser_context.h" |
45 #include "content/public/browser/favicon_status.h" | 46 #include "content/public/browser/favicon_status.h" |
46 #include "content/public/browser/render_frame_host.h" | 47 #include "content/public/browser/render_frame_host.h" |
47 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
48 #include "content/public/common/content_client.h" | 49 #include "content/public/common/content_client.h" |
49 #include "content/public/common/content_switches.h" | 50 #include "content/public/common/content_switches.h" |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1195 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { | 1196 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { |
1196 web_contents_->GetController().ContinuePendingReload(); | 1197 web_contents_->GetController().ContinuePendingReload(); |
1197 } | 1198 } |
1198 | 1199 |
1199 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { | 1200 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { |
1200 // TODO(creis): Do callers of this need to know if it fails? | 1201 // TODO(creis): Do callers of this need to know if it fails? |
1201 if (web_contents_->GetController().CanPruneAllButLastCommitted()) | 1202 if (web_contents_->GetController().CanPruneAllButLastCommitted()) |
1202 web_contents_->GetController().PruneAllButLastCommitted(); | 1203 web_contents_->GetController().PruneAllButLastCommitted(); |
1203 } | 1204 } |
1204 | 1205 |
1206 void ContentViewCoreImpl::AddStyleSheetByURL( | |
1207 JNIEnv* env, jobject obj, jstring url) { | |
1208 if (web_contents_) | |
Sami
2014/06/03 15:07:30
Should use braces here since the body is a multi-l
| |
1209 web_contents_->GetMainFrame()->Send(new FrameMsg_AddStyleSheetByURL( | |
1210 web_contents_->GetMainFrame()->GetRoutingID(), | |
bulach
2014/06/03 10:51:56
nit: indent +2 here and below since it's a continu
| |
1211 ConvertJavaStringToUTF8(env, url))); | |
1212 } | |
1213 | |
1205 void ContentViewCoreImpl::SetAllowJavascriptInterfacesInspection( | 1214 void ContentViewCoreImpl::SetAllowJavascriptInterfacesInspection( |
1206 JNIEnv* env, | 1215 JNIEnv* env, |
1207 jobject obj, | 1216 jobject obj, |
1208 jboolean allow) { | 1217 jboolean allow) { |
1209 java_bridge_dispatcher_host_manager_->SetAllowObjectContentsInspection(allow); | 1218 java_bridge_dispatcher_host_manager_->SetAllowObjectContentsInspection(allow); |
1210 } | 1219 } |
1211 | 1220 |
1212 void ContentViewCoreImpl::AddJavascriptInterface( | 1221 void ContentViewCoreImpl::AddJavascriptInterface( |
1213 JNIEnv* env, | 1222 JNIEnv* env, |
1214 jobject /* obj */, | 1223 jobject /* obj */, |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1615 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1624 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1616 retained_objects_set); | 1625 retained_objects_set); |
1617 return reinterpret_cast<intptr_t>(view); | 1626 return reinterpret_cast<intptr_t>(view); |
1618 } | 1627 } |
1619 | 1628 |
1620 bool RegisterContentViewCore(JNIEnv* env) { | 1629 bool RegisterContentViewCore(JNIEnv* env) { |
1621 return RegisterNativesImpl(env); | 1630 return RegisterNativesImpl(env); |
1622 } | 1631 } |
1623 | 1632 |
1624 } // namespace content | 1633 } // namespace content |
OLD | NEW |