Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 49353008: Add way to reload the page, ignoring the cache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Take 4 Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 } 1193 }
1194 1194
1195 void ContentViewCoreImpl::RequestRestoreLoad(JNIEnv* env, jobject obj) { 1195 void ContentViewCoreImpl::RequestRestoreLoad(JNIEnv* env, jobject obj) {
1196 web_contents_->GetController().SetNeedsReload(); 1196 web_contents_->GetController().SetNeedsReload();
1197 } 1197 }
1198 1198
1199 void ContentViewCoreImpl::StopLoading(JNIEnv* env, jobject obj) { 1199 void ContentViewCoreImpl::StopLoading(JNIEnv* env, jobject obj) {
1200 web_contents_->Stop(); 1200 web_contents_->Stop();
1201 } 1201 }
1202 1202
1203 void ContentViewCoreImpl::Reload(JNIEnv* env, jobject obj) { 1203 void ContentViewCoreImpl::Reload(JNIEnv* env,
1204 // Set check_for_repost parameter to false as we have no repost confirmation 1204 jobject obj,
1205 // dialog ("confirm form resubmission" screen will still appear, however). 1205 jboolean ignore_cache) {
1206 if (web_contents_->GetController().NeedsReload()) 1206 if (ignore_cache)
1207 web_contents_->GetController().ReloadIgnoringCache(true);
1208 else if (web_contents_->GetController().NeedsReload())
joth 2013/11/06 19:57:28 nit: use {} on if else ladder
gone 2013/11/06 21:24:35 Done.
1207 web_contents_->GetController().LoadIfNecessary(); 1209 web_contents_->GetController().LoadIfNecessary();
joth 2013/11/06 19:57:28 this is counter intuitive: if we "need a reload" w
gone 2013/11/06 21:24:35 Don't know the reasoning :/ I do know that the co
Ted C 2013/11/06 21:38:14 At least in the past, Reload didn't work for sessi
1208 else 1210 else
1209 web_contents_->GetController().Reload(true); 1211 web_contents_->GetController().Reload(true);
1210 UpdateTabCrashedFlag(); 1212 UpdateTabCrashedFlag();
1211 } 1213 }
1212 1214
1213 void ContentViewCoreImpl::CancelPendingReload(JNIEnv* env, jobject obj) { 1215 void ContentViewCoreImpl::CancelPendingReload(JNIEnv* env, jobject obj) {
1214 web_contents_->GetController().CancelPendingReload(); 1216 web_contents_->GetController().CancelPendingReload();
1215 } 1217 }
1216 1218
1217 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) { 1219 void ContentViewCoreImpl::ContinuePendingReload(JNIEnv* env, jobject obj) {
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 reinterpret_cast<ui::ViewAndroid*>(view_android), 1644 reinterpret_cast<ui::ViewAndroid*>(view_android),
1643 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1645 reinterpret_cast<ui::WindowAndroid*>(window_android));
1644 return reinterpret_cast<jint>(view); 1646 return reinterpret_cast<jint>(view);
1645 } 1647 }
1646 1648
1647 bool RegisterContentViewCore(JNIEnv* env) { 1649 bool RegisterContentViewCore(JNIEnv* env) {
1648 return RegisterNativesImpl(env); 1650 return RegisterNativesImpl(env);
1649 } 1651 }
1650 1652
1651 } // namespace content 1653 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698