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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 base::android::ConvertJavaStringToUTF8(env, user_agent_override); | 741 base::android::ConvertJavaStringToUTF8(env, user_agent_override); |
742 web_contents_->SetUserAgentOverride(override); | 742 web_contents_->SetUserAgentOverride(override); |
743 bool override_used = !override.empty(); | 743 bool override_used = !override.empty(); |
744 const NavigationController& controller = web_contents_->GetController(); | 744 const NavigationController& controller = web_contents_->GetController(); |
745 for (int i = 0; i < controller.GetEntryCount(); ++i) | 745 for (int i = 0; i < controller.GetEntryCount(); ++i) |
746 controller.GetEntryAtIndex(i)->SetIsOverridingUserAgent(override_used); | 746 controller.GetEntryAtIndex(i)->SetIsOverridingUserAgent(override_used); |
747 } | 747 } |
748 | 748 |
749 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( | 749 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetURL( |
750 JNIEnv* env, jobject) const { | 750 JNIEnv* env, jobject) const { |
751 return ConvertUTF8ToJavaString(env, GetWebContents()->GetURL().spec()); | 751 content::NavigationEntry* entry = |
joth
2013/03/22 17:12:52
I think this should comment why it's not using Get
Charlie Reis
2013/03/28 19:23:19
Done.
| |
752 web_contents_->GetController().GetActiveEntry(); | |
753 GURL url = entry ? entry->GetVirtualURL() : GURL::EmptyGURL(); | |
754 return ConvertUTF8ToJavaString(env, url.spec()); | |
752 } | 755 } |
753 | 756 |
754 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetTitle( | 757 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetTitle( |
755 JNIEnv* env, jobject obj) const { | 758 JNIEnv* env, jobject obj) const { |
756 return ConvertUTF16ToJavaString(env, GetWebContents()->GetTitle()); | 759 return ConvertUTF16ToJavaString(env, GetWebContents()->GetTitle()); |
757 } | 760 } |
758 | 761 |
759 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { | 762 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { |
760 return GetWebContents()->GetBrowserContext()->IsOffTheRecord(); | 763 return GetWebContents()->GetBrowserContext()->IsOffTheRecord(); |
761 } | 764 } |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1443 reinterpret_cast<WebContents*>(native_web_contents), | 1446 reinterpret_cast<WebContents*>(native_web_contents), |
1444 reinterpret_cast<ui::WindowAndroid*>(native_window)); | 1447 reinterpret_cast<ui::WindowAndroid*>(native_window)); |
1445 return reinterpret_cast<jint>(view); | 1448 return reinterpret_cast<jint>(view); |
1446 } | 1449 } |
1447 | 1450 |
1448 bool RegisterContentViewCore(JNIEnv* env) { | 1451 bool RegisterContentViewCore(JNIEnv* env) { |
1449 return RegisterNativesImpl(env); | 1452 return RegisterNativesImpl(env); |
1450 } | 1453 } |
1451 | 1454 |
1452 } // namespace content | 1455 } // namespace content |
OLD | NEW |