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 "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 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1175 | 1175 |
1176 void ContentViewCoreImpl::CancelPendingReload(JNIEnv* env, jobject obj) { | 1176 void ContentViewCoreImpl::CancelPendingReload(JNIEnv* env, jobject obj) { |
1177 web_contents_->GetController().CancelPendingReload(); | 1177 web_contents_->GetController().CancelPendingReload(); |
1178 } | 1178 } |
1179 | 1179 |
1180 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { | 1180 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { |
1181 web_contents_->GetController().ContinuePendingReload(); | 1181 web_contents_->GetController().ContinuePendingReload(); |
1182 } | 1182 } |
1183 | 1183 |
1184 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { | 1184 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { |
1185 web_contents_->GetController().PruneAllButActive(); | 1185 // TODO(creis): Do callers of this need to know if it fails? |
| 1186 if (web_contents_->GetController().CanPruneAllButVisible()) |
| 1187 web_contents_->GetController().PruneAllButVisible(); |
1186 } | 1188 } |
1187 | 1189 |
1188 void ContentViewCoreImpl::AddJavascriptInterface( | 1190 void ContentViewCoreImpl::AddJavascriptInterface( |
1189 JNIEnv* env, | 1191 JNIEnv* env, |
1190 jobject /* obj */, | 1192 jobject /* obj */, |
1191 jobject object, | 1193 jobject object, |
1192 jstring name, | 1194 jstring name, |
1193 jclass safe_annotation_clazz, | 1195 jclass safe_annotation_clazz, |
1194 jobject retained_object_set) { | 1196 jobject retained_object_set) { |
1195 ScopedJavaLocalRef<jobject> scoped_object(env, object); | 1197 ScopedJavaLocalRef<jobject> scoped_object(env, object); |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1563 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1562 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1564 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1563 return reinterpret_cast<jint>(view); | 1565 return reinterpret_cast<jint>(view); |
1564 } | 1566 } |
1565 | 1567 |
1566 bool RegisterContentViewCore(JNIEnv* env) { | 1568 bool RegisterContentViewCore(JNIEnv* env) { |
1567 return RegisterNativesImpl(env); | 1569 return RegisterNativesImpl(env); |
1568 } | 1570 } |
1569 | 1571 |
1570 } // namespace content | 1572 } // namespace content |
OLD | NEW |