| 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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 void ContentViewCoreImpl::SetMultiTouchZoomSupportEnabled(JNIEnv* env, | 1174 void ContentViewCoreImpl::SetMultiTouchZoomSupportEnabled(JNIEnv* env, |
| 1175 jobject obj, | 1175 jobject obj, |
| 1176 jboolean enabled) { | 1176 jboolean enabled) { |
| 1177 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 1177 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
| 1178 if (rwhv) | 1178 if (rwhv) |
| 1179 rwhv->SetMultiTouchZoomSupportEnabled(enabled); | 1179 rwhv->SetMultiTouchZoomSupportEnabled(enabled); |
| 1180 } | 1180 } |
| 1181 | 1181 |
| 1182 void ContentViewCoreImpl::LoadIfNecessary(JNIEnv* env, jobject obj) { | |
| 1183 web_contents_->GetController().LoadIfNecessary(); | |
| 1184 } | |
| 1185 | |
| 1186 void ContentViewCoreImpl::RequestRestoreLoad(JNIEnv* env, jobject obj) { | |
| 1187 web_contents_->GetController().SetNeedsReload(); | |
| 1188 } | |
| 1189 | |
| 1190 void ContentViewCoreImpl::Reload(JNIEnv* env, | |
| 1191 jobject obj, | |
| 1192 jboolean check_for_repost) { | |
| 1193 if (web_contents_->GetController().NeedsReload()) | |
| 1194 web_contents_->GetController().LoadIfNecessary(); | |
| 1195 else | |
| 1196 web_contents_->GetController().Reload(check_for_repost); | |
| 1197 } | |
| 1198 | |
| 1199 void ContentViewCoreImpl::ReloadIgnoringCache(JNIEnv* env, | |
| 1200 jobject obj, | |
| 1201 jboolean check_for_repost) { | |
| 1202 web_contents_->GetController().ReloadIgnoringCache(check_for_repost); | |
| 1203 } | |
| 1204 | |
| 1205 void ContentViewCoreImpl::CancelPendingReload(JNIEnv* env, jobject obj) { | |
| 1206 web_contents_->GetController().CancelPendingReload(); | |
| 1207 } | |
| 1208 | |
| 1209 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { | |
| 1210 web_contents_->GetController().ContinuePendingReload(); | |
| 1211 } | |
| 1212 | |
| 1213 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { | 1182 void ContentViewCoreImpl::ClearHistory(JNIEnv* env, jobject obj) { |
| 1214 // TODO(creis): Do callers of this need to know if it fails? | 1183 // TODO(creis): Do callers of this need to know if it fails? |
| 1215 if (web_contents_->GetController().CanPruneAllButLastCommitted()) | 1184 if (web_contents_->GetController().CanPruneAllButLastCommitted()) |
| 1216 web_contents_->GetController().PruneAllButLastCommitted(); | 1185 web_contents_->GetController().PruneAllButLastCommitted(); |
| 1217 } | 1186 } |
| 1218 | 1187 |
| 1219 void ContentViewCoreImpl::AddStyleSheetByURL( | 1188 void ContentViewCoreImpl::AddStyleSheetByURL( |
| 1220 JNIEnv* env, jobject obj, jstring url) { | 1189 JNIEnv* env, jobject obj, jstring url) { |
| 1221 if (!web_contents_) | 1190 if (!web_contents_) |
| 1222 return; | 1191 return; |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1668 reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 1700 retained_objects_set); | 1669 retained_objects_set); |
| 1701 return reinterpret_cast<intptr_t>(view); | 1670 return reinterpret_cast<intptr_t>(view); |
| 1702 } | 1671 } |
| 1703 | 1672 |
| 1704 bool RegisterContentViewCore(JNIEnv* env) { | 1673 bool RegisterContentViewCore(JNIEnv* env) { |
| 1705 return RegisterNativesImpl(env); | 1674 return RegisterNativesImpl(env); |
| 1706 } | 1675 } |
| 1707 | 1676 |
| 1708 } // namespace content | 1677 } // namespace content |
| OLD | NEW |