OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/navigation_controller_android.h" | 5 #include "content/browser/frame_host/navigation_controller_android.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 void NavigationControllerAndroid::ContinuePendingReload( | 141 void NavigationControllerAndroid::ContinuePendingReload( |
142 JNIEnv* env, | 142 JNIEnv* env, |
143 const JavaParamRef<jobject>& obj) { | 143 const JavaParamRef<jobject>& obj) { |
144 navigation_controller_->ContinuePendingReload(); | 144 navigation_controller_->ContinuePendingReload(); |
145 } | 145 } |
146 | 146 |
147 void NavigationControllerAndroid::Reload(JNIEnv* env, | 147 void NavigationControllerAndroid::Reload(JNIEnv* env, |
148 const JavaParamRef<jobject>& obj, | 148 const JavaParamRef<jobject>& obj, |
149 jboolean check_for_repost) { | 149 jboolean check_for_repost) { |
150 navigation_controller_->Reload(check_for_repost); | 150 navigation_controller_->Reload(ReloadType::NORMAL, check_for_repost); |
151 } | 151 } |
152 | 152 |
153 void NavigationControllerAndroid::ReloadBypassingCache( | 153 void NavigationControllerAndroid::ReloadBypassingCache( |
154 JNIEnv* env, | 154 JNIEnv* env, |
155 const JavaParamRef<jobject>& obj, | 155 const JavaParamRef<jobject>& obj, |
156 jboolean check_for_repost) { | 156 jboolean check_for_repost) { |
157 navigation_controller_->ReloadBypassingCache(check_for_repost); | 157 navigation_controller_->Reload(ReloadType::BYPASSING_CACHE, check_for_repost); |
158 } | 158 } |
159 | 159 |
160 void NavigationControllerAndroid::RequestRestoreLoad( | 160 void NavigationControllerAndroid::RequestRestoreLoad( |
161 JNIEnv* env, | 161 JNIEnv* env, |
162 const JavaParamRef<jobject>& obj) { | 162 const JavaParamRef<jobject>& obj) { |
163 navigation_controller_->SetNeedsReload(); | 163 navigation_controller_->SetNeedsReload(); |
164 } | 164 } |
165 | 165 |
166 void NavigationControllerAndroid::CancelPendingReload( | 166 void NavigationControllerAndroid::CancelPendingReload( |
167 JNIEnv* env, | 167 JNIEnv* env, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 return; | 333 return; |
334 | 334 |
335 // Set the flag in the NavigationEntry. | 335 // Set the flag in the NavigationEntry. |
336 entry->SetIsOverridingUserAgent(enabled); | 336 entry->SetIsOverridingUserAgent(enabled); |
337 navigation_controller_->delegate()->UpdateOverridingUserAgent(); | 337 navigation_controller_->delegate()->UpdateOverridingUserAgent(); |
338 | 338 |
339 // Send the override to the renderer. | 339 // Send the override to the renderer. |
340 if (reload_on_state_change) { | 340 if (reload_on_state_change) { |
341 // Reloading the page will send the override down as part of the | 341 // Reloading the page will send the override down as part of the |
342 // navigation IPC message. | 342 // navigation IPC message. |
343 navigation_controller_->ReloadOriginalRequestURL(false); | 343 // TODO(toyoshim): Should this call use |true| for check_for_post argument? |
| 344 navigation_controller_->Reload(ReloadType::ORIGINAL_REQUEST_URL, false); |
344 } | 345 } |
345 } | 346 } |
346 | 347 |
347 base::android::ScopedJavaLocalRef<jobject> | 348 base::android::ScopedJavaLocalRef<jobject> |
348 NavigationControllerAndroid::GetEntryAtIndex(JNIEnv* env, | 349 NavigationControllerAndroid::GetEntryAtIndex(JNIEnv* env, |
349 const JavaParamRef<jobject>& obj, | 350 const JavaParamRef<jobject>& obj, |
350 int index) { | 351 int index) { |
351 if (index < 0 || index >= navigation_controller_->GetEntryCount()) | 352 if (index < 0 || index >= navigation_controller_->GetEntryCount()) |
352 return base::android::ScopedJavaLocalRef<jobject>(); | 353 return base::android::ScopedJavaLocalRef<jobject>(); |
353 | 354 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 const JavaParamRef<jstring>& jvalue) { | 437 const JavaParamRef<jstring>& jvalue) { |
437 if (index < 0 || index >= navigation_controller_->GetEntryCount()) | 438 if (index < 0 || index >= navigation_controller_->GetEntryCount()) |
438 return; | 439 return; |
439 | 440 |
440 std::string key = base::android::ConvertJavaStringToUTF8(env, jkey); | 441 std::string key = base::android::ConvertJavaStringToUTF8(env, jkey); |
441 base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue); | 442 base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue); |
442 navigation_controller_->GetEntryAtIndex(index)->SetExtraData(key, value); | 443 navigation_controller_->GetEntryAtIndex(index)->SetExtraData(key, value); |
443 } | 444 } |
444 | 445 |
445 } // namespace content | 446 } // namespace content |
OLD | NEW |