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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { | 1204 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { |
1205 web_contents_->GetController().ContinuePendingReload(); | 1205 web_contents_->GetController().ContinuePendingReload(); |
1206 } | 1206 } |
1207 | 1207 |
1208 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { | 1208 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { |
1209 // TODO(creis): Do callers of this need to know if it fails? | 1209 // TODO(creis): Do callers of this need to know if it fails? |
1210 if (web_contents_->GetController().CanPruneAllButLastCommitted()) | 1210 if (web_contents_->GetController().CanPruneAllButLastCommitted()) |
1211 web_contents_->GetController().PruneAllButLastCommitted(); | 1211 web_contents_->GetController().PruneAllButLastCommitted(); |
1212 } | 1212 } |
1213 | 1213 |
| 1214 void ContentViewCoreImpl::AddStyleSheetByURL( |
| 1215 JNIEnv* env, jobject obj, jstring url) { |
| 1216 if (!web_contents_) |
| 1217 return; |
| 1218 |
| 1219 web_contents_->GetMainFrame()->Send(new FrameMsg_AddStyleSheetByURL( |
| 1220 web_contents_->GetMainFrame()->GetRoutingID(), |
| 1221 ConvertJavaStringToUTF8(env, url))); |
| 1222 } |
| 1223 |
1214 void ContentViewCoreImpl::SetAllowJavascriptInterfacesInspection( | 1224 void ContentViewCoreImpl::SetAllowJavascriptInterfacesInspection( |
1215 JNIEnv* env, | 1225 JNIEnv* env, |
1216 jobject obj, | 1226 jobject obj, |
1217 jboolean allow) { | 1227 jboolean allow) { |
1218 java_bridge_dispatcher_host_manager_->SetAllowObjectContentsInspection(allow); | 1228 java_bridge_dispatcher_host_manager_->SetAllowObjectContentsInspection(allow); |
1219 } | 1229 } |
1220 | 1230 |
1221 void ContentViewCoreImpl::AddJavascriptInterface( | 1231 void ContentViewCoreImpl::AddJavascriptInterface( |
1222 JNIEnv* env, | 1232 JNIEnv* env, |
1223 jobject /* obj */, | 1233 jobject /* obj */, |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1632 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1623 retained_objects_set); | 1633 retained_objects_set); |
1624 return reinterpret_cast<intptr_t>(view); | 1634 return reinterpret_cast<intptr_t>(view); |
1625 } | 1635 } |
1626 | 1636 |
1627 bool RegisterContentViewCore(JNIEnv* env) { | 1637 bool RegisterContentViewCore(JNIEnv* env) { |
1628 return RegisterNativesImpl(env); | 1638 return RegisterNativesImpl(env); |
1629 } | 1639 } |
1630 | 1640 |
1631 } // namespace content | 1641 } // namespace content |
OLD | NEW |