| 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 322 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_->Reload(ReloadType::ORIGINAL_REQUEST_URL, true); | 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 |