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 |
173 jboolean WebContentsAndroid::IsIncognito(JNIEnv* env, jobject obj) { | 181 jboolean WebContentsAndroid::IsIncognito(JNIEnv* env, jobject obj) { |
174 return web_contents_->GetBrowserContext()->IsOffTheRecord(); | 182 return web_contents_->GetBrowserContext()->IsOffTheRecord(); |
175 } | 183 } |
176 | 184 |
177 void WebContentsAndroid::ResumeResponseDeferredAtStart(JNIEnv* env, | 185 void WebContentsAndroid::ResumeResponseDeferredAtStart(JNIEnv* env, |
178 jobject obj) { | 186 jobject obj) { |
179 static_cast<WebContentsImpl*>(web_contents_)->ResumeResponseDeferredAtStart(); | 187 static_cast<WebContentsImpl*>(web_contents_)->ResumeResponseDeferredAtStart(); |
180 } | 188 } |
181 | 189 |
182 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( | 190 void WebContentsAndroid::SetHasPendingNavigationTransitionForTesting( |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 jstring message) { | 481 jstring message) { |
474 DCHECK_GE(level, 0); | 482 DCHECK_GE(level, 0); |
475 DCHECK_LE(level, CONSOLE_MESSAGE_LEVEL_LAST); | 483 DCHECK_LE(level, CONSOLE_MESSAGE_LEVEL_LAST); |
476 | 484 |
477 web_contents_->GetMainFrame()->Send(new DevToolsAgentMsg_AddMessageToConsole( | 485 web_contents_->GetMainFrame()->Send(new DevToolsAgentMsg_AddMessageToConsole( |
478 web_contents_->GetMainFrame()->GetRoutingID(), | 486 web_contents_->GetMainFrame()->GetRoutingID(), |
479 static_cast<ConsoleMessageLevel>(level), | 487 static_cast<ConsoleMessageLevel>(level), |
480 ConvertJavaStringToUTF8(env, message))); | 488 ConvertJavaStringToUTF8(env, message))); |
481 } | 489 } |
482 | 490 |
| 491 jboolean WebContentsAndroid::HasAccessedInitialDocument( |
| 492 JNIEnv* env, |
| 493 jobject jobj) { |
| 494 return static_cast<content::WebContentsImpl*>(web_contents_)-> |
| 495 HasAccessedInitialDocument(); |
| 496 } |
| 497 |
483 } // namespace content | 498 } // namespace content |
OLD | NEW |