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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 web_contents_->GetController().GoToOffset(offset); | 863 web_contents_->GetController().GoToOffset(offset); |
864 } | 864 } |
865 | 865 |
866 void ContentViewCoreImpl::StopLoading(JNIEnv* env, jobject obj) { | 866 void ContentViewCoreImpl::StopLoading(JNIEnv* env, jobject obj) { |
867 web_contents_->Stop(); | 867 web_contents_->Stop(); |
868 } | 868 } |
869 | 869 |
870 void ContentViewCoreImpl::Reload(JNIEnv* env, jobject obj) { | 870 void ContentViewCoreImpl::Reload(JNIEnv* env, jobject obj) { |
871 // Set check_for_repost parameter to false as we have no repost confirmation | 871 // Set check_for_repost parameter to false as we have no repost confirmation |
872 // dialog ("confirm form resubmission" screen will still appear, however). | 872 // dialog ("confirm form resubmission" screen will still appear, however). |
873 web_contents_->GetController().Reload(true); | 873 if (web_contents_->GetController().NeedsReload()) |
| 874 web_contents_->GetController().LoadIfNecessary(); |
| 875 else |
| 876 web_contents_->GetController().Reload(true); |
874 tab_crashed_ = false; | 877 tab_crashed_ = false; |
875 } | 878 } |
876 | 879 |
877 void ContentViewCoreImpl::CancelPendingReload(JNIEnv* env, jobject obj) { | 880 void ContentViewCoreImpl::CancelPendingReload(JNIEnv* env, jobject obj) { |
878 web_contents_->GetController().CancelPendingReload(); | 881 web_contents_->GetController().CancelPendingReload(); |
879 } | 882 } |
880 | 883 |
881 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { | 884 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { |
882 web_contents_->GetController().ContinuePendingReload(); | 885 web_contents_->GetController().ContinuePendingReload(); |
883 } | 886 } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 1096 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
1094 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 1097 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
1095 return false; | 1098 return false; |
1096 } | 1099 } |
1097 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 1100 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
1098 | 1101 |
1099 return RegisterNativesImpl(env) >= 0; | 1102 return RegisterNativesImpl(env) >= 0; |
1100 } | 1103 } |
1101 | 1104 |
1102 } // namespace content | 1105 } // namespace content |
OLD | NEW |