| 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/web_contents/web_contents_android.h" | 5 #include "content/browser/web_contents/web_contents_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 if (!rwhva) | 163 if (!rwhva) |
| 164 return SK_ColorWHITE; | 164 return SK_ColorWHITE; |
| 165 return rwhva->GetCachedBackgroundColor(); | 165 return rwhva->GetCachedBackgroundColor(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetURL(JNIEnv* env, | 168 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetURL(JNIEnv* env, |
| 169 jobject obj) const { | 169 jobject obj) const { |
| 170 return ConvertUTF8ToJavaString(env, web_contents_->GetURL().spec()); | 170 return ConvertUTF8ToJavaString(env, web_contents_->GetURL().spec()); |
| 171 } | 171 } |
| 172 | 172 |
| 173 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetLastCommittedURL( | |
| 174 JNIEnv* env, | |
| 175 jobject) const { | |
| 176 return ConvertUTF8ToJavaString(env, | |
| 177 web_contents_->GetLastCommittedURL().spec()); | |
| 178 } | |
| 179 | |
| 180 | |
| 181 jboolean WebContentsAndroid::IsIncognito(JNIEnv* env, jobject obj) { | 173 jboolean WebContentsAndroid::IsIncognito(JNIEnv* env, jobject obj) { |
| 182 return web_contents_->GetBrowserContext()->IsOffTheRecord(); | 174 return web_contents_->GetBrowserContext()->IsOffTheRecord(); |
| 183 } | 175 } |
| 184 | 176 |
| 185 void WebContentsAndroid::ResumeResponseDeferredAtStart(JNIEnv* env, | 177 void WebContentsAndroid::ResumeResponseDeferredAtStart(JNIEnv* env, |
| 186 jobject obj) { | 178 jobject obj) { |
| 187 static_cast<WebContentsImpl*>(web_contents_)->ResumeResponseDeferredAtStart(); | 179 static_cast<WebContentsImpl*>(web_contents_)->ResumeResponseDeferredAtStart(); |
| 188 } | 180 } |
| 189 | 181 |
| 190 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( | 182 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 jstring message) { | 473 jstring message) { |
| 482 DCHECK_GE(level, 0); | 474 DCHECK_GE(level, 0); |
| 483 DCHECK_LE(level, CONSOLE_MESSAGE_LEVEL_LAST); | 475 DCHECK_LE(level, CONSOLE_MESSAGE_LEVEL_LAST); |
| 484 | 476 |
| 485 web_contents_->GetMainFrame()->Send(new DevToolsAgentMsg_AddMessageToConsole( | 477 web_contents_->GetMainFrame()->Send(new DevToolsAgentMsg_AddMessageToConsole( |
| 486 web_contents_->GetMainFrame()->GetRoutingID(), | 478 web_contents_->GetMainFrame()->GetRoutingID(), |
| 487 static_cast<ConsoleMessageLevel>(level), | 479 static_cast<ConsoleMessageLevel>(level), |
| 488 ConvertJavaStringToUTF8(env, message))); | 480 ConvertJavaStringToUTF8(env, message))); |
| 489 } | 481 } |
| 490 | 482 |
| 491 jboolean WebContentsAndroid::HasAccessedInitialDocument( | |
| 492 JNIEnv* env, | |
| 493 jobject jobj) { | |
| 494 return static_cast<content::WebContentsImpl*>(web_contents_)-> | |
| 495 HasAccessedInitialDocument(); | |
| 496 } | |
| 497 | |
| 498 } // namespace content | 483 } // namespace content |
| OLD | NEW |