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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); | 158 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); |
159 } | 159 } |
160 | 160 |
161 jint WebContentsAndroid::GetBackgroundColor(JNIEnv* env, jobject obj) { | 161 jint WebContentsAndroid::GetBackgroundColor(JNIEnv* env, jobject obj) { |
162 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 162 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
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 jint WebContentsAndroid::GetThemeColor(JNIEnv* env, jobject obj) { |
| 169 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
| 170 if (!rwhva) |
| 171 return SK_ColorWHITE; |
| 172 return rwhva->GetThemeColor(); |
| 173 } |
| 174 |
168 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetURL(JNIEnv* env, | 175 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetURL(JNIEnv* env, |
169 jobject obj) const { | 176 jobject obj) const { |
170 return ConvertUTF8ToJavaString(env, web_contents_->GetURL().spec()); | 177 return ConvertUTF8ToJavaString(env, web_contents_->GetURL().spec()); |
171 } | 178 } |
172 | 179 |
173 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetLastCommittedURL( | 180 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetLastCommittedURL( |
174 JNIEnv* env, | 181 JNIEnv* env, |
175 jobject) const { | 182 jobject) const { |
176 return ConvertUTF8ToJavaString(env, | 183 return ConvertUTF8ToJavaString(env, |
177 web_contents_->GetLastCommittedURL().spec()); | 184 web_contents_->GetLastCommittedURL().spec()); |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } | 496 } |
490 | 497 |
491 jboolean WebContentsAndroid::HasAccessedInitialDocument( | 498 jboolean WebContentsAndroid::HasAccessedInitialDocument( |
492 JNIEnv* env, | 499 JNIEnv* env, |
493 jobject jobj) { | 500 jobject jobj) { |
494 return static_cast<content::WebContentsImpl*>(web_contents_)-> | 501 return static_cast<content::WebContentsImpl*>(web_contents_)-> |
495 HasAccessedInitialDocument(); | 502 HasAccessedInitialDocument(); |
496 } | 503 } |
497 | 504 |
498 } // namespace content | 505 } // namespace content |
OLD | NEW |