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

Side by Side Diff: content/browser/frame_host/navigation_controller_android.cc

Issue 2587923002: Reload: "Request desktop site" feature should ask reposting (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 // TODO(toyoshim): Should this call use |true| for check_for_post argument? 343 navigation_controller_->Reload(ReloadType::ORIGINAL_REQUEST_URL, true);
344 navigation_controller_->Reload(ReloadType::ORIGINAL_REQUEST_URL, false);
345 } 344 }
346 } 345 }
347 346
348 base::android::ScopedJavaLocalRef<jobject> 347 base::android::ScopedJavaLocalRef<jobject>
349 NavigationControllerAndroid::GetEntryAtIndex(JNIEnv* env, 348 NavigationControllerAndroid::GetEntryAtIndex(JNIEnv* env,
350 const JavaParamRef<jobject>& obj, 349 const JavaParamRef<jobject>& obj,
351 int index) { 350 int index) {
352 if (index < 0 || index >= navigation_controller_->GetEntryCount()) 351 if (index < 0 || index >= navigation_controller_->GetEntryCount())
353 return base::android::ScopedJavaLocalRef<jobject>(); 352 return base::android::ScopedJavaLocalRef<jobject>();
354 353
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 const JavaParamRef<jstring>& jvalue) { 436 const JavaParamRef<jstring>& jvalue) {
438 if (index < 0 || index >= navigation_controller_->GetEntryCount()) 437 if (index < 0 || index >= navigation_controller_->GetEntryCount())
439 return; 438 return;
440 439
441 std::string key = base::android::ConvertJavaStringToUTF8(env, jkey); 440 std::string key = base::android::ConvertJavaStringToUTF8(env, jkey);
442 base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue); 441 base::string16 value = base::android::ConvertJavaStringToUTF16(env, jvalue);
443 navigation_controller_->GetEntryAtIndex(index)->SetExtraData(key, value); 442 navigation_controller_->GetEntryAtIndex(index)->SetExtraData(key, value);
444 } 443 }
445 444
446 } // namespace content 445 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698