OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 std::string()); | 408 std::string()); |
409 PostLoadUrl(url); | 409 PostLoadUrl(url); |
410 } | 410 } |
411 | 411 |
412 void ContentViewCoreImpl::LoadUrlWithUserAgentOverride( | 412 void ContentViewCoreImpl::LoadUrlWithUserAgentOverride( |
413 const GURL& url, | 413 const GURL& url, |
414 int page_transition, | 414 int page_transition, |
415 const std::string& user_agent_override) { | 415 const std::string& user_agent_override) { |
416 web_contents()->SetUserAgentOverride(user_agent_override); | 416 web_contents()->SetUserAgentOverride(user_agent_override); |
417 bool is_overriding_user_agent(!user_agent_override.empty()); | 417 bool is_overriding_user_agent(!user_agent_override.empty()); |
418 content::Referrer referer; | 418 |
419 web_contents()->GetController().LoadURLWithUserAgentOverride( | 419 content::NavigationController::LoadURLParams load_url_params(url); |
420 url, referer, content::PageTransitionFromInt(page_transition), | 420 load_url_params.transition_type = |
421 false, std::string(), is_overriding_user_agent); | 421 content::PageTransitionFromInt(page_transition); |
| 422 load_url_params.should_inherit_user_agent_override = false; |
| 423 load_url_params.is_overriding_user_agent = is_overriding_user_agent; |
| 424 |
| 425 web_contents()->GetController().LoadURLWithParams(load_url_params); |
| 426 |
422 PostLoadUrl(url); | 427 PostLoadUrl(url); |
423 } | 428 } |
424 | 429 |
425 void ContentViewCoreImpl::PostLoadUrl(const GURL& url) { | 430 void ContentViewCoreImpl::PostLoadUrl(const GURL& url) { |
426 tab_crashed_ = false; | 431 tab_crashed_ = false; |
427 // TODO(tedchoc): Update the content view client of the page load request. | 432 // TODO(tedchoc): Update the content view client of the page load request. |
428 } | 433 } |
429 | 434 |
430 // ---------------------------------------------------------------------------- | 435 // ---------------------------------------------------------------------------- |
431 // Native JNI methods | 436 // Native JNI methods |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 591 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
587 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 592 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
588 return false; | 593 return false; |
589 } | 594 } |
590 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 595 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
591 | 596 |
592 return RegisterNativesImpl(env) >= 0; | 597 return RegisterNativesImpl(env) >= 0; |
593 } | 598 } |
594 | 599 |
595 } // namespace content | 600 } // namespace content |
OLD | NEW |