| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(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(check_for_repost, ReloadType::BYPASSING_CACHE); |
| 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 navigation_controller_->Reload(false, ReloadType::ORIGINAL_REQUEST_URL); |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 | 346 |
| 347 base::android::ScopedJavaLocalRef<jobject> | 347 base::android::ScopedJavaLocalRef<jobject> |
| 348 NavigationControllerAndroid::GetEntryAtIndex(JNIEnv* env, | 348 NavigationControllerAndroid::GetEntryAtIndex(JNIEnv* env, |
| 349 const JavaParamRef<jobject>& obj, | 349 const JavaParamRef<jobject>& obj, |
| 350 int index) { | 350 int index) { |
| 351 if (index < 0 || index >= navigation_controller_->GetEntryCount()) | 351 if (index < 0 || index >= navigation_controller_->GetEntryCount()) |
| 352 return base::android::ScopedJavaLocalRef<jobject>(); | 352 return base::android::ScopedJavaLocalRef<jobject>(); |
| 353 | 353 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 const JavaParamRef<jstring>& jvalue) { | 436 const JavaParamRef<jstring>& jvalue) { |
| 437 if (index < 0 || index >= navigation_controller_->GetEntryCount()) | 437 if (index < 0 || index >= navigation_controller_->GetEntryCount()) |
| 438 return; | 438 return; |
| 439 | 439 |
| 440 std::string key = base::android::ConvertJavaStringToUTF8(env, jkey); | 440 std::string key = base::android::ConvertJavaStringToUTF8(env, jkey); |
| 441 base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue); | 441 base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue); |
| 442 navigation_controller_->GetEntryAtIndex(index)->SetExtraData(key, value); | 442 navigation_controller_->GetEntryAtIndex(index)->SetExtraData(key, value); |
| 443 } | 443 } |
| 444 | 444 |
| 445 } // namespace content | 445 } // namespace content |
| OLD | NEW |